mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 04:26:48 +00:00
The change - adds a test which exposes a problem of a peculiar setup of tombstones that trigger a mutation fragment stream validation exception - fixes the problem Applying tombstones in the order: range_tombstone_change pos(ck1), after_all_prefixed, tombstone_timestamp=1 range_tombstone_change pos(ck2), before_all_prefixed, tombstone=NONE range_tombstone_change pos(NONE), after_all_prefixed, tombstone=NONE Leads to swapping the order of mutations when written and read from disk via sstable writer. This is caused by conversion of range_tombstone_change (in memory representation) to range tombstone marker (on disk representation) and back. When this mutation stream is written to disk, the range tombstone markers type is calculated based on the relationship between range_tombstone_changes. The RTC series as above produces markers (start, end, start). When the last marker is loaded from disk, it's kind gets incorrectly loaded as before_all_prefixed instead of after_all_prefixed. This leads to incorrect order of mutations. The solution is to skip writing a new range_tombstone_change with empty tombstone if the last range_tombstone_change already has empty tombstone. This is redundant information and can be safely removed, while the logic of encoding RTCs as markers doesn't handle such redundancy well. Closes #10643