CASSANDRA-21333 Decode historical live complex deletions without erasing tombstones - #5144
Open
cheeeee wants to merge 1 commit into
Open
CASSANDRA-21333 Decode historical live complex deletions without erasing tombstones#5144cheeeee wants to merge 1 commit into
cheeeee wants to merge 1 commit into
Conversation
Preserve historical writer bytes and recognize LIVE using both its minimum timestamp and reserved local-deletion-time representation. Keep valid minimum-timestamp tombstones distinct and match size calculation to the writer's integer delta encoding. CASSANDRA-21333 Generated-by: Claude (Anthropic)
cheeeee
force-pushed
the
CASSANDRA-21333-v2-trunk
branch
from
September 11, 2026 22:51
0259300 to
624839b
Compare
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.
CASSANDRA-21333: a row with several complex columns of which only some are updated stores
DeletionTime.LIVE as the complex deletion of the untouched ones. LIVE's local deletion time is the
reserved unsigned value 0xFFFFFFFF; writing it as a delta from the header's minLocalDeletionTime
truncates to int, and reading the delta back sign-extends, so the decoded value is no longer LIVE but
a deletion at Long.MIN_VALUE with an invalid local deletion time. With corrupted_tombstone_strategy
set to exception such an SSTable fails to read.
Change (SerializationHeader): after reading a deletion time, if the timestamp is Long.MIN_VALUE and the
low 32 bits of the local deletion time are the reserved LIVE value, return DeletionTime.LIVE (both the
allocating and the reusable read paths). The timestamp alone is not used as the discriminator because
Long.MIN_VALUE is an acceptable timestamp for a real tombstone, and such tombstones must survive a
round trip. The on-disk encoding is unchanged, so SSTables written by existing versions decode to LIVE
without a format bump, and no new bytes need to be understood by older readers.
localDeletionTimeSerializedSize now casts to int the same way writeLocalDeletionTime does, so the
computed size matches the bytes written.
Testing (SerializationHeaderTest):
writer decodes to DeletionTime.LIVE.
tombstone again round-trip unchanged, and the serialized size equals the bytes written.
read back from a real SSTable, through the cursor read path, yields LIVE for the untouched column.
deletedAt=Long.MIN_VALUE, localDeletion=4294967294.
CASSANDRA-21333