bshashikant commented on a change in pull request #2257:
URL: https://github.com/apache/ozone/pull/2257#discussion_r635094006



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/ScmHAUnfinalizedStateValidationAction.java
##########
@@ -23,23 +23,25 @@
 import static org.apache.hadoop.ozone.upgrade.UpgradeActionHdds.Component.SCM;
 
 import org.apache.hadoop.hdds.scm.ScmConfigKeys;
+import org.apache.hadoop.hdds.scm.ha.SCMHAUtils;
 import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
 import org.apache.hadoop.hdds.upgrade.HDDSUpgradeAction;
 import org.apache.hadoop.ozone.upgrade.UpgradeActionHdds;
 import org.apache.hadoop.ozone.upgrade.UpgradeException;
 
+/**
+ * Checks that SCM HA cannot be used in a pre-finalized cluster, unless it
+ * was already being used before this action was run.
+ */
 @UpgradeActionHdds(feature = SCM_HA, component = SCM,
     type = VALIDATE_IN_PREFINALIZE)
 public class ScmHAUnfinalizedStateValidationAction
     implements HDDSUpgradeAction<StorageContainerManager> {
 
   @Override
   public void execute(StorageContainerManager scm) throws Exception {
-    boolean isHAEnabled =
-        
scm.getConfiguration().getBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY,
-        ScmConfigKeys.OZONE_SCM_HA_ENABLE_DEFAULT);
-
-    if (isHAEnabled) {
+    if (SCMHAUtils.isSCMHAEnabled(scm.getConfiguration()) &&
+        !scm.getScmStorageConfig().isSCMHAEnabled()) {

Review comment:
       why do we need both the  checks one from configuration and one from 
version file?
   




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

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