-
Notifications
You must be signed in to change notification settings - Fork 721
Enable file checksum for clone startup #1489
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
Enable file checksum for clone startup #1489
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.
Is it possible to test this by adding a clone MTR test that corrupts a few bytes before the cloned instance startup?
storage/rocksdb/clone/common.cc
Outdated
| temp.c_str()); | ||
| } | ||
|
|
||
| myrocks::rocksdb_file_checksums = |
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.
This does not appear to be the best place for this. Why not in fixup_on_startup in the same file?
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.
Moved it to the fixup_on_startup before renaming temp datadir to datadir.
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.
Tested in test server. In the restart during clone, it triggers the checksum verification.
2024-09-04T14:05:04.364182-07:00 0 [Note] [MY-011071] [Server] Plugin rocksdb reported: 'Verifying file checksums...'
2024-09-04T14:05:04.364244-07:00 0 [Note] [MY-011071] [Server] Plugin rocksdb reported: '...done'
Restart the recipient instance after clone finished, no checksum verification is triggered cause there is no related log reported by plugin rocksdb.
dcc1441 to
b6e7d94
Compare
|
@sunshine-Chun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
82f97d7 to
7c087d2
Compare
b6e7d94 to
ca49d1b
Compare
|
@sunshine-Chun has updated the pull request. You must reimport the pull request before landing. |
| // after a clone. | ||
| if (myrocks::rocksdb_file_checksums == | ||
| myrocks::file_checksums_type::CHECKSUMS_WRITE_AND_VERIFY_ON_CLONE && | ||
| temp_dir_exists_abort_if_not_dir(in_place_temp_datadir)) { |
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.
Thank you, this is a better location IMHO.I I'd also remove temp_dir_exists_abort_if_not_dir check for clarity, but up to you
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.
If temp_dir_exists_abort_if_not_dir is removed, will the restart happens on every mysqld restart, not just the restart right after clone? The intended behavior is the checksum verification only happens for clone.
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.
You are right, the current code is OK
| static const char *file_checksums_names[] = { | ||
| "CHECKSUMS_OFF", "CHECKSUMS_WRITE_ONLY", "CHECKSUMS_WRITE_AND_VERIFY", | ||
| NullS}; | ||
| "CHECKSUMS_WRITE_AND_VERIFY_ON_CLONE", NullS}; |
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.
Are there tests that need re-recording? main.mysqld--help-notwin, maybe others?
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.
Doesn't seem so. The related MTR test passes. But I add one more MTR test for this change. It's included in the latest iteration.
ca49d1b to
b69bea3
Compare
|
@sunshine-Chun has updated the pull request. You must reimport the pull request before landing. |
|
@sunshine-Chun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
b69bea3 to
6041c44
Compare
|
@sunshine-Chun has updated the pull request. You must reimport the pull request before landing. |
|
@sunshine-Chun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| @@ -0,0 +1 @@ | |||
| --rocksdb-file-checksums=CHECKSUMS_WRITE_AND_VERIFY_ON_CLONE | |||
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.
Can this be moved to the testcase restart_parameter settings?
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.
Moved to restart parameter.
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
6041c44 to
f2418fa
Compare
|
@sunshine-Chun has updated the pull request. You must reimport the pull request before landing. |
|
@sunshine-Chun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
This pull request has been merged in 6389d8d. |
Summary: This change is to enable file checksum check only for recipients of clone. For regular startup, we don't do the sst file checksum check.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags: