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


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -4476,10 +4476,13 @@ public void checkInactiveLedgerAndRollOver() {
                     }
 
                     ledgerClosed(lh);
+                    createLedgerAfterClosed();

Review Comment:
   @rdhabalia @vineeth1995 @lhotari 
   
   I removed this line (`createLedgerAfterClosed();`), but the test 
`testNonDurableCursorCreateForInactiveLedger ` still passes.
   
   I think the root cause of the issue you explained is the 
`ManagedLedegrImpl.ledgers` is empty due to other bugs. So, I want to revert 
this PR.
   ```
   java.util.NoSuchElementException
        at 
java.base/java.util.concurrent.ConcurrentSkipListMap.firstKey(ConcurrentSkipListMap.java:1859)
        at 
org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.getFirstPosition(ManagedLedgerImpl.java:3715)
        at 
org.apache.bookkeeper.mledger.impl.NonDurableCursorImpl.<init>(NonDurableCursorImpl.java:59)
        at 
org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.newNonDurableCursor(ManagedLedgerImpl.java:1127)
        at 
org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.newNonDurableCursor(ManagedLedgerImpl.java:1108)
        at 
org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.newNonDurableCursor(ManagedLedgerImpl.java:1100)
   ```
   



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