提交 fa23d1e4 编写于 作者: 奏之章

Fix for db_compaction_test

上级 1a50fd97
......@@ -632,11 +632,11 @@ void LevelIterator::SkipEmptyFileForward() {
// Move to next file
if (file_index_ >= flevel_->num_files - 1) {
// Already at the last file
SetFileIterator(nullptr);
file_iter_.SetValid(false);
return;
}
if (KeyReachedUpperBound(file_smallest_key(file_index_ + 1))) {
SetFileIterator(nullptr);
file_iter_.SetValid(false);
return;
}
InitFileIterator(file_index_ + 1);
......@@ -652,7 +652,7 @@ void LevelIterator::SkipEmptyFileBackward() {
// Move to previous file
if (file_index_ == 0) {
// Already the first file
SetFileIterator(nullptr);
file_iter_.SetValid(false);
return;
}
InitFileIterator(file_index_ - 1);
......
......@@ -134,6 +134,7 @@ struct MutableCFOptions {
inplace_update_num_locks(options.inplace_update_num_locks),
prefix_extractor(options.prefix_extractor),
disable_auto_compactions(options.disable_auto_compactions),
enable_lazy_compaction(options.enable_lazy_compaction),
soft_pending_compaction_bytes_limit(
options.soft_pending_compaction_bytes_limit),
hard_pending_compaction_bytes_limit(
......@@ -170,6 +171,7 @@ struct MutableCFOptions {
inplace_update_num_locks(0),
prefix_extractor(nullptr),
disable_auto_compactions(false),
enable_lazy_compaction(false),
soft_pending_compaction_bytes_limit(0),
hard_pending_compaction_bytes_limit(0),
level0_file_num_compaction_trigger(0),
......
......@@ -1661,7 +1661,7 @@ std::unordered_map<std::string, OptionTypeInfo>
{offset_of(&ColumnFamilyOptions::disable_auto_compactions),
OptionType::kBoolean, OptionVerificationType::kNormal, true,
offsetof(struct MutableCFOptions, disable_auto_compactions)}},
{"enable_lazy_compactions",
{"enable_lazy_compaction",
{offset_of(&ColumnFamilyOptions::enable_lazy_compaction),
OptionType::kBoolean, OptionVerificationType::kNormal, true,
offsetof(struct MutableCFOptions, enable_lazy_compaction)}},
......
......@@ -42,6 +42,8 @@ class IteratorWrapper {
return old_iter;
}
void SetValid(bool valid) { valid_ = valid; }
void DeleteIter(bool is_arena_mode) {
if (iter_) {
if (!is_arena_mode) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册