ChenSammi commented on code in PR #9036:
URL: https://github.com/apache/ozone/pull/9036#discussion_r2431051400


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/DeleteBlocksCommandHandler.java:
##########
@@ -645,12 +645,16 @@ private void updateMetaData(KeyValueContainerData 
containerData,
 
       // update pending deletion blocks count and delete transaction ID in
       // in-memory container status
-      long pendingBytes = containerData.getBlockPendingDeletionBytes() + 
delTX.getTotalBlockSize();
+      long pendingBytes = containerData.getBlockPendingDeletionBytes();
+      if (delTX.hasTotalBlockSize()) {

Review Comment:
   It's better to include all pendingBytes operations under the if scope, like 
this
   
   // update in-memory pending deletion blocks size container status and 
persistent
   If 
(VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.DATA_DISTRIBUTION)) && 
delTX.hasTotalBlockSize()) {
         long pendingBytes = containerData.getBlockPendingDeletionBytes();
         pendingBytes += delTX.getTotalBlockSize();
         metadataTable
             .putWithBatch(batchOperation,
                 containerData.getPendingDeleteBlockBytesKey(),
                 pendingBytes);
    }



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