diff --git a/db/compaction_iterator.cc b/db/compaction_iterator.cc index 675e88d634ecf21588122ad5a0c552d0cce5cc02..8721634f865490dd054d7122d19b4a5aae7f4de8 100644 --- a/db/compaction_iterator.cc +++ b/db/compaction_iterator.cc @@ -634,8 +634,7 @@ void CompactionIterator::PrepareOutput() { // KeyNotExistsBeyondOutputLevel() return true? if ((compaction_ != nullptr && !compaction_->allow_ingest_behind()) && ikeyNotNeededForIncrementalSnapshot() && bottommost_level_ && valid_ && - IN_EARLIEST_SNAPSHOT(ikey_.sequence) && ikey_.type != kTypeMerge && - !cmp_->Equal(compaction_->GetLargestUserKey(), ikey_.user_key)) { + IN_EARLIEST_SNAPSHOT(ikey_.sequence) && ikey_.type != kTypeMerge) { assert(ikey_.type != kTypeDeletion && ikey_.type != kTypeSingleDeletion); ikey_.sequence = 0; current_key_.UpdateInternalKey(0, ikey_.type); diff --git a/db/compaction_job_test.cc b/db/compaction_job_test.cc index 16114ccaa5e7b9c460ef63192bacdd6169c862fa..d41b4d1ac6e6a50cf140580ff4e847a4128b2acc 100644 --- a/db/compaction_job_test.cc +++ b/db/compaction_job_test.cc @@ -172,7 +172,7 @@ class CompactionJobTest : public testing::Test { // This is how the key will look like once it's written in bottommost // file InternalKey bottommost_internal_key( - key, (key == "9999") ? sequence_number : 0, kTypeValue); + key, 0, kTypeValue); if (corrupt_id(k)) { test::CorruptKeyType(&internal_key); @@ -379,7 +379,7 @@ TEST_F(CompactionJobTest, SimpleOverwrite) { auto expected_results = mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "val2"}, - {KeyStr("b", 4U, kTypeValue), "val3"}}); + {KeyStr("b", 0U, kTypeValue), "val3"}}); SetLastSequence(4U); auto files = cfd_->current()->storage_info()->LevelFiles(0); @@ -432,7 +432,7 @@ TEST_F(CompactionJobTest, SimpleMerge) { auto expected_results = mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "3,4,5"}, - {KeyStr("b", 2U, kTypeValue), "1,2"}}); + {KeyStr("b", 0U, kTypeValue), "1,2"}}); SetLastSequence(5U); auto files = cfd_->current()->storage_info()->LevelFiles(0); @@ -456,7 +456,7 @@ TEST_F(CompactionJobTest, NonAssocMerge) { auto expected_results = mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), "3,4,5"}, - {KeyStr("b", 2U, kTypeValue), "1,2"}}); + {KeyStr("b", 0U, kTypeValue), "1,2"}}); SetLastSequence(5U); auto files = cfd_->current()->storage_info()->LevelFiles(0); @@ -483,7 +483,7 @@ TEST_F(CompactionJobTest, MergeOperandFilter) { auto expected_results = mock::MakeMockFile({{KeyStr("a", 0U, kTypeValue), test::EncodeInt(8U)}, - {KeyStr("b", 2U, kTypeValue), test::EncodeInt(2U)}}); + {KeyStr("b", 0U, kTypeValue), test::EncodeInt(2U)}}); SetLastSequence(5U); auto files = cfd_->current()->storage_info()->LevelFiles(0); @@ -746,7 +746,7 @@ TEST_F(CompactionJobTest, SingleDeleteZeroSeq) { AddMockFile(file2); auto expected_results = mock::MakeMockFile({ - {KeyStr("dummy", 5U, kTypeValue), "val2"}, + {KeyStr("dummy", 0U, kTypeValue), "val2"}, }); SetLastSequence(22U); @@ -930,7 +930,7 @@ TEST_F(CompactionJobTest, CorruptionAfterDeletion) { mock::MakeMockFile({{test::KeyStr("A", 0U, kTypeValue), "val3"}, {test::KeyStr("a", 0U, kTypeValue, true), "val"}, {test::KeyStr("b", 0U, kTypeValue, true), "val"}, - {test::KeyStr("c", 1U, kTypeValue), "val2"}}); + {test::KeyStr("c", 0U, kTypeValue), "val2"}}); SetLastSequence(6U); auto files = cfd_->current()->storage_info()->LevelFiles(0); diff --git a/db/db_compaction_filter_test.cc b/db/db_compaction_filter_test.cc index 25045d01de9509cde4833b629bb18f855a05eebd..a19fde0b7fff50c30c0a6978731dd705e2028c1a 100644 --- a/db/db_compaction_filter_test.cc +++ b/db/db_compaction_filter_test.cc @@ -357,7 +357,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilter) { } } ASSERT_EQ(total, 100000); - ASSERT_EQ(count, 1); + ASSERT_EQ(count, 0); // overwrite all the 100K keys once again. for (int i = 0; i < 100000; i++) { @@ -664,7 +664,7 @@ TEST_F(DBTestCompactionFilter, CompactionFilterContextManual) { iter->Next(); } ASSERT_EQ(total, 700); - ASSERT_EQ(count, 1); + ASSERT_EQ(count, 0); } } #endif // ROCKSDB_LITE