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
This commit is contained in:
parent
453ec52ca1
commit
0cf6c8f7ce
@ -1512,14 +1512,14 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
|
|||||||
for (const auto& writer : manifest_writers_) {
|
for (const auto& writer : manifest_writers_) {
|
||||||
last_writer = writer;
|
last_writer = writer;
|
||||||
LogAndApplyHelper(&builder, v, writer->edit, mu);
|
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
|
// When batch commit of manifest writes, we could have multiple flush and
|
||||||
// compaction edits. A flush edit has a bigger log number than what
|
// compaction edits. A flush edit has a bigger log number than what
|
||||||
// VersionSet has while a compaction edit does not have a log number.
|
// 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
|
// In this case, we want to make sure the largest log number is updated
|
||||||
// to VersionSet
|
// to VersionSet
|
||||||
max_log_number_in_batch =
|
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);
|
batch_edits.push_back(writer->edit);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user