nandakumar131 commented on code in PR #5779:
URL: https://github.com/apache/ozone/pull/5779#discussion_r1430159320


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/StorageContainerManager.java:
##########
@@ -1333,14 +1334,33 @@ public static boolean scmInit(OzoneConfiguration conf,
       // Initialize security if security is enabled later.
       initializeSecurityIfNeeded(conf, scmStorageConfig, selfHostName, true);
 
-      if (SCMHAUtils.isSCMHAEnabled(conf) && !isSCMHAEnabled) {
+      if (conf.getBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY,
+          ScmConfigKeys.OZONE_SCM_HA_ENABLE_DEFAULT) && !isSCMHAEnabled) {
         SCMRatisServerImpl.initialize(scmStorageConfig.getClusterID(),
             scmStorageConfig.getScmId(), haDetails.getLocalNodeDetails(),
             conf);
         scmStorageConfig.setSCMHAFlag(true);
         scmStorageConfig.setPrimaryScmNodeId(scmStorageConfig.getScmId());
         scmStorageConfig.forceInitialize();
-        LOG.debug("Enabled SCM HA");
+
+        /*
+         * Since Ratis is initialized on an existing cluster, we have to
+         * trigger Ratis snapshot so that this SCM can send the latest scm.db
+         * to the bootstrapping SCMs later.
+         */
+
+        try {
+          DefaultConfigManager.forceUpdateConfigValue(
+              ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, true);
+          StorageContainerManager scm = createSCM(conf);

Review Comment:
   Yes, this needs to be fixed. I'm planning on introducing separate 
classloaders for different components in `MiniOzoneCluster`. Hopefully, that 
will solve this problem.



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