iamaleksey commented on code in PR #3180:
URL: https://github.com/apache/cassandra/pull/3180#discussion_r1530617276


##########
src/java/org/apache/cassandra/hints/HintsStore.java:
##########
@@ -203,14 +213,21 @@ private void deleteHints(Predicate<HintsDescriptor> 
predicate)
         {
             dispatchDequeue.removeAll(removeSet);
             corruptedFiles.removeAll(removeSet);
+            // if delete(descriptor) throws, hence
+            for (HintsDescriptor descriptor : removeSet)
+                hintsSizes.remove(descriptor.fileName());
         }
     }
 
     void delete(HintsDescriptor descriptor)
     {
         File hintsFile = descriptor.file(hintsDirectory);
         if (hintsFile.tryDelete())
+        {
+            // this method is also called standalone (without deleteHints)

Review Comment:
   You are calling this twice on the normal path. Just leave the one call in 
this method, in `finally` if need be.



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