mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 16:30:56 +00:00
Assertion failure for L0-L1 compactions.
Summary: For level-0 compactions, we try to find if can include more L0 files in the same compaction run. This causes the 'smallest' and 'largest' key to get extended to a larger range. But the suceeding call to ParentRangeInCompaction() was still using the earlier values of 'smallest' and 'largest', Because of this bug, a file in L1 can be part of two concurrent compactions: one L0-L1 compaction and the other L1-L2 compaction. This should not cause any data loss, but will cause an assertion failure with debug builds. Test Plan: make check Differential Revision: https://reviews.facebook.net/D10677
This commit is contained in:
parent
988c20b9f7
commit
a8d3aa2c26
|
@ -2082,6 +2082,11 @@ Compaction* VersionSet::PickCompaction() {
|
||||||
// which will include the picked file.
|
// which will include the picked file.
|
||||||
c->inputs_[0].clear();
|
c->inputs_[0].clear();
|
||||||
current_->GetOverlappingInputs(0, &smallest, &largest, &c->inputs_[0]);
|
current_->GetOverlappingInputs(0, &smallest, &largest, &c->inputs_[0]);
|
||||||
|
|
||||||
|
// If we include more L0 files in the same compaction run it can
|
||||||
|
// cause the 'smallest' and 'largest' key to get extended to a
|
||||||
|
// larger range. So, re-invoke GetRange to get the new key range
|
||||||
|
GetRange(c->inputs_[0], &smallest, &largest);
|
||||||
if (ParentRangeInCompaction(&smallest, &largest,
|
if (ParentRangeInCompaction(&smallest, &largest,
|
||||||
level, &c->parent_index_)) {
|
level, &c->parent_index_)) {
|
||||||
delete c;
|
delete c;
|
||||||
|
|
Loading…
Reference in a new issue