diff --git a/db/range_del_aggregator.cc b/db/range_del_aggregator.cc index 2e22dd86158..18eeff152cd 100644 --- a/db/range_del_aggregator.cc +++ b/db/range_del_aggregator.cc @@ -195,6 +195,10 @@ Status RangeDelAggregator::AddTombstones( input->SeekToFirst(); bool first_iter = true; while (input->Valid()) { + // The tombstone map holds slices into the iterator's memory. This assert + // ensures pinning the iterator also pins the keys/values. + assert(input->IsKeyPinned() && input->IsValuePinned()); + if (first_iter) { if (rep_ == nullptr) { InitRep({upper_bound_}); diff --git a/table/block_based_table_builder.cc b/table/block_based_table_builder.cc index 607d2a5340f..85c41fe5105 100644 --- a/table/block_based_table_builder.cc +++ b/table/block_based_table_builder.cc @@ -300,7 +300,7 @@ struct BlockBasedTableBuilder::Rep { : 0), data_block(table_options.block_restart_interval, table_options.use_delta_encoding), - range_del_block(1), // TODO(andrewkr): restart_interval unnecessary + range_del_block(1 /* block_restart_interval */), internal_prefix_transform(_ioptions.prefix_extractor), compression_type(_compression_type), compression_opts(_compression_opts), diff --git a/util/testutil.h b/util/testutil.h index 62a4de1ab75..d6b0a7095e3 100644 --- a/util/testutil.h +++ b/util/testutil.h @@ -179,6 +179,9 @@ class VectorIterator : public InternalIterator { virtual Status status() const override { return Status::OK(); } + virtual bool IsKeyPinned() const override { return true; } + virtual bool IsValuePinned() const override { return true; } + private: std::vector keys_; std::vector values_;