@ -7,6 +7,7 @@
# include <string>
# include <string>
# include "db/blob/blob_fetcher.h"
# include "db/dbformat.h"
# include "db/dbformat.h"
# include "monitoring/perf_context_imp.h"
# include "monitoring/perf_context_imp.h"
# include "monitoring/statistics.h"
# include "monitoring/statistics.h"
@ -119,7 +120,8 @@ Status MergeHelper::MergeUntil(InternalIterator* iter,
CompactionRangeDelAggregator * range_del_agg ,
CompactionRangeDelAggregator * range_del_agg ,
const SequenceNumber stop_before ,
const SequenceNumber stop_before ,
const bool at_bottom ,
const bool at_bottom ,
const bool allow_data_in_errors ) {
const bool allow_data_in_errors ,
Version * version ) {
// Get a copy of the internal key, before it's invalidated by iter->Next()
// Get a copy of the internal key, before it's invalidated by iter->Next()
// Also maintain the list of merge operands seen.
// Also maintain the list of merge operands seen.
assert ( HasOperator ( ) ) ;
assert ( HasOperator ( ) ) ;
@ -203,12 +205,23 @@ Status MergeHelper::MergeUntil(InternalIterator* iter,
// want. Also if we're in compaction and it's a put, it would be nice to
// want. Also if we're in compaction and it's a put, it would be nice to
// run compaction filter on it.
// run compaction filter on it.
const Slice val = iter - > value ( ) ;
const Slice val = iter - > value ( ) ;
PinnableSlice blob_value ;
const Slice * val_ptr ;
const Slice * val_ptr ;
if ( kTypeValue = = ikey . type & &
if ( ( kTypeValue = = ikey . type | | kTypeBlobIndex = = ikey . type ) & &
( range_del_agg = = nullptr | |
( range_del_agg = = nullptr | |
! range_del_agg - > ShouldDelete (
! range_del_agg - > ShouldDelete (
ikey , RangeDelPositioningMode : : kForwardTraversal ) ) ) {
ikey , RangeDelPositioningMode : : kForwardTraversal ) ) ) {
if ( ikey . type = = kTypeBlobIndex ) {
assert ( version ) ;
BlobFetcher blob_fetcher ( version , ReadOptions ( ) ) ;
s = blob_fetcher . FetchBlob ( ikey . user_key , val , & blob_value ) ;
if ( ! s . ok ( ) ) {
return s ;
}
val_ptr = & blob_value ;
} else {
val_ptr = & val ;
val_ptr = & val ;
}
} else {
} else {
val_ptr = nullptr ;
val_ptr = nullptr ;
}
}