Copilot commented on code in PR #4701:
URL: https://github.com/apache/cassandra/pull/4701#discussion_r3033296818


##########
src/java/org/apache/cassandra/db/transform/RTBoundValidator.java:
##########
@@ -116,7 +119,12 @@ public void onPartitionClose()
         private IllegalStateException ise(String why)
         {
             String message =
-                String.format("%s UnfilteredRowIterator for %s has an illegal 
RT bounds sequence: %s", stage, metadata, why);
+                    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,

Review 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 
"<unprintable>") as done in `UnfilteredValidation.handleInvalid(...)`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to