CASSANDRA-21333: Write zero delta when localDeletionTime overflows an int - #5144
Open
cheeeee wants to merge 1 commit into
Open
CASSANDRA-21333: Write zero delta when localDeletionTime overflows an int#5144cheeeee wants to merge 1 commit into
cheeeee wants to merge 1 commit into
Conversation
…1333) When a row has multiple complex columns but only a subset are updated, the untouched columns carry DeletionTime.LIVE as their complex deletion. DeletionTime.LIVE has localDeletionTime=Long.MAX_VALUE, which causes SerializationHeader.writeDeletionTime to overflow the 32-bit delta encoding (Long.MAX_VALUE - minLocalDeletionTime doesn't fit in an int). This produced corrupted localDeletionTimes in sstables that trigger exceptions during compaction when corrupted_tombstone_strategy is set to exception. This patch: 1. SerializationHeader: when dt.isLive(), write a zero delta (writeLocalDeletionTime(stats.minLocalDeletionTime)) and compute serialized size accordingly. 2. Read-side compatibility: in readDeletionTime (both allocating and reusable variants), recognize LIVE by markedAt == Long.MIN_VALUE and return DeletionTime.LIVE / reuse.resetLive(), cleanly handling both fixed sstables and legacy broken sstables. 3. Unit tests in SerializationHeaderTest verifying round-trip and backward compatibility. Fixes: CASSANDRA-21333
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.
Status: changes requested — not ready to merge
The published zero-delta encoding and timestamp-only LIVE detection can conflate valid minimum-timestamp tombstones with LIVE. A format-preserving correction is in preparation.
Verification correction
Earlier descriptions overstated correctness and/or test coverage. Those claims are withdrawn. AI-assisted source review has been performed; this is not maintainer approval. Previously mixed build artifacts are not accepted as verification evidence. Corrective changes and clean, targeted verification are in progress; the published head has not yet been replaced.
Published head under review:
02593004aa9d497243304ca30d9b7eec540daa64.