azotcsit commented on a change in pull request #1213:
URL: https://github.com/apache/cassandra/pull/1213#discussion_r731773764



##########
File path: src/java/org/apache/cassandra/service/StorageProxy.java
##########
@@ -1054,6 +1074,25 @@ public static void mutateWithTriggers(List<? extends 
IMutation> mutations,
                                           long queryStartNanoTime)
     throws WriteTimeoutException, WriteFailureException, UnavailableException, 
OverloadedException, InvalidRequestException
     {
+        if (DatabaseDescriptor.getEnablePartitionDenylist() && 
DatabaseDescriptor.getEnableDenylistWrites())
+        {
+            for (final IMutation mutation : mutations)
+            {
+                for (final TableId tid : mutation.getTableIds())
+                {
+                    if (!partitionDenylist.isKeyPermitted(tid, 
mutation.key().getKey()))
+                    {
+                        denylistMetrics.incrementWritesRejected();
+                        // While Schema.instance.getTableMetadata() can return 
a null value, in this case the isKeyPermitted
+                        // call above ensures that we cannot have a null 
associated tid at this point.
+                        final TableMetadata tmd = 
Schema.instance.getTableMetadata(tid);

Review comment:
       This variable is not used anymore.
   
   I guess you might want introduce it in order to print proper ks/table name 
in the error message on the next line, but forgot to do it. At the moment. that 
message looks incorrect though ("unknown Table") because the table is known in 
fact. For an unknown table we would not be here.




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