hangc0276 commented on code in PR #3917:
URL: https://github.com/apache/bookkeeper/pull/3917#discussion_r1168136018


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/ReplicationWorker.java:
##########
@@ -570,6 +580,10 @@ private boolean 
isLastSegmentOpenAndMissingBookies(LedgerHandle lh) throws BKExc
 
         SortedMap<Long, ? extends List<BookieId>> ensembles = 
admin.getLedgerMetadata(lh).getAllEnsembles();
         List<BookieId> finalEnsemble = ensembles.get(ensembles.lastKey());
+        if (ensembles.size() > 1 && lh.getLastAddConfirmed() < 
ensembles.lastKey() - 1) {
+            finalEnsemble = new ArrayList<>(finalEnsemble);

Review Comment:
   The `finalEnsemble` is immutable in the ledger metadata.



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to