-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storageccl: don't update file registry when creating unencrypted files #66273
storageccl: don't update file registry when creating unencrypted files #66273
Conversation
0615bb7
to
172638e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andyyang890, @itsbilal, @pbardea, and @sumeerbhola)
pkg/storage/pebble_file_registry.go, line 110 at r1 (raw file):
return nil }
Do we need to verify that the file doesn't already exist in the registry? I believe the only caller of SetFileEntry
is encryptedFS.Create
. Calling Create
on an existing path is permitted and truncates the file:
If the old file was encrypted and still in the registry, it looks like we'd have the incorrect registry state for the file unless we remove the existing entry.
172638e
to
09ec487
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal, @jbowens, @pbardea, and @sumeerbhola)
pkg/storage/pebble_file_registry.go, line 110 at r1 (raw file):
Previously, jbowens (Jackson Owens) wrote…
Do we need to verify that the file doesn't already exist in the registry? I believe the only caller of
SetFileEntry
isencryptedFS.Create
. CallingCreate
on an existing path is permitted and truncates the file:If the old file was encrypted and still in the registry, it looks like we'd have the incorrect registry state for the file unless we remove the existing entry.
Good catch, fixed!
Removing myself as a reviewer, deferring to storage folks but did want to mention that if this is a performance improvement (and it looks like it is), it may warrant a performance improvement release note. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test looks good!
I think we'll want to backport this to 21.1 and 20.2.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @andyyang890, @itsbilal, @jbowens, and @sumeerbhola)
pkg/storage/pebble_file_registry.go, line 105 at r2 (raw file):
// SetFileEntry sets filename => entry in the registry map and persists the registry. func (r *PebbleFileRegistry) SetFileEntry(filename string, entry *enginepb.FileEntry) error { // We choose not store an entry for unencrypted files since the absence of
nit: s/not store/not to store/
This patch changes PebbleFileRegistry to not store an entry for an unencrypted file. This should lead to a performance improvement since the file registry is rewritten every time it is updated. Release note: None
09ec487
to
0b806b4
Compare
Noted, will add a release note to the backports but not this commit since it will be replaced by an upcoming revamp of encryption-at-rest. |
bors r=jbowens |
Build failed: |
bors r=jbowens |
Build succeeded: |
This patch changes PebbleFileRegistry to not store an entry
for an unencrypted file. This should lead to a performance
improvement since the file registry is rewritten every time
it is updated.
Fixes #65430.
Release note: None