BewareMyPower commented on code in PR #23951:
URL: https://github.com/apache/pulsar/pull/23951#discussion_r1948416183
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -1144,16 +1144,16 @@ public ManagedCursor newNonDurableCursor(Position
startCursorPosition, String cu
return cachedCursor;
}
- NonDurableCursorImpl cursor = new NonDurableCursorImpl(bookKeeper,
this, cursorName,
- startCursorPosition, initialPosition, isReadCompacted);
- cursor.setActive();
-
- log.info("[{}] Opened new cursor: {}", name, cursor);
+ // To avoid cursor initialization and "ML.trimLedgers" execute
concurrency, we add this lock block.
+ // See details https://github.com/apache/pulsar/pull/23951.
Review Comment:
I've got the fix now. I updated the PR description and here are the improved
comments, please help double confirm it @poorbarcode
The key point is that we want to synchronize both the creation of a
non-durable cursor and `addCursor()` call with the trim operation, not only the
creation.
--
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]