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



##########
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:
       The version file check indicates whether SCM HA was already in use 
before the upgrade framework was deployed to this cluster. The config check 
indicates whether SCM HA is currently enabled. The action is run when the 
cluster is pre-finalized for SCM HA (users should still be able to downgrade at 
this point). So if we are pre-finalized for SCM HA, HA has been enabled in the 
config, and HA was not being used already, we should fail startup so that SCM 
HA is not used until the cluster is finalized.




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