Fix syncronization issues
This commit is contained in:
parent
ff76895614
commit
2fb1fea30f
@ -1559,6 +1559,7 @@ Status DBImpl::WriteLevel0Table(ColumnFamilyData* cfd,
|
|||||||
// threads could be concurrently producing compacted files for
|
// threads could be concurrently producing compacted files for
|
||||||
// that key range.
|
// that key range.
|
||||||
if (base != nullptr && db_options_.max_background_compactions <= 1 &&
|
if (base != nullptr && db_options_.max_background_compactions <= 1 &&
|
||||||
|
db_options_.max_background_flushes == 0 &&
|
||||||
cfd->ioptions()->compaction_style == kCompactionStyleLevel) {
|
cfd->ioptions()->compaction_style == kCompactionStyleLevel) {
|
||||||
level = base->PickLevelForMemTableOutput(min_user_key, max_user_key);
|
level = base->PickLevelForMemTableOutput(min_user_key, max_user_key);
|
||||||
}
|
}
|
||||||
@ -1913,7 +1914,6 @@ Status DBImpl::RunManualCompaction(ColumnFamilyData* cfd, int input_level,
|
|||||||
bg_cv_.Wait();
|
bg_cv_.Wait();
|
||||||
} else {
|
} else {
|
||||||
manual_compaction_ = &manual;
|
manual_compaction_ = &manual;
|
||||||
assert(bg_compaction_scheduled_ == 0);
|
|
||||||
bg_compaction_scheduled_++;
|
bg_compaction_scheduled_++;
|
||||||
env_->Schedule(&DBImpl::BGWorkCompaction, this, Env::Priority::LOW);
|
env_->Schedule(&DBImpl::BGWorkCompaction, this, Env::Priority::LOW);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user