Skip to content

CASSANDRA-18282 [4.0] Exception logging for RTBoundValidator#4701

Open
worryg0d wants to merge 1 commit intoapache:cassandra-4.0from
worryg0d:cassandra-18282
Open

CASSANDRA-18282 [4.0] Exception logging for RTBoundValidator#4701
worryg0d wants to merge 1 commit intoapache:cassandra-4.0from
worryg0d:cassandra-18282

Conversation

@worryg0d
Copy link
Copy Markdown

@worryg0d worryg0d commented Apr 2, 2026

Submitting the attached patch from CASSANDRA-18282

Exception logging for RTBoundValidator

This patch adds additional context to exception log messages for RTBoundValidator by adding partition key and isReverseOrder.

Patch by Cameron Zemek; reviewed by TBD for CASSANDRA-18282

@worryg0d worryg0d force-pushed the cassandra-18282 branch 3 times, most recently from c7f5fa4 to 071ca55 Compare April 2, 2026 15:53
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() into RowsTransformation so it’s available when forming error messages.
  • Expands the IllegalStateException message to include partition key and isReverseOrder context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +122 to +126
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,
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(...).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants