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


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

Review Comment:
   Thanks for the suggestion, looks fine for me to break the while loop. But 
the problem is 3 * (DN count) * maxDeleteBlocksPerDatanode may not always 
happen as there can be under-replicated containers, replica count will be less 
than 3. Even this will not hold good for EC which may have 5-8 replica or so.
   
   Assume we set total limit as 2M and per data node limit as 100K.
   It will iterate whole table only when cluster size is too less may be 15-20 
nodes and then we expand the cluster.
   The problem will arise only when gap between total limit and per data node 
limit is way too high compare to the number of DNs in the cluster.
   



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