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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImpl.java:
##########
@@ -326,9 +337,18 @@ public void close() {
   }
 
   private void getTransaction(DeletedBlocksTransaction tx,
-      DatanodeDeletedBlockTransactions transactions,
-      Set<ContainerReplica> replicas,
-      Map<DatanodeID, Map<Long, CmdStatus>> commandStatus) {
+                                       DatanodeDeletedBlockTransactions 
transactions,
+                                       Set<ContainerReplica> replicas,
+                                       Map<DatanodeID, Map<Long, CmdStatus>> 
commandStatus) {
+
+    // Check if all replicas satisfy the maxBlocksPerDatanode condition
+    if (!replicas.stream().allMatch(replica -> {
+      final DatanodeID datanodeID = replica.getDatanodeDetails().getID();
+      return transactions.getNumberOfBlocksForDatanode(datanodeID) < 
maxDeleteBlocksPerDatanode;
+    })) {
+      return;
+    }

Review Comment:
   Currently also for `hdds.scm.block.deletion.per-interval.max` doesn't 
guarantee the exact number. I think it is ok to have little extra, instead of 
adding more checks.



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