cassandra/test
Stefan Miklosovic d30ac083b8
Fix negative memtable allocator ownership when an update is shadowed by an existing row deletion
When BTreeRow.merge reconciles an update into a row whose existing deletion
shadows the update's cells, it filtered the update (incoming) side of the merge
with Reconciler.retain, which records the removal via
PostReconciliationFunction.delete. On the memtable write path that subtracts the
shadowed cells' on-heap size from the allocator's ownership even though that
incoming data was never allocated to the memtable. Under overwrite/delete churn
that re-applies cells already covered by a newer row/partition deletion (e.g.
repair re-streaming), the allocator's "owns" counter drifts negative and the next
flush trips "AssertionError: Negative released" in MemtablePool$SubPool.released
via MemtableAllocator$SubAllocator.releaseAll during discard.

Filter the update (incoming) side with a non-recording variant,
Reconciler.removeShadowed, and keep retain() for the existing side,
whose data the memtable already owns. The filtered result is identical; only the
erroneous accounting notification is dropped. This mirrors the already-correct
complex-column path in ColumnData.merge.

patch by Stefan Miklosovic; reviewed by Dmitry Konstantinov for CASSANDRA-21469

Assisted-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 10:46:04 +02:00
..
anttasks/org/apache/cassandra/anttasks JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
bin JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
burn/org/apache/cassandra Fix BTree.FastBuilder.reset() and test 2024-09-16 12:24:32 -05:00
conf Use default commitlog settings in test YAMLs 2024-08-15 10:12:39 -05:00
data Fix IndexOutOfBoundsException in sstablemetadata tool when a range tombstone is a max clustering value 2025-08-27 18:54:10 +02:00
distributed/org/apache/cassandra BTree.FastBuilder.reset() fails to clear savedBuffer and savedNextKey, causing ClassCastException and SSTable header corruption during schema disagreement 2026-06-02 10:14:26 +01:00
long/org/apache/cassandra Merge branch 'cassandra-3.11' into cassandra-4.0 2023-01-28 16:54:39 +01:00
memory/org/apache/cassandra/db/compaction Remove OrderedJUnit4ClassRunner 2021-09-20 13:37:32 +02:00
microbench/org/apache/cassandra/test/microbench JMH improvements - faster build and async profiler 2023-09-25 12:39:36 +02:00
resources Remove byteman-related files from production sources 2023-10-10 09:51:11 +02:00
unit/org Fix negative memtable allocator ownership when an update is shadowed by an existing row deletion 2026-06-19 10:46:04 +02:00