hangc0276 commented on code in PR #3773:
URL: https://github.com/apache/bookkeeper/pull/3773#discussion_r1111780501
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java:
##########
@@ -557,10 +557,15 @@ private long getLedgerToRereplicateFromHierarchy(String
parent, long depth)
return -1;
}
- Collections.shuffle(children);
+ if (depth == 3) {
+ // Avoid workers want to get the same ledger lock.
+ Collections.shuffle(children);
+ } else {
+ Collections.sort(children);
Review Comment:
It will sort according to the `String` type order instead of the LedgerId
long type order, which can't more sure the sorted list is ordered by ledger
creation time.
--
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]