lhotari commented on code in PR #15067:
URL: https://github.com/apache/pulsar/pull/15067#discussion_r845907801
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -1814,6 +1876,9 @@ public void operationComplete() {
mdEntry.newPosition);
}
+
INPROGRESS_MARKDELETE_PERSIST_POSITION_UPDATER.compareAndSet(ManagedCursorImpl.this,
+ mdEntry.newPosition, null);
+
Review Comment:
@congbobo184 Locks could have surprising side effects, such as deadlocks
(example #11965).
Please explain the reason why `persistentMarkDeletePosition` exists and the
consistency guarantees for the value.
I think that using a single threaded execution model (by using an
OrderedExecutor with the ledger name as the key) would be a better way to
ensure consistency where ordering matters, if that's the goal.
The changes in this PR already ensure eventual consistency at some level,
but there's no ordering of the persisting operations, so there are possible
gaps. The question is more about the impact if `persistentMarkDeletePosition`
would be off by one etc.
--
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]