sreejasahithi commented on code in PR #10105:
URL: https://github.com/apache/ozone/pull/10105#discussion_r3128141200


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/DeleteBlocksCommandHandler.java:
##########
@@ -649,20 +649,48 @@ private void updateMetaData(KeyValueContainerData 
containerData,
       // Update pending deletion blocks count, blocks bytes and delete 
transaction ID in in-memory container status.
       // Persist pending bytes only if the feature is finalized.
       if (VersionedDatanodeFeatures.isFinalized(
-          HDDSLayoutFeature.STORAGE_SPACE_DISTRIBUTION) && 
delTX.hasTotalBlockSize()) {
+          HDDSLayoutFeature.STORAGE_SPACE_DISTRIBUTION)) {
         long pendingBytes = containerData.getBlockPendingDeletionBytes();
-        pendingBytes += delTX.getTotalBlockSize();
+        pendingBytes += computePerReplicaPendingBytes(delTX);
         metadataTable
             .putWithBatch(batchOperation,
                 containerData.getPendingDeleteBlockBytesKey(),
                 pendingBytes);
       }
       containerData.incrPendingDeletionBlocks(newDeletionBlocks,
-          delTX.hasTotalBlockSize() ? delTX.getTotalBlockSize() : 0);
+          computePerReplicaPendingBytes(delTX));

Review Comment:
   computePerReplicaPendingBytes is called twice on the same unchanged delTX.
   Instead we can compute it once and store in a local variable.



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