lhotari commented on code in PR #25047:
URL: https://github.com/apache/pulsar/pull/25047#discussion_r2603223416


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -1483,47 +1502,63 @@ protected void internalResetCursor(Position 
proposedReadPosition,
 
         final Position newMarkDeletePosition = 
ledger.getPreviousPosition(newReadPosition);
 
+        Runnable alignAcknowledgeStatusAfterPersisted = () -> {
+            // Correct the variable "messagesConsumedCounter".
+            // BTW, no need to change "messagesConsumedCounter" if new 
"markDeletePosition" is the same as the
+            // old one.
+            int compareRes = ledger.comparePositions(markDeletePosition, 
newMarkDeletePosition);

Review Comment:
   I think that `markDeletePosition` should be assigned to a local variable so 
that the logic would be correct even if it gets updated concurrently. Or is 
there some other way to ensure consistency?



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