-
Notifications
You must be signed in to change notification settings - Fork 44
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
Calculate and verify CRC32 checksums for snapshot SST files #2436
base: main
Are you sure you want to change the base?
Conversation
Test Results 7 files ±0 7 suites ±0 4m 57s ⏱️ - 9m 43s Results for commit 400400c. ± Comparison against base commit 3da5356. This pull request removes 2 tests.
♻️ This comment has been updated with latest results. |
I'm in favor of getting this from rocksdb itself, having two potentially disagreeing values will only make debugging/repair harder in my opinion. |
|
pub crc32: u32, | ||
} | ||
|
||
impl From<&LiveFile> for ExtendedFileMetadata { |
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.
implementing From
on a reference is not conventional. From
by convention consumes its input. Do not hide the clone, instead, let the cost be visible to users of the API.
@@ -43,7 +43,7 @@ pub(crate) async fn run_tests(manager: PartitionStoreManager, mut partition_stor | |||
key_range: key_range.clone(), | |||
min_applied_lsn: snapshot.min_applied_lsn, | |||
db_comparator_name: snapshot.db_comparator_name.clone(), | |||
files: snapshot.files.clone(), | |||
files: snapshot.files.iter().map(|f| f.into()).collect(), |
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.
nit, fyi, another way to do it:
files: snapshot.files.iter().map(|f| f.into()).collect(), | |
files: snapshot.files.iter().map(Into::into).collect(), |
Did a quick scan, left a couple of nits. Happy to do a real review once you decide on whether using rocksdb's built-in sst crc checking (you need to enable this if it's not enabled by default) or not. |
Perfect, this is exactly what I was looking for! Thank you! |
I'd like to ensure that we can detect corruption either in-place, or during download, of snapshot data files.
So far this is just a draft; I'd love some input on these points: