prashantpogde commented on code in PR #4909:
URL: https://github.com/apache/ozone/pull/4909#discussion_r1231454165


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotChainManager.java:
##########
@@ -48,6 +47,10 @@
 public class SnapshotChainManager {
   private static final Logger LOG =
       LoggerFactory.getLogger(SnapshotChainManager.class);
+  // Dummy lock to synchronize addSnapshot and deleteSnapshot.
+  // This lock is also used by OMSnapshotCreateRequest to make sure that
+  // snapshot gets added to chain only if addition to cache is successfully.
+  public static final Object LOCK = new Object();

Review Comment:
   you could synchronize on the SnapshotChainManager object itself in all these 
places. Btw it needs to be a singleton class.



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