提交 0cf6c8f7 编写于 作者: L Lei Jin

fix: use the correct edit when comparing log_number

Summary:
In the last fix, I forgot to point to the writer when comparing edit,
which is apparently not correct.

Test Plan: still running make whitebox_crash_test

Reviewers: igor, haobo, igor2

Reviewed By: igor2

CC: leveldb

Differential Revision: https://reviews.facebook.net/D16911
上级 453ec52c
......@@ -1512,14 +1512,14 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
for (const auto& writer : manifest_writers_) {
last_writer = writer;
LogAndApplyHelper(&builder, v, writer->edit, mu);
if (edit->has_log_number_) {
if (writer->edit->has_log_number_) {
// When batch commit of manifest writes, we could have multiple flush and
// compaction edits. A flush edit has a bigger log number than what
// VersionSet has while a compaction edit does not have a log number.
// In this case, we want to make sure the largest log number is updated
// to VersionSet
max_log_number_in_batch =
std::max(max_log_number_in_batch, edit->log_number_);
std::max(max_log_number_in_batch, writer->edit->log_number_);
}
batch_edits.push_back(writer->edit);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册