Skip to content

Commit 896137d

Browse files
authored
[fix] fix Auditor ignoring bookies shut down before Auditor start (#4419)
1 parent f33d40d commit 896137d

File tree

1 file changed

+7
-1
lines changed
  • bookkeeper-server/src/main/java/org/apache/bookkeeper/replication

1 file changed

+7
-1
lines changed

bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.util.concurrent.TimeUnit;
3737
import java.util.concurrent.atomic.AtomicBoolean;
3838
import java.util.function.BiConsumer;
39+
import java.util.stream.Collectors;
3940
import org.apache.bookkeeper.client.BKException;
4041
import org.apache.bookkeeper.client.BookKeeper;
4142
import org.apache.bookkeeper.client.BookKeeperAdmin;
@@ -386,7 +387,12 @@ public void start() {
386387

387388
try {
388389
watchBookieChanges();
389-
knownBookies = getAvailableBookies();
390+
// Start with all available bookies
391+
// to handle situations where the auditor
392+
// is started after some bookies have already failed
393+
knownBookies = admin.getAllBookies().stream()
394+
.map(BookieId::toString)
395+
.collect(Collectors.toList());
390396
this.ledgerUnderreplicationManager
391397
.notifyLostBookieRecoveryDelayChanged(new LostBookieRecoveryDelayChangedCb());
392398
} catch (BKException bke) {

0 commit comments

Comments
 (0)