diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java index 235b554988c..c6fa5cbe13d 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/LedgerMetadataIndex.java @@ -160,6 +160,9 @@ public void delete(long ledgerId) throws IOException { public Iterable getActiveLedgersInRange(final long firstLedgerId, final long lastLedgerId) throws IOException { + if (firstLedgerId <= 0 && lastLedgerId == Long.MAX_VALUE) { + return ledgers.keys(); + } return Iterables.filter(ledgers.keys(), new Predicate() { @Override public boolean apply(Long ledgerId) {