coderzc commented on code in PR #17164:
URL: https://github.com/apache/pulsar/pull/17164#discussion_r967976234


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java:
##########
@@ -365,6 +367,48 @@ public void operationFailed(MetaStoreException e) {
         return updateCursorPropertiesResult;
     }
 
+    @Override
+    public CompletableFuture<Void> setCursorProperties(Map<String, String> 
cursorProperties) {
+        Map<String, String> newProperties =
+                cursorProperties == null ? new HashMap<>() : new 
HashMap<>(cursorProperties);
+        long stamp = cursorPropertiesUpdateLock.writeLock();

Review Comment:
   @Jason918 
   > I not quite certain about the purpose of this lock. Can you describe the 
non-thread-safe case here?
   
   The perform `updateSubscriptionProperties` by Admin-API and others using 
`CursorProperties` to have data race, for example, store the list of delayed 
message index bucket snapshot in the 
[PIP-195](https://github.com/apache/pulsar/issues/16763), so we need to add the 
lock to ensure data 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