GeorgeJahad commented on code in PR #3653:
URL: https://github.com/apache/ozone/pull/3653#discussion_r954992484


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -710,6 +703,8 @@ private void instantiateServices(boolean withNewSnapshot) 
throws IOException {
     prefixManager = new PrefixManagerImpl(metadataManager, isRatisEnabled);
     keyManager = new KeyManagerImpl(this, scmClient, configuration,
         omStorage.getOmId());

Review Comment:
   It is true that the writes are atomic.  The problem is that Java makes no 
guarantee that the writes will be visible to other threads, if they aren't 
properly "synchronized", either with the volatile keyword or by using 
synchronized blocks.
   
   Here is a relatively short blog post explaining the issue:
   
https://www.logicbig.com/tutorials/core-java-tutorial/java-multi-threading/visibility-volatile.html
   
   The best explanation I've found is in my favorite java book, "Java 
Concurrency In Practice", chapter three, but it is a bit long:
   
https://leon-wtf.github.io/doc/java-concurrency-in-practice.pdf#%5B%7B%22num%22%3A63%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C-6%2C466%2C1%5D



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to