Files
scylladb/utils
Pavel Emelyanov b56d6fbb84 Merge 'sstables: Fix quadratic space complexity in partitioned_sstable_set' from Raphael Raph Carvalho
Interval map is very susceptible to quadratic space behavior when it's flooded with many entries overlapping all (or most of) intervals, since each such entry will have presence on all intervals it overlaps with.

A trigger we observed was memtable flush storm, which creates many small "L0" sstables that spans roughly the entire token range.

Since we cannot rely on insertion order, solution will be about storing sstables with such wide ranges in a vector (unleveled).

There should be no consequence for single-key reads, since upper layer applies an additional filtering based on token of key being queried.
And for range scans, there can be an increase in memory usage, but not significant because the sstables span an wide range and would have been selected in the combined reader if the range of scan overlaps with them.

Anyway, this is a protection against storm of memtable flushes and shouldn't be the common scenario.

It works both with tablets and vnodes, by adjusting the token range spanned by compaction group accordingly.

Fixes #23634.

We can backport this into 2024.2, 2025.1, but we should let this cook in master for 1 month or so.

Closes scylladb/scylladb#23806

* github.com:scylladb/scylladb:
  test: Verify partitioned set store split and unsplit correctly
  sstables: Fix quadratic space complexity in partitioned_sstable_set
  compaction: Wire table_state into make_sstable_set()
  compaction: Introduce token_range() to table_state
  dht: Add overlap_ratio() for token range
2025-05-05 11:28:38 +03:00
..
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2024-12-23 23:37:02 +01:00
2024-12-23 23:37:02 +01:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-04-01 00:07:28 +02:00
2025-04-01 00:07:28 +02:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-04-01 00:07:28 +02:00
2025-01-26 15:54:06 +02:00
2025-01-14 07:56:39 -05:00
2025-01-14 07:56:39 -05:00
2025-02-25 10:32:32 +03:00
2025-01-14 07:56:39 -05:00