summeriiii opened a new issue, #23425: URL: https://github.com/apache/pulsar/issues/23425
### Search before asking - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar. ### Read release policy - [X] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker. ### Version master ### Minimal reproduce step ManagedCursorTest ```java @Test(timeOut = 20000) public void cursorPersistenceWithLedgerForceRecovery() throws Exception { ManagedLedgerConfig config = new ManagedLedgerConfig(); config.setLedgerForceRecovery(true); ManagedLedger ledger = factory.open("my_test_ledger", config); ManagedCursor c1 = ledger.openCursor("c1"); ledger.addEntry("dummy-entry-1".getBytes(Encoding)); ledger.addEntry("dummy-entry-2".getBytes(Encoding)); ledger.addEntry("dummy-entry-3".getBytes(Encoding)); List<Entry> entries = c1.readEntries(2); Position p1 = entries.get(1).getPosition(); c1.markDelete(p1); entries.forEach(Entry::release); entries = c1.readEntries(1); entries.forEach(Entry::release); // Reopen @Cleanup("shutdown") ManagedLedgerFactory factory2 = new ManagedLedgerFactoryImpl(metadataStore, bkc); ledger = factory2.open("my_test_ledger", config); c1 = ledger.openCursor("c1"); assertEquals(c1.getMarkDeletedPosition(), p1); } ``` ### What did you expect to see? the test was failed. ```2024-10-09T16:03:34,448 - INFO - [bookkeeper-ml-scheduler-OrderedScheduler-3-0:ManagedLedgerImpl@1496] - [my_test_ledger] Closing managed ledger java.lang.AssertionError: Expected :3:1 Actual :3:-1 <Click to see difference> at org.testng.Assert.fail(Assert.java:110) at org.testng.Assert.failNotEquals(Assert.java:1577) at org.testng.Assert.assertEqualsImpl(Assert.java:149) at org.testng.Assert.assertEquals(Assert.java:131) at org.testng.Assert.assertEquals(Assert.java:643) at org.apache.bookkeeper.mledger.impl.ManagedCursorTest.cursorPersistenceWithLedgerForceRecovery(ManagedCursorTest.java:1283) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:139) at org.testng.internal.invokers.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:47) at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:76) at org.testng.internal.invokers.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) ``` ### What did you see instead? The test pass ### Anything else? _No response_ ### Are you willing to submit a PR? - [X] I'm willing to submit a PR! -- 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]
