Copilot commented on code in PR #4642:
URL: https://github.com/apache/bookkeeper/pull/4642#discussion_r2252918456


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java:
##########
@@ -567,7 +567,18 @@ private long getLedgerToRereplicateFromHierarchy(String 
parent, long depth)
             return -1;
         }
 
-        Collections.shuffle(children);
+        if (depth == 3) {
+            // Avoid workers want to get the same ledger lock.

Review Comment:
   The comment has grammatical errors. It should be "Avoid workers wanting to 
get the same ledger lock" or "Prevent workers from getting the same ledger 
lock".
   ```suggestion
               // Avoid workers wanting to get the same ledger lock.
   ```



##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/TestLedgerUnderreplicationManager.java:
##########
@@ -171,6 +173,54 @@ public Long call() {
             });
     }
 
+    /**
+     * Test that larger ledgerIds are processed first when getting ledgers to 
rereplicate.
+     * This verifies the sorting behavior in 
getLedgerToRereplicateFromHierarchy.

Review Comment:
   The word 'Rerepl' should be 'ReReplicate' or 'Replicate' to match the actual 
method name pattern.
   ```suggestion
        * Test that larger ledgerIds are processed first when getting ledgers 
to replicate.
        * This verifies the sorting behavior in 
getLedgerToReplicateFromHierarchy.
   ```



##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/replication/TestLedgerUnderreplicationManager.java:
##########
@@ -171,6 +173,54 @@ public Long call() {
             });
     }
 
+    /**
+     * Test that larger ledgerIds are processed first when getting ledgers to 
rereplicate.

Review Comment:
   The word 'rereplicate' should be 're-replicate' or 'replicate' for 
consistency with standard terminology.
   ```suggestion
        * Test that larger ledgerIds are processed first when getting ledgers 
to re-replicate.
   ```



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

Reply via email to