oneby-wang commented on PR #25117:
URL: https://github.com/apache/pulsar/pull/25117#issuecomment-3723491343

   This PR is inspired by https://github.com/apache/pulsar/pull/25087.
   
   If a cursor consumes the last entry of previous ledger, I think we should 
move the `markDeletePosition` to `nextValidLedger:-1`. If we don't move the 
`markDeletePosition`, once the previous ledger is trimmed, cursor's 
`markDeletePosition` is inconsistent with ledger data.
   
   > Could you share which test can show the inconsistency?
   
   
`ManagedCursorTest.testAsyncMarkDeleteMoveToNextLedgerInNonRolloverScenario()` 
and `ManagedCursorTest.testAsyncMarkDeleteMoveToNextLedgerOneByOne()`.
   
   But, unfortunately, we can not ensure happens-before between 
`ManagedCursoImplr.asyncMarkDelete()` and 
`ManagedLedgerImpl.maybeUpdateCursorBeforeTrimmingConsumedLedger()` in ledger 
rollover, so this is the only inconsistency reason after this PR(could be 
handled by ledger trim process), see also 
`ManagedCursorTest.testAsyncMarkDeleteMayMoveToNextLedgerInRolloverScenario`
   


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