ashishkumar50 commented on code in PR #10126:
URL: https://github.com/apache/ozone/pull/10126#discussion_r3148525046


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerData.java:
##########
@@ -707,10 +707,10 @@ public synchronized void incrementBlockBytes(long delta) {
 
     public synchronized void decDeletion(long deletedBytes, long 
processedBytes, long deletedBlockCount,
         long processedBlockCount) {
-      blockBytes -= deletedBytes;
-      blockCount -= deletedBlockCount;
-      blockPendingDeletion -= processedBlockCount;
-      blockPendingDeletionBytes -= processedBytes;
+      blockBytes = Math.max(1L, blockBytes - deletedBytes);

Review Comment:
   If `blockBytes - deletedBytes == 0`, we should not make `blockBytes = 1L`. 
If we do this then never blockBytes will become 0. Only when if there is 
negative value after calculation we can keep something like 1L.



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