eolivelli commented on pull request #9900:
URL: https://github.com/apache/pulsar/pull/9900#issuecomment-798931188


   If the problem is about modifying concurrently the Policies structure, 
   isn't it better to add a clone operation here  when we execute the mutation 
function ?
   
https://github.com/apache/pulsar/blob/cdef6446d796e9e29c0c9b1ac288cd6e69084797/pulsar-metadata/src/main/java/org/apache/pulsar/metadata/cache/impl/MetadataCacheImpl.java#L155
   
   MetadataCacheImpl already handles versioning in respect to the 
MetadataService, but the problem is that we are modifying the stored value 
returned from objCache.get().
   We should clone that value, apply the modify function and then write.
   and then return the modified (immutable) value.
   
   cc @rdhabalia @merlimat 


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to