From e0fee41d251dd79bd56bd5ec29457208192fdc2e Mon Sep 17 00:00:00 2001 From: Taras Veretilnyk Date: Wed, 13 May 2026 13:47:55 +0200 Subject: [PATCH] sstables: add intrusive index hook to large_data_record Add a set_member_hook 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. --- sstables/sstables.hh | 4 ++++ sstables/types.hh | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/sstables/sstables.hh b/sstables/sstables.hh index 55de37a404..0abd32b573 100644 --- a/sstables/sstables.hh +++ b/sstables/sstables.hh @@ -1101,6 +1101,10 @@ public: return _large_data_records; } + std::optional& 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; diff --git a/sstables/types.hh b/sstables/types.hh index fad5d32779..9f72be9162 100644 --- a/sstables/types.hh +++ b/sstables/types.hh @@ -17,6 +17,7 @@ #include "mutation/tombstone.hh" #include "utils/streaming_histogram.hh" #include "utils/estimated_histogram.hh" +#include #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>; + index_hook_type _index_hook; + template auto describe_type(sstable_version_types v, Describer f) { return f(type, partition_key, clustering_key, column_name, value,