Skip to content

file: truncating files which are not opened with append#19745

Merged
alyssawilk merged 3 commits intoenvoyproxy:mainfrom
alyssawilk:trunc
Feb 3, 2022
Merged

file: truncating files which are not opened with append#19745
alyssawilk merged 3 commits intoenvoyproxy:mainfrom
alyssawilk:trunc

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

Right now Envoy has 2 calls to file based writing, access logs (which append) and the key value store (which is buggy for short writes). We could wire a truncate flag through for k-v store, but I assert most folks want to either append or write-and-truncate, and we can add an InlineWrite flag if folks want !truncate behavior.

Risk Level: Medium
Testing: new unit test
Docs Changes: n/a
Release Notes: inline
[Optional Runtime guard:] yes

@alyssawilk alyssawilk self-assigned this Jan 31, 2022
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
mattklein123
mattklein123 previously approved these changes Feb 2, 2022
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor potential comment change.

enum Operation {
// Open a file for reading.
Read,
// Open a file for writing.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this comment explicitly say that the file will be truncated?

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk merged commit a844baf into envoyproxy:main Feb 3, 2022
joshperry pushed a commit to joshperry/envoy that referenced this pull request Feb 13, 2022
…9745)

Right now Envoy has 2 calls to file based writing, access logs (which append) and the key value store (which is buggy for short writes). We could wire a truncate flag through for k-v store, but I assert most folks want to either append or write-and-truncate, and we can add an InlineWrite flag if folks want !truncate behavior.

Risk Level: Medium
Testing: new unit test
Docs Changes: n/a
Release Notes: inline
[Optional Runtime guard:] yes

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Josh Perry <josh.perry@mx.com>
@alyssawilk alyssawilk deleted the trunc branch August 4, 2022 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants