-
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
release-22.2: cli: fix debug pebble commands on encrypted stores #110509
release-22.2: cli: fix debug pebble commands on encrypted stores #110509
Conversation
Currently the debug pebble commands only work correctly on an encrypted store if the encrypted store's path is `cockroach-data` or the store directory is passed using `--store` (in addition to being passed to the pebble subcommand itself). What's worse, knowledge of this subtle fact was lost among team members. The root cause is that we are trying to resolve encryption options using the server config. The difficulty is that there are a bunch of different commands and there is no unified way to obtain the store directory of interest To fix this, we create `autoDecryptFS`. This is a `vfs.FS` implementation which is able to automatically detect encrypted paths and use the correct unencrypted FS. It does this by having a list of known encrypted stores (the ones in the `--enterprise-encryption` flag), and looking for any of these paths as ancestors of any path in an operation. This new implementation replaces `swappableFS` and `absoluteFS`. We also improve the error message when we try to open an encrypted store without setting up the key correctly. Fixes: cockroachdb#110121 Release note (bug fix): `cockroach debug pebble` commands now work correctly with encrypted stores which don't use the default `cockroach-data` path without having to also pass `--store`.
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
Friendly ping. |
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.
Reviewed 6 of 8 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained
Backport 1/1 commits from #110507.
/cc @cockroachdb/release
Release justification: improves usability of tool used for customer support.
Currently the debug pebble commands only work correctly on an
encrypted store if the encrypted store's path is
cockroach-data
orthe store directory is passed using
--store
(in addition to beingpassed to the pebble subcommand itself). What's worse, knowledge of
this subtle fact was lost among team members.
The root cause is that we are trying to resolve encryption options
using the server config. The difficulty is that there are a bunch of
different commands and there is no unified way to obtain the store
directory of interest
To fix this, we create
autoDecryptFS
. This is avfs.FS
implementation which is able to automatically detect encrypted paths
and use the correct unencrypted FS. It does this by having a list of
known encrypted stores (the ones in the
--enterprise-encryption
flag), and looking for any of these paths as ancestors of any path in
an operation. This new implementation replaces
swappableFS
andabsoluteFS
.We also improve the error message when we try to open an encrypted
store without setting up the key correctly.
Fixes: #110121
Release note (bug fix):
cockroach debug pebble
commands now workcorrectly with encrypted stores which don't use the default
cockroach-data
path without having to also pass--store
.