sijie commented on a change in pull request #641: Issue-596 Issue-583: Auto replication should honor ensemble placement policy URL: https://github.com/apache/bookkeeper/pull/641#discussion_r146354598
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java ########## @@ -863,16 +857,81 @@ public void openComplete(int newrc, final LedgerHandle newlh, Object newctx) { * @param ledgerFragmentMcb * - MultiCallback to invoke once we've recovered the current * ledger fragment. - * @param newBookie - * - New bookie we want to use to recover and replicate the + * @param newBookies + * - New bookies we want to use to recover and replicate the * ledger entries that were stored on the failed bookie. */ private void asyncRecoverLedgerFragment(final LedgerHandle lh, final LedgerFragment ledgerFragment, final AsyncCallback.VoidCallback ledgerFragmentMcb, - final BookieSocketAddress newBookie) - throws InterruptedException { - lfr.replicate(lh, ledgerFragment, ledgerFragmentMcb, newBookie); + final Set<BookieSocketAddress> newBookies) throws InterruptedException { + lfr.replicate(lh, ledgerFragment, ledgerFragmentMcb, newBookies); + } + + private Map<Integer, BookieSocketAddress> getReplacedBookies( Review comment: hmm, where do you see the mutation happening? this method is calculating the bookies to replace based on ensemble. the actual mutation of ledger metadata only happens after successful re-replication. `extraReplicas` would actually introduce complexity on reading, garbage collection and etc. it is actually not too bad for the ledgers based on a metadata store. it can be bad for `log0` stuff, but the ledgers in `log0` can be a special case that disable ensemble change which a ledger is effectively an ensemble. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services