提交 1de58866 编写于 作者: S sdong 提交者: Facebook GitHub Bot

Fix flaky ldb_cmd_test tests caused by file deletions during validation (#8942)

Summary:
In FileChecksumTestHelper::VerifyEachFileChecksum(), we query the file list, and then for each file in the list verify the checksum. However, compaction can delete those files in the mean time and cause failures. To prevent it from happening, disable file deletion during the validation.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8942

Test Plan: Run exsiting test and see it doesn't fail.

Reviewed By: pdillinger

Differential Revision: D31086488

fbshipit-source-id: 554608f36d2dd3bf0a20dfc4039c68bd8533d7f8
上级 5268cdc9
......@@ -254,15 +254,18 @@ class FileChecksumTestHelper {
// comparing it with the one being generated when a SST file is created.
Status VerifyEachFileChecksum() {
assert(db_ != nullptr);
EXPECT_OK(db_->DisableFileDeletions());
std::vector<LiveFileMetaData> live_files;
db_->GetLiveFilesMetaData(&live_files);
Status cs;
for (auto a_file : live_files) {
Status cs = VerifyChecksum(a_file);
cs = VerifyChecksum(a_file);
if (!cs.ok()) {
return cs;
break;
}
}
return Status::OK();
EXPECT_OK(db_->EnableFileDeletions());
return cs;
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册