Skip to content

Commit

Permalink
Invoke sendAddSuccessCallbacks if no bookie will be replaced in ensem…
Browse files Browse the repository at this point in the history
…ble change

Signed-off-by: guojunhao <guojunhao@bigo.sg>
  • Loading branch information
guojunhao committed Apr 11, 2024
1 parent 7317435 commit 71aa7e4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2278,6 +2278,15 @@ void ensembleChangeLoop(List<BookieId> origEnsemble, Map<Integer, BookieId> fail
}
if (newEnsemble != null) { // unsetSuccess outside of lock
unsetSuccessAndSendWriteRequest(newEnsemble, replaced);
// If replaced is empty, no one will trigger #sendAddSuccessCallbacks
// in #unsetSuccessAndSendWriteRequest.
// So we do need to invoke #sendAddSuccessCallbacks() for entries which
// may have already completed in pendingAddOps, but are just waiting for the ensemble
// to change.
if (replaced.isEmpty()) {
sendAddSuccessCallbacks();
LOG.info("No bookie will be replaced, invoke #sendAddSuccessCallbacks.");
}
}
}
}, clientCtx.getMainWorkerPool().chooseThread(ledgerId));
Expand Down

0 comments on commit 71aa7e4

Please sign in to comment.