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_r146355670
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java
 ##########
 @@ -810,47 +780,71 @@ public void openComplete(int newrc, final LedgerHandle 
newlh, Object newctx) {
                  */
                 for (final Long startEntryId : ledgerFragmentsToRecover) {
                     Long endEntryId = ledgerFragmentsRange.get(startEntryId);
-                    BookieSocketAddress newBookie = null;
+                    ArrayList<BookieSocketAddress> ensemble = 
lh.getLedgerMetadata().getEnsembles().get(startEntryId);
+                    // Get bookies to replace
+                    Map<Integer, BookieSocketAddress> targetBookieAddresses;
                     try {
-                        newBookie = 
getNewBookie(lh.getLedgerMetadata().getEnsembles().get(startEntryId),
-                                                 availableBookies);
-                    } catch (BKException.BKNotEnoughBookiesException bke) {
-                        
ledgerFragmentsMcb.processResult(BKException.Code.NotEnoughBookiesException,
-                                                         null, null);
+                        targetBookieAddresses = getReplacedBookies(lh, 
ensemble, bookiesSrc);
+                    } catch (BKException.BKNotEnoughBookiesException e) {
+                        if (!dryrun) {
 
 Review comment:
   because `dryrun` is to dump all the information, which it doesn't mutate any 
state. it doesn't hurt to continue the `dryrun` when hitting not enough bookies 
exception. especially, not enough bookies exception can be thrown when it 
doesn't meet rack/region placement constraints.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to