Fix build failing becasue of ttl-keymayexist
Summary: PutValues calls Flush in ttl_test which clears memtables. KeyMayExist called after that will not be able to read those key-values Test Plan: make all check OPT=-g Reviewers:leveldb
This commit is contained in:
parent
c34271a5a5
commit
b1d09f1a51
@ -119,7 +119,7 @@ class TtlTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Puts num_entries starting from start_pos_map from kvmap_ into the database
|
// Puts num_entries starting from start_pos_map from kvmap_ into the database
|
||||||
void PutValues(int start_pos_map, int num_entries) {
|
void PutValues(int start_pos_map, int num_entries, bool flush = true) {
|
||||||
assert(db_ttl_);
|
assert(db_ttl_);
|
||||||
ASSERT_LE(start_pos_map + num_entries, (int)kvmap_.size());
|
ASSERT_LE(start_pos_map + num_entries, (int)kvmap_.size());
|
||||||
static WriteOptions wopts;
|
static WriteOptions wopts;
|
||||||
@ -131,8 +131,10 @@ class TtlTest {
|
|||||||
}
|
}
|
||||||
// Put a mock kv at the end because CompactionFilter doesn't delete last key
|
// Put a mock kv at the end because CompactionFilter doesn't delete last key
|
||||||
ASSERT_OK(db_ttl_->Put(wopts, "keymock", "valuemock"));
|
ASSERT_OK(db_ttl_->Put(wopts, "keymock", "valuemock"));
|
||||||
|
if (flush) {
|
||||||
db_ttl_->Flush(flush_opts);
|
db_ttl_->Flush(flush_opts);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Runs a manual compaction
|
// Runs a manual compaction
|
||||||
void ManualCompact() {
|
void ManualCompact() {
|
||||||
@ -487,7 +489,7 @@ TEST(TtlTest, KeyMayExist) {
|
|||||||
MakeKVMap(kSampleSize_);
|
MakeKVMap(kSampleSize_);
|
||||||
|
|
||||||
OpenTtl();
|
OpenTtl();
|
||||||
PutValues(0, kSampleSize_);
|
PutValues(0, kSampleSize_, false);
|
||||||
|
|
||||||
SimpleKeyMayExistCheck();
|
SimpleKeyMayExistCheck();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user