Revert "Fix another bug caused by recent hash index fix (#6305)"
This reverts commit d87cffaea4
.
This commit is contained in:
parent
bd698e4f55
commit
cad5db1c3e
@ -4362,48 +4362,6 @@ TEST_F(DBTest2, BlockBasedTablePrefixIndexSeekForPrev) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(DBTest2, BlockBasedTablePrefixGetIndexNotFound) {
|
|
||||||
// create a DB with block prefix index
|
|
||||||
BlockBasedTableOptions table_options;
|
|
||||||
Options options = CurrentOptions();
|
|
||||||
table_options.block_size = 300;
|
|
||||||
table_options.index_type = BlockBasedTableOptions::kHashSearch;
|
|
||||||
table_options.index_shortening =
|
|
||||||
BlockBasedTableOptions::IndexShorteningMode::kNoShortening;
|
|
||||||
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
|
|
||||||
options.prefix_extractor.reset(NewFixedPrefixTransform(1));
|
|
||||||
options.level0_file_num_compaction_trigger = 8;
|
|
||||||
|
|
||||||
Reopen(options);
|
|
||||||
|
|
||||||
ASSERT_OK(Put("b1", "ok"));
|
|
||||||
Flush();
|
|
||||||
|
|
||||||
// Flushing several files so that the chance that hash bucket
|
|
||||||
// is empty fo "b" in at least one of the files is high.
|
|
||||||
ASSERT_OK(Put("a1", ""));
|
|
||||||
ASSERT_OK(Put("c1", ""));
|
|
||||||
Flush();
|
|
||||||
|
|
||||||
ASSERT_OK(Put("a2", ""));
|
|
||||||
ASSERT_OK(Put("c2", ""));
|
|
||||||
Flush();
|
|
||||||
|
|
||||||
ASSERT_OK(Put("a3", ""));
|
|
||||||
ASSERT_OK(Put("c3", ""));
|
|
||||||
Flush();
|
|
||||||
|
|
||||||
ASSERT_OK(Put("a4", ""));
|
|
||||||
ASSERT_OK(Put("c4", ""));
|
|
||||||
Flush();
|
|
||||||
|
|
||||||
ASSERT_OK(Put("a5", ""));
|
|
||||||
ASSERT_OK(Put("c5", ""));
|
|
||||||
Flush();
|
|
||||||
|
|
||||||
ASSERT_EQ("ok", Get("b1"));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#ifdef ROCKSDB_UNITTESTS_WITH_CUSTOM_OBJECTS_FROM_STATIC_LIBS
|
#ifdef ROCKSDB_UNITTESTS_WITH_CUSTOM_OBJECTS_FROM_STATIC_LIBS
|
||||||
|
@ -3467,7 +3467,7 @@ Status BlockBasedTable::Get(const ReadOptions& read_options, const Slice& key,
|
|||||||
PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_full_true_positive, 1,
|
PERF_COUNTER_BY_LEVEL_ADD(bloom_filter_full_true_positive, 1,
|
||||||
rep_->level);
|
rep_->level);
|
||||||
}
|
}
|
||||||
if (s.ok() && !iiter->status().IsNotFound()) {
|
if (s.ok()) {
|
||||||
s = iiter->status();
|
s = iiter->status();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user