coderzc commented on code in PR #21187:
URL: https://github.com/apache/pulsar/pull/21187#discussion_r1462670799
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -2519,7 +2525,8 @@ public Position getPersistentMarkDeletedPosition() {
public void rewind() {
lock.writeLock().lock();
try {
- PositionImpl newReadPosition =
ledger.getNextValidPosition(markDeletePosition);
+ PositionImpl newReadPosition = isCursorReadFromCompacted() ?
markDeletePosition.getNext() :
+ ledger.getNextValidPosition(markDeletePosition);
Review Comment:
I don't think this affects correctness, if the newReadPosition's ledger
doesn't exist in ml, it will be moved to the beginning of the next ledger.
https://github.com/apache/pulsar/blob/b14fcb47f20398bdf5b698e158346dce19f0edc6/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java#L1887-L1894
--
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]