You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "cheeeee (via GitHub)" <gi...@apache.org> on 2026/09/09 03:08:17 UTC
[PR] CASSANDRA-21333: Write zero delta when localDeletionTime overflows an int [cassandra]
cheeeee opened a new pull request, #5136:
URL: https://github.com/apache/cassandra/pull/5136
### Jira Issue
* [CASSANDRA-21333](https://issues.apache.org/jira/browse/CASSANDRA-21333)
### Motivation
When a row has multiple complex columns but only a subset are updated, 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 caused:
1. `SerializationHeader` serializing an overflowed -1 delta (0xFFFFFFFF), corrupting the written `localDeletionTime`.
2. When reading such SSTables back during compaction, if `corrupted_tombstone_strategy` is set to `exception`, compaction throws and fails permanently.
### Changes
1. **`writeDeletionTime`:** When `dt.isLive()`, write a zero delta (`writeLocalDeletionTime(stats.minLocalDeletionTime, out)`); the read side unambiguously recognizes LIVE by `markedForDeleteAt == Long.MIN_VALUE`.
2. **`readDeletionTime` (both allocating and reusable):** When `markedAt == Long.MIN_VALUE`, directly return `DeletionTime.LIVE` or call `reuse.resetLive()`. This safely handles both newly written SSTables and legacy broken SSTables.
3. **`deletionTimeSerializedSize`:** Compute size based on zero delta for LIVE deletions.
### Testing
* `SerializationHeaderTest`: added `testLiveDeletionTimeRoundTrip` and `testLiveDeletionTimeReadBackwardCompatibility` verifying round-trip encoding and backward compatibility with old overflowed SSTables. All 9 tests pass cleanly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21333: Write zero delta when localDeletionTime overflows an int [cassandra]
Posted by "cheeeee (via GitHub)" <gi...@apache.org>.
cheeeee closed pull request #5136: CASSANDRA-21333: Write zero delta when localDeletionTime overflows an int
URL: https://github.com/apache/cassandra/pull/5136
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-21333: Write zero delta when localDeletionTime overflows an int [cassandra]
Posted by "cheeeee (via GitHub)" <gi...@apache.org>.
cheeeee commented on PR #5136:
URL: https://github.com/apache/cassandra/pull/5136#issuecomment-5595259298
Closing PR per contributor request; keeping patch in private branch for further evaluation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org