From 56bea9f80d8feb5328e928609859f5bd88888980 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Mon, 27 Jan 2014 11:53:59 -0800 Subject: [PATCH] When using Universal Compaction, Zero out seqID in the last file too Summary: I didn't figure out the reason why the feature of zeroing out earlier sequence ID is disabled in universal compaction. I do see bottommost_level is set correctly. It should simply work if we remove the constraint of universal compaction. Test Plan: make all check Reviewers: haobo, dhruba, kailiu, igor Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D15423 --- db/db_impl.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index e3b95ad5f..8b08940a1 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -2507,8 +2507,7 @@ Status DBImpl::DoCompactionWork(CompactionState* compact, // If this is the bottommost level (no files in lower levels) // and the earliest snapshot is larger than this seqno // then we can squash the seqno to zero. - if (options_.compaction_style == kCompactionStyleLevel && - bottommost_level && ikey.sequence < earliest_snapshot && + if (bottommost_level && ikey.sequence < earliest_snapshot && ikey.type != kTypeMerge) { assert(ikey.type != kTypeDeletion); // make a copy because updating in place would cause problems