josh-mckenzie commented on a change in pull request #1213:
URL: https://github.com/apache/cassandra/pull/1213#discussion_r715791136



##########
File path: src/java/org/apache/cassandra/service/StorageProxy.java
##########
@@ -293,6 +305,15 @@ public static RowIterator cas(String keyspaceName,
         {
             TableMetadata metadata = 
Schema.instance.validateTable(keyspaceName, cfName);
 
+            if (DatabaseDescriptor.enablePartitionDenylist() && 
DatabaseDescriptor.enableDenylistWrites() && 
!partitionDenylist.validateKey(keyspaceName, cfName, key.getKey()))
+            {
+                denylistMetrics.incrementWritesRejected();
+                final byte[] keyBytes  = new byte[key.getKey().remaining()];
+                key.getKey().slice().get(keyBytes);
+                throw new InvalidRequestException(String.format("Unable to CAS 
write to denylisted partition [0x%s] in %s/%s",
+                                                                
Hex.bytesToHex(keyBytes), keyspaceName, cfName));

Review comment:
       It's the same path ultimately (Hex.bytesToHex), but there's 0 value in 
duplicating that here instead of just leaning on the .toString() call. Fixing.




-- 
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