Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import org.apache.bookkeeper.mledger.ManagedLedgerException.ManagedLedgerFencedException;
import org.apache.bookkeeper.mledger.ManagedLedgerException.ManagedLedgerTerminatedException;
import org.apache.bookkeeper.mledger.ManagedLedgerException.MetadataNotFoundException;
import org.apache.bookkeeper.mledger.ManagedLedgerException.NonRecoverableLedgerException;
import org.apache.bookkeeper.mledger.Position;
import org.apache.bookkeeper.mledger.impl.ManagedCursorContainer;
import org.apache.bookkeeper.mledger.impl.ManagedCursorImpl;
Expand Down Expand Up @@ -2853,7 +2854,14 @@ public boolean isOldestMessageExpired(ManagedCursor cursor, int messageTTLInSeco
(int) (messageTTLInSeconds * MESSAGE_EXPIRY_THRESHOLD), entryTimestamp);
}
} catch (Exception e) {
log.warn("[{}] Error while getting the oldest message", topic, e);
if (brokerService.pulsar().getConfiguration().isAutoSkipNonRecoverableData()
Comment thread
aloyszhang marked this conversation as resolved.
&& e instanceof NonRecoverableLedgerException) {
// NonRecoverableLedgerException means the ledger or entry can't be read anymore.
// if AutoSkipNonRecoverableData is set to true, just return true here.
return true;
} else {
log.warn("[{}] Error while getting the oldest message", topic, e);
}
} finally {
if (entry != null) {
entry.release();
Expand Down