CASSANDRA-21390 trunk TrieMemtable MemtableReclaimMemory AssertionError: Negative released in MemtablePool$SubPool#4878
Open
smiklosovic wants to merge 2 commits into
Open
Conversation
…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.retainWithoutRecordingRemoval, 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 TBD for CASSANDRA-21390 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for sending a pull request! Here are some tips if you're new here:
Commit messages should follow the following format:
The Cassandra Jira