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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -167,8 +158,19 @@ public SnapshotDiffManager(ManagedRocksDB db,
         new ThreadPoolExecutor.CallerRunsPolicy()
     );
 
-    // TODO: [SNAPSHOT] Load jobs only if it is leader node.
-    //  It could a event-triggered form OM when node is leader and up.
+    // Ideally, loadJobsOnStartUp should run only on OM node, since SnapDiff
+    // is not HA currently and running this on all the nodes would be
+    // inefficient. Especially, when OM node restarts and loses its leadership.
+    // However, it is hard to determine if node is leader node because 
consensus
+    // happens inside Ratis. We can add something like Awaitility.wait() here
+    // but that is not full proof either.
+    // Hence, we decided that it is OK to let this run on all the OM nodes for
+    // now knowing that it would be inefficient.
+    // When SnapshotDiffManager loads for very first time, loadJobsOnStartUp
+    // will be no-ops for all the nodes. In subsequent restarts or upgrades,
+    // it would run on the current leader and most like on previous leader 
only.
+    // When we build snapDiff HA aware, we will revisit this.
+    // Details: 
https://github.com/apache/ozone/pull/4438#discussion_r1149788226
     this.loadJobsOnStartUp();

Review Comment:
   shouldn't this be running on every restart ?



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