sstables: add intrusive index hook to large_data_record

Add a set_member_hook<auto_unlink> to large_data_record so it can
participate directly in a boost::intrusive::multiset without wrapper
nodes or side maps.  The hook is not listed in describe_type() and
is therefore not serialized.

Also add a non-const get_large_data_records() overload to sstable
so that register_sstable can obtain mutable references to records
for hook manipulation.
This commit is contained in:
Taras Veretilnyk
2026-05-13 13:47:55 +02:00
parent ed8817724a
commit e0fee41d25
2 changed files with 10 additions and 0 deletions

View File

@@ -1101,6 +1101,10 @@ public:
return _large_data_records;
}
std::optional<scylla_metadata::large_data_records>& get_large_data_records() noexcept {
return _large_data_records;
}
// Return the extended timestamp statistics map.
// Some or all entries may be missing if not present in scylla_metadata
scylla_metadata::ext_timestamp_stats::map_type get_ext_timestamp_stats() const noexcept;

View File

@@ -17,6 +17,7 @@
#include "mutation/tombstone.hh"
#include "utils/streaming_histogram.hh"
#include "utils/estimated_histogram.hh"
#include <boost/intrusive/set.hpp>
#include "sstables/key.hh"
#include "sstables/file_writer.hh"
#include "db/commitlog/replay_position.hh"
@@ -614,6 +615,11 @@ struct large_data_record {
uint64_t range_tombstones; // number of range tombstones in the partition
uint64_t dead_rows; // number of dead rows in the partition
// Runtime hook for large_data_record_index. Not serialized.
using index_hook_type = boost::intrusive::set_member_hook<
boost::intrusive::link_mode<boost::intrusive::auto_unlink>>;
index_hook_type _index_hook;
template <typename Describer>
auto describe_type(sstable_version_types v, Describer f) {
return f(type, partition_key, clustering_key, column_name, value,