poorbarcode commented on code in PR #21250:
URL: https://github.com/apache/pulsar/pull/21250#discussion_r1339429789


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -2848,15 +2848,13 @@ void advanceCursorsIfNecessary(List<LedgerInfo> 
ledgersToDelete) throws LedgerNo
             return;
         }
 
-        // need to move mark delete for non-durable cursors to the first 
ledger NOT marked for deletion
-        // calling getNumberOfEntries latter for a ledger that is already 
deleted will be problematic and return
-        // incorrect results
-        Long firstNonDeletedLedger = 
ledgers.higherKey(ledgersToDelete.get(ledgersToDelete.size() - 
1).getLedgerId());
-        if (firstNonDeletedLedger == null) {
-            throw new LedgerNotExistException("First non deleted Ledger is not 
found");
+        // Just ack messages like a consumer. Normally, consumers will not 
confirm a position that does not exist, so
+        // find the latest existing position to ack.
+        PositionImpl highestPositionToDelete = 
calculateLastEntryInLedgerList(ledgersToDelete);

Review Comment:
   NO, the next line checked `null`:blush:



-- 
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