CASSANDRA-18282 [4.0] Exception logging for RTBoundValidator#4701
CASSANDRA-18282 [4.0] Exception logging for RTBoundValidator#4701worryg0d wants to merge 1 commit intoapache:cassandra-4.0from
Conversation
c7f5fa4 to
071ca55
Compare
This patch adds additional context to exception log messages for RTBoundValidator by adding partition key and isReverseOrder. Patch by Cameron Zemek, Bohdan Siryk; reviewed by TBD for CASSANDRA-18282 Co-authored-by: Bohdan Siryk <bohdan.siryk@netapp.com>
071ca55 to
47bcd40
Compare
There was a problem hiding this comment.
Pull request overview
Improves diagnostics for range tombstone (RT) bound validation failures by enriching the RTBoundValidator exception message with the current partition key and iterator ordering (isReverseOrder), helping operators pinpoint problematic partitions during reads/compactions.
Changes:
- Passes the current
partitionKey()intoRowsTransformationso it’s available when forming error messages. - Expands the
IllegalStateExceptionmessage to include partition key andisReverseOrdercontext.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| String.format("%s UnfilteredRowIterator for %s (partition key: %s) has an illegal RT bounds sequence (isReverseOrder=%b): %s", | ||
| stage, | ||
| metadata, | ||
| metadata.partitionKeyType.getString(this.partitionKey.getKey()), | ||
| isReverseOrder, |
There was a problem hiding this comment.
ise() builds the exception message by calling metadata.partitionKeyType.getString(partitionKey.getKey()). This conversion can throw (e.g., corrupt/invalid key bytes) and would prevent the intended IllegalStateException from being thrown with useful context, potentially masking the original RT-bounds problem. Consider wrapping the conversion in a try/catch and falling back to something safe (e.g., token, hex, or "") as done in UnfilteredValidation.handleInvalid(...).
Submitting the attached patch from CASSANDRA-18282