You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "hangc0276 (via GitHub)" <gi...@apache.org> on 2023/02/20 10:51:22 UTC
[GitHub] [bookkeeper] hangc0276 commented on a diff in pull request #3773: [improve] Let the replication worker can rerplicate the fresh ledgers at first.
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: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org