From b1d09f1a5146cc922a1c87747de90578762cb600 Mon Sep 17 00:00:00 2001 From: Mayank Agarwal Date: Sun, 1 Sep 2013 21:04:20 -0700 Subject: [PATCH] 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 --- utilities/ttl/ttl_test.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utilities/ttl/ttl_test.cc b/utilities/ttl/ttl_test.cc index c97e46775..9c798dd39 100644 --- a/utilities/ttl/ttl_test.cc +++ b/utilities/ttl/ttl_test.cc @@ -119,7 +119,7 @@ class TtlTest { } // 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_LE(start_pos_map + num_entries, (int)kvmap_.size()); static WriteOptions wopts; @@ -131,7 +131,9 @@ class TtlTest { } // Put a mock kv at the end because CompactionFilter doesn't delete last key ASSERT_OK(db_ttl_->Put(wopts, "keymock", "valuemock")); - db_ttl_->Flush(flush_opts); + if (flush) { + db_ttl_->Flush(flush_opts); + } } // Runs a manual compaction @@ -487,7 +489,7 @@ TEST(TtlTest, KeyMayExist) { MakeKVMap(kSampleSize_); OpenTtl(); - PutValues(0, kSampleSize_); + PutValues(0, kSampleSize_, false); SimpleKeyMayExistCheck();