This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 701e1d8e9ab [fix][ml] Fix concurrent cursor properties update race 
(#25434)
701e1d8e9ab is described below

commit 701e1d8e9ab0cdfde8f79f9982de62f80c618caf
Author: Philipp Dolif <[email protected]>
AuthorDate: Mon Mar 30 02:12:07 2026 +0200

    [fix][ml] Fix concurrent cursor properties update race (#25434)
---
 .../java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
 
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
index 3bb0269a1e9..1e5c57bb453 100644
--- 
a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
+++ 
b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
@@ -423,6 +423,8 @@ public class ManagedCursorImpl implements ManagedCursor {
             final Function<Map<String, String>, Map<String, String>> 
updateFunction) {
         CompletableFuture<Void> updateCursorPropertiesResult = new 
CompletableFuture<>();
 
+        final Stat lastCursorLedgerStat = 
ManagedCursorImpl.this.cursorLedgerStat;
+
         Map<String, String> newProperties = 
updateFunction.apply(ManagedCursorImpl.this.cursorProperties);
         if (!isDurable()) {
             this.cursorProperties = Collections.unmodifiableMap(newProperties);
@@ -434,7 +436,7 @@ public class ManagedCursorImpl implements ManagedCursor {
         copy.copyFrom(ManagedCursorImpl.this.managedCursorInfo);
         copy.clearCursorProperties();
         copy.addAllCursorProperties(buildStringPropertiesMap(newProperties));
-        final Stat lastCursorLedgerStat = 
ManagedCursorImpl.this.cursorLedgerStat;
+
         ledger.getStore().asyncUpdateCursorInfo(ledger.getName(),
                 name, copy, lastCursorLedgerStat, new MetaStoreCallback<>() {
                     @Override

Reply via email to