You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/08/25 13:48:26 UTC

[GitHub] [ozone] GeorgeJahad commented on a diff in pull request #3653: HDDS-6964. [Snapshot] Split out shared "Path based access" code from OM.

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org