@ -30,7 +30,6 @@ CompactionIterator::CompactionIterator(
BlobFileBuilder * blob_file_builder , bool allow_data_in_errors ,
const Compaction * compaction , const CompactionFilter * compaction_filter ,
const std : : atomic < bool > * shutting_down ,
const SequenceNumber preserve_deletes_seqnum ,
const std : : atomic < int > * manual_compaction_paused ,
const std : : atomic < bool > * manual_compaction_canceled ,
const std : : shared_ptr < Logger > info_log ,
@ -42,9 +41,8 @@ CompactionIterator::CompactionIterator(
blob_file_builder , allow_data_in_errors ,
std : : unique_ptr < CompactionProxy > (
compaction ? new RealCompaction ( compaction ) : nullptr ) ,
compaction_filter , shutting_down , preserve_deletes_seqnum ,
manual_compaction_paused , manual_compaction_canceled , info_log ,
full_history_ts_low ) { }
compaction_filter , shutting_down , manual_compaction_paused ,
manual_compaction_canceled , info_log , full_history_ts_low ) { }
CompactionIterator : : CompactionIterator (
InternalIterator * input , const Comparator * cmp , MergeHelper * merge_helper ,
@ -57,7 +55,6 @@ CompactionIterator::CompactionIterator(
std : : unique_ptr < CompactionProxy > compaction ,
const CompactionFilter * compaction_filter ,
const std : : atomic < bool > * shutting_down ,
const SequenceNumber preserve_deletes_seqnum ,
const std : : atomic < int > * manual_compaction_paused ,
const std : : atomic < bool > * manual_compaction_canceled ,
const std : : shared_ptr < Logger > info_log ,
@ -80,7 +77,6 @@ CompactionIterator::CompactionIterator(
shutting_down_ ( shutting_down ) ,
manual_compaction_paused_ ( manual_compaction_paused ) ,
manual_compaction_canceled_ ( manual_compaction_canceled ) ,
preserve_deletes_seqnum_ ( preserve_deletes_seqnum ) ,
info_log_ ( info_log ) ,
allow_data_in_errors_ ( allow_data_in_errors ) ,
timestamp_size_ ( cmp_ ? cmp_ - > timestamp_size ( ) : 0 ) ,
@ -758,7 +754,6 @@ void CompactionIterator::NextFromInput() {
( ikey_ . type = = kTypeDeletionWithTimestamp & &
cmp_with_history_ts_low_ < 0 ) ) & &
DefinitelyInSnapshot ( ikey_ . sequence , earliest_snapshot_ ) & &
ikeyNotNeededForIncrementalSnapshot ( ) & &
compaction_ - > KeyNotExistsBeyondOutputLevel ( ikey_ . user_key ,
& level_ptrs_ ) ) {
// TODO(noetzli): This is the only place where we use compaction_
@ -792,7 +787,7 @@ void CompactionIterator::NextFromInput() {
} else if ( ( ikey_ . type = = kTypeDeletion | |
( ikey_ . type = = kTypeDeletionWithTimestamp & &
cmp_with_history_ts_low_ < 0 ) ) & &
bottommost_level_ & & ikeyNotNeededForIncrementalSnapshot ( ) ) {
bottommost_level_ ) {
// Handle the case where we have a delete key at the bottom most level
// We can skip outputting the key iff there are no subsequent puts for this
// key
@ -1060,8 +1055,7 @@ void CompactionIterator::PrepareOutput() {
// Can we do the same for levels above bottom level as long as
// KeyNotExistsBeyondOutputLevel() return true?
if ( valid_ & & compaction_ ! = nullptr & &
! compaction_ - > allow_ingest_behind ( ) & &
ikeyNotNeededForIncrementalSnapshot ( ) & & bottommost_level_ & &
! compaction_ - > allow_ingest_behind ( ) & & bottommost_level_ & &
DefinitelyInSnapshot ( ikey_ . sequence , earliest_snapshot_ ) & &
ikey_ . type ! = kTypeMerge ) {
assert ( ikey_ . type ! = kTypeDeletion ) ;
@ -1139,13 +1133,6 @@ inline SequenceNumber CompactionIterator::findEarliestVisibleSnapshot(
return kMaxSequenceNumber ;
}
// used in 2 places - prevents deletion markers to be dropped if they may be
// needed and disables seqnum zero-out in PrepareOutput for recent keys.
inline bool CompactionIterator : : ikeyNotNeededForIncrementalSnapshot ( ) {
return ( ! compaction_ - > preserve_deletes ( ) ) | |
( ikey_ . sequence < preserve_deletes_seqnum_ ) ;
}
uint64_t CompactionIterator : : ComputeBlobGarbageCollectionCutoffFileNumber (
const CompactionProxy * compaction ) {
if ( ! compaction ) {