-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
libroach: add basic file encryption stats. #26802
libroach: add basic file encryption stats. #26802
Conversation
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.
I still want to add a test that creates a full DB, checks the stats against the filesystem, restarts with different encryption settings, and checks again.
@@ -43,7 +43,7 @@ namespace cockroach { | |||
// DBOpenHook in OSS mode only verifies that no extra options are specified. | |||
__attribute__((weak)) rocksdb::Status DBOpenHook(std::shared_ptr<rocksdb::Logger> info_log, | |||
const std::string& db_dir, const DBOptions opts, | |||
EnvManager* env_ctx) { | |||
EnvManager* env_mgr) { |
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.
I forgot to rename this one with the rest.
@@ -13,8 +13,8 @@ | |||
// permissions and limitations under the License. | |||
|
|||
#include "file_registry.h" | |||
#include "../fmt.h" |
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.
not sure how I ended up doing that.
ea8f83b
to
8fb1048
Compare
Added a test that starts in plaintext, forces a compaction (to have a SST that remains in plaintext), re-opens with AES, and checks that the number of files using the active key is somewhere in |
3a10225
to
78b07fc
Compare
4399aaf
to
dc95a56
Compare
Reviewed 16 of 17 files at r1, 3 of 3 files at r2, 4 of 4 files at r3. c-deps/libroach/engine.cc, line 214 at r3 (raw file):
Why isn't this code on the CCL side if it's never run in a pure-OSS build? OTOH, the "total" stats at least seem like they could be computed in an OSS build. c-deps/libroach/engine.cc, line 233 at r3 (raw file):
If you're rotating keys because of a breach, the relevant concern is not when all the live data is using the new key, but when the last file that was using the old key has been deleted (you may also want some sort of overwriting deletion). I don't know if we should worry about that here, though. c-deps/libroach/engine.cc, line 242 at r3 (raw file):
This seems like a problem for any monitoring that would want to alert if there are any plaintext files. c-deps/libroach/utils.cc, line 40 at r3 (raw file):
Do we need a TODO about windows here? c-deps/libroach/include/libroach.h, line 317 at r3 (raw file):
Rename these to pkg/ui/ccl/src/views/reports/containers/stores/encryption.tsx, line 74 at r3 (raw file):
In the screenshot this looks like a key and value, not a subheading. Can we style this line differently (and make it a single cell)? Comments from Reviewable |
dc95a56
to
78b07fc
Compare
Review status: c-deps/libroach/engine.cc, line 214 at r3 (raw file): Previously, bdarnell (Ben Darnell) wrote…
It's technically tied to the c-deps/libroach/engine.cc, line 233 at r3 (raw file): Previously, bdarnell (Ben Darnell) wrote…
I think we'll need to worry about it before release. If the stats tell you 100% of the files are using the desired encryption settings, that needs to be true. This means:
The combination of those would account for all files created when the FileRegistry is in use. The transition to the FileRegistry on-disk format would still leave files unaccounted for but would be shorter lived. If we recommend that people start their stores with encryption, the FileRegistry will be accurate. I've added some todos for these proposals. I'll need to experiment more though. c-deps/libroach/engine.cc, line 242 at r3 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Definitely. Even if deletions while we're scanning are rare, it just takes one false positive to seriously irritate admins. Accurate numbers are definitely required. I think the proposal above will get us most of the way there (format transitions are still a pain, but we can detect those). c-deps/libroach/utils.cc, line 40 at r3 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Unsure. I still need to test all this on windows. But rocksdb itself hard-codes '/' all over the place (eg: the filename building utilities are all c-deps/libroach/include/libroach.h, line 317 at r3 (raw file): Previously, bdarnell (Ben Darnell) wrote…
Done. pkg/ui/ccl/src/views/reports/containers/stores/encryption.tsx, line 74 at r3 (raw file): Previously, bdarnell (Ben Darnell) wrote…
I've moved the UI change to a separate PR for now. But yes, I'll tweak that. I'll re-send that PR after some other UI changes I need to do on it (loading spinner, use of cached something-or-other). Comments from Reviewable |
UI components are being moved to a separate PR: #26890 |
requires cockroachdb#26802 for new `StoresResponse` fields. This adds basic file stats to the stores report page. Also improves the styling: - show decoded key info protobuf fields rather than raw proto (eg: creation date rather than unix timestamp) - table styling moved to core style file - full-width cells to head different sections Release note (admin ui change): add encryption statistics on stores report page
Reviewed 9 of 13 files at r4. Comments from Reviewable |
620689c
to
f239f8b
Compare
bors r+ |
Timed out |
bors r+ |
requires cockroachdb#26802 for new `StoresResponse` fields. This adds basic file stats to the stores report page. Also improves the styling: - show decoded key info protobuf fields rather than raw proto (eg: creation date rather than unix timestamp) - table styling moved to core style file - full-width cells to head different sections Release note (admin ui change): add encryption statistics on stores report page
Timed out |
bors r+ TC is finally not taking forever. |
Build failed (retrying...) |
Build failed (retrying...) |
bors r+ |
Build failed |
Count the number of files and bytes reported by rocksdb. Return totals for all files and for files using the active data key. This is meant to be a rough indication of encryption progress when changing key. Per-key ID stats will likely be necessary. There is no synchronization between rocksdb and the file registry so numbers may be off (eg: files deleted between calls). The active key may also differ from the one contained in the encryption_status field. Release note (general change): add encryption progress to stores debug page
f239f8b
to
5a80329
Compare
bors r+ Now that TC is green, maybe bors-triggered TC will be as well? |
26802: libroach: add basic file encryption stats. r=mberhault a=mberhault Count the number of files and bytes reported by rocksdb. Return totals for all files and for files using the active data key. This is meant to be a rough indication of encryption progress when changing key. Per-key ID stats will likely be necessary. There is no synchronization between rocksdb and the file registry so numbers may be off (eg: files deleted between calls). The active key may also differ from the one contained in the encryption_status field. Release note (general change): add encryption progress to stores debug page Co-authored-by: marc <[email protected]>
Build succeeded |
requires cockroachdb#26802 for new `StoresResponse` fields. This adds basic file stats to the stores report page. Also improves the styling: - show decoded key info protobuf fields rather than raw proto (eg: creation date rather than unix timestamp) - table styling moved to core style file - full-width cells to head different sections Release note (admin ui change): add encryption statistics on stores report page
Address TODOs from cockroachdb#26802 for more accurate file count/size calculation. Specifically: - plaintext files now have an entry in the file_registry - traverse file_registry when counting files - disable rocksdb deletions during the scan Still some TODOs to improve usability (eg: report "unknown" files, logic for older versions of files that stick around) but this should already drastically improve file stats reporting. Release note: None
27388: libroach: more accurate encryption file statistics. r=mberhault a=mberhault Address TODOs from #26802 for more accurate file count/size calculation. Specifically: - plaintext files now have an entry in the file_registry - traverse file_registry when counting files - disable rocksdb deletions during the scan Still some TODOs to improve usability (eg: report "unknown" files, logic for older versions of files that stick around) but this should already drastically improve file stats reporting. Release note: None Co-authored-by: marc <[email protected]>
Address TODOs from cockroachdb#26802 for more accurate file count/size calculation. Specifically: - plaintext files now have an entry in the file_registry - traverse file_registry when counting files - disable rocksdb deletions during the scan Still some TODOs to improve usability (eg: report "unknown" files, logic for older versions of files that stick around) but this should already drastically improve file stats reporting. Release note: None
requires cockroachdb#26802 for new `StoresResponse` fields. This adds basic file stats to the stores report page. Also improves the styling: - show decoded key info protobuf fields rather than raw proto (eg: creation date rather than unix timestamp) - table styling moved to core style file - full-width cells to head different sections Release note (admin ui change): add encryption statistics on stores report page
requires cockroachdb#26802 for new `StoresResponse` fields. This adds basic file stats to the stores report page. Also improves the styling: - show decoded key info protobuf fields rather than raw proto (eg: creation date rather than unix timestamp) - table styling moved to core style file - full-width cells to head different sections Release note (admin ui change): add encryption statistics on stores report page
Count the number of files and bytes reported by rocksdb.
Return totals for all files and for files using the active data key.
This is meant to be a rough indication of encryption progress when
changing key. Per-key ID stats will likely be necessary.
There is no synchronization between rocksdb and the file registry so
numbers may be off (eg: files deleted between calls). The active key may
also differ from the one contained in the encryption_status field.
Release note (general change): add encryption progress to stores debug page