ivankelly 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_r146476663
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeperAdmin.java
 ##########
 @@ -739,19 +684,40 @@ public void openComplete(int rc, final LedgerHandle lh, 
Object ctx) {
                         asyncOpenLedger(lId, new OpenCallback() {
                             @Override
                             public void openComplete(int newrc, final 
LedgerHandle newlh, Object newctx) {
-                                if (newrc != Code.OK.intValue()) {
+                                if (newrc != BKException.Code.OK) {
                                     LOG.error("BK error close ledger: " + lId, 
BKException.create(newrc));
-                                    ledgerIterCb.processResult(newrc, null, 
null);
+                                    finalLedgerIterCb.processResult(newrc, 
null, null);
                                     return;
                                 }
-                                // do recovery
-                                recoverLedger(bookieSrc, lId, ledgerIterCb, 
availableBookies);
+                                bkc.mainWorkerPool.submit(() -> {
+                                    // do recovery
+                                    recoverLedger(bookiesSrc, lId, dryrun, 
skipOpenLedgers, finalLedgerIterCb);
+                                });
                             }
                         }, null);
                         return;
                     }
                 }
 
+                final AsyncCallback.VoidCallback ledgerIterCb = new 
AsyncCallback.VoidCallback() {
 
 Review comment:
   The reason I suggested the utility message is that when I came to this in 
the review, I was like "why is he adding this wrapper here". The logging within 
the callback doesn't clarify why.

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

Reply via email to