You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/03/15 11:06:38 UTC

[GitHub] [pulsar] mattisonchao commented on a change in pull request #14672: Change ``rollCurrentLedgerIfFull`` logic to follow lazy creation of ledger

mattisonchao commented on a change in pull request #14672:
URL: https://github.com/apache/pulsar/pull/14672#discussion_r826845565



##########
File path: pulsar-broker/src/test/java/org/apache/pulsar/broker/service/CurrentLedgerRolloverIfFullTest.java
##########
@@ -104,12 +110,51 @@ public void testCurrentLedgerRolloverIfFull() throws Exception {
         stateUpdater.set(managedLedger, ManagedLedgerImpl.State.LedgerOpened);
         managedLedger.rollCurrentLedgerIfFull();
 
-        // the last ledger will be closed and removed and we have one ledger for empty
+        // If there are no pending write messages, the last ledger will be closed and still held.
         Awaitility.await()
                 .pollInterval(Duration.ofMillis(1000L))
                 .untilAsserted(() -> {
                     Assert.assertEquals(managedLedger.getLedgersInfoAsList().size(), 1);
-                    Assert.assertEquals(managedLedger.getTotalSize(), 0);
+                    Assert.assertNotEquals(managedLedger.getCurrentLedgerSize(), 0);
+                    MLDataFormats.ManagedLedgerInfo.LedgerInfo lastLhAfterRollover =
+                            managedLedger.getLedgersInfoAsList().get(managedLedger.getLedgersInfoAsList().size() - 1);

Review comment:
       Yes, I will change it ASAP.




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org