priyeshkaratha commented on code in PR #9272:
URL: https://github.com/apache/ozone/pull/9272#discussion_r2532863714


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImpl.java:
##########
@@ -147,13 +156,23 @@ public void incrementCount(List<Long> txIDs)
   }
 
   private DeletedBlocksTransaction constructNewTransaction(
-      long txID, long containerID, List<Long> blocks) {
-    return DeletedBlocksTransaction.newBuilder()
+      long txID, long containerID, List<DeletedBlock> blocks) {
+    List<Long> localIdList = blocks.stream().map(b -> 
b.getBlockID().getLocalID()).collect(Collectors.toList());
+    DeletedBlocksTransaction.Builder builder = 
DeletedBlocksTransaction.newBuilder()
         .setTxID(txID)
         .setContainerID(containerID)
-        .addAllLocalID(blocks)
-        .setCount(0)
-        .build();
+        .addAllLocalID(localIdList)
+        .setCount(0);
+
+    if 
(VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.STORAGE_SPACE_DISTRIBUTION))
 {

Review Comment:
   If size is 0 and set,  the value of DeletedBlocksTransactionSummary will 
become strange, for example, total block 100, replicated size 0 in some 
scenarios. To avoid this keeping default size as -1.



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