diff --git a/db/db_impl.cc b/db/db_impl.cc index f96d245..3e62b4c 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -1012,6 +1012,7 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) { if (!status.ok()) { break; } + compact->compaction->RestartOverlappedBytes(); } } diff --git a/db/version_set.h b/db/version_set.h index ea0c925..066b457 100644 --- a/db/version_set.h +++ b/db/version_set.h @@ -353,6 +353,10 @@ class Compaction { // before processing "internal_key". bool ShouldStopBefore(const Slice& internal_key); + // Reset overlapped bytes with grandparents. Should be called if we start + // building a new output for other reasons(eg. file size limitation). + void RestartOverlappedBytes() { overlapped_bytes_ = 0; } + // Release the input version for the compaction, once the compaction // is successful. void ReleaseInputs();