-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improved snapshot creation logic. #2318
Improved snapshot creation logic. #2318
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2318 +/- ##
==========================================
- Coverage 86.46% 86.17% -0.30%
==========================================
Files 649 648 -1
Lines 64374 64770 +396
==========================================
+ Hits 55662 55815 +153
- Misses 8712 8955 +243
Continue to review full report at Codecov.
|
1, Solved problem of unstable test cases of snapshot_command_test. Problem is caused by a deadlock. createSnapshot(get read space_lock) --> updateHostInfo ( get write space_lock) -> cancelWriteBlocking end of createSnapshot (get read space_lock) . read_lock -> write_lock -> read_lock so deadlock occurred. Thanks @critical27. |
if (fs::FileUtils::exist(checkpointPath)) { | ||
LOG(ERROR) << "The snapshot file already exists: " << checkpointPath; | ||
return ResultCode::ERR_CHECKPOINT_ERROR; | ||
if (fs::FileUtils::exist(checkpointPath) && |
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.
Why not return success?
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.
Why not return success?
Because we don't have a way to verify the validity of the snapshot that has been created. For data security, I need to delete and recreate it at here.
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.
That's fine.
@@ -620,6 +620,13 @@ bool FileBasedWal::linkCurrentWAL(const char* newPath) { | |||
LOG(INFO) << idStr_ << "No wal files found, skip link"; | |||
return true; | |||
} | |||
|
|||
if (fs::FileUtils::exist(newPath) && | |||
!fs::FileUtils::remove(newPath, true)) { |
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.
ditto
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.
LGTM. Well done.
@@ -13,7 +13,6 @@ namespace nebula { | |||
namespace meta { | |||
|
|||
void CreateSnapshotProcessor::process(const cpp2::CreateSnapshotReq&) { | |||
folly::SharedMutex::ReadHolder rHolder(LockUtils::spaceLock()); |
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.
Good, 👍
The dump_syms tool path should be match with third party version. Co-authored-by: George <[email protected]>
Unable to reproduce on development machine, added some diagnostic information for snapshot_command_test.
Please ignore this PR, I will close it when I find the failure reason.