This is an automated email from the ASF dual-hosted git repository.

ivandika pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new fdc77db35e HDDS-12300. Merge OmUpgradeConfig into OmConfig (#8378)
fdc77db35e is described below

commit fdc77db35eb7093d8d9f2c905da2f471d281c25b
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Sat May 3 12:16:49 2025 +0200

    HDDS-12300. Merge OmUpgradeConfig into OmConfig (#8378)
---
 .../java/org/apache/hadoop/ozone/om/OmConfig.java  | 18 ++++++++
 .../apache/hadoop/ozone/om/OmUpgradeConfig.java    | 52 ----------------------
 .../org/apache/hadoop/ozone/om/OzoneManager.java   |  3 +-
 3 files changed, 19 insertions(+), 54 deletions(-)

diff --git 
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OmConfig.java 
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OmConfig.java
index 9a24428f5c..f94d05f1be 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OmConfig.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OmConfig.java
@@ -18,9 +18,11 @@
 package org.apache.hadoop.ozone.om;
 
 import com.google.common.base.Preconditions;
+import java.time.Duration;
 import org.apache.hadoop.hdds.conf.Config;
 import org.apache.hadoop.hdds.conf.ConfigGroup;
 import org.apache.hadoop.hdds.conf.ConfigTag;
+import org.apache.hadoop.hdds.conf.ConfigType;
 import org.apache.hadoop.hdds.conf.PostConstruct;
 import org.apache.hadoop.hdds.conf.ReconfigurableConfig;
 
@@ -67,6 +69,22 @@ public class OmConfig extends ReconfigurableConfig {
   )
   private int maxUserVolumeCount;
 
+  @Config(key = "upgrade.finalization.ratis.based.timeout",
+      defaultValue = "30s",
+      type = ConfigType.TIME,
+      tags = {ConfigTag.OM, ConfigTag.UPGRADE},
+      description = "Maximum time to wait for a slow follower to be finalized" 
+
+          " through a Ratis snapshot. This is an advanced config, and needs " +
+          "to be changed only under a special circumstance when the leader OM" 
+
+          " has purged the finalize request from its logs, and a follower OM " 
+
+          "was down during upgrade finalization. Default is 30s."
+  )
+  private long ratisBasedFinalizationTimeout = 
Duration.ofSeconds(30).getSeconds();
+
+  public long getRatisBasedFinalizationTimeout() {
+    return ratisBasedFinalizationTimeout;
+  }
+
   public boolean isFileSystemPathEnabled() {
     return fileSystemPathEnabled;
   }
diff --git 
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OmUpgradeConfig.java
 
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OmUpgradeConfig.java
deleted file mode 100644
index b96bf2982e..0000000000
--- 
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OmUpgradeConfig.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hadoop.ozone.om;
-
-import java.time.Duration;
-import org.apache.hadoop.hdds.conf.Config;
-import org.apache.hadoop.hdds.conf.ConfigGroup;
-import org.apache.hadoop.hdds.conf.ConfigTag;
-import org.apache.hadoop.hdds.conf.ConfigType;
-
-/**
- * Class to track upgrade related OM configs.
- */
-@ConfigGroup(prefix = "ozone.om")
-public class OmUpgradeConfig {
-
-  @Config(key = "upgrade.finalization.ratis.based.timeout",
-      defaultValue = "30s",
-      type = ConfigType.TIME,
-      tags = {ConfigTag.OM, ConfigTag.UPGRADE},
-      description = "Maximum time to wait for a slow follower to be finalized" 
+
-          " through a Ratis snapshot. This is an advanced config, and needs " +
-          "to be changed only under a special circumstance when the leader OM" 
+
-          " has purged the finalize request from its logs, and a follower OM " 
+
-          "was down during upgrade finalization. Default is 30s."
-  )
-  private long ratisBasedFinalizationTimeout =
-      Duration.ofSeconds(30).getSeconds();
-
-  public long getRatisBasedFinalizationTimeout() {
-    return ratisBasedFinalizationTimeout;
-  }
-
-  public void setRatisBasedFinalizationTimeout(long timeout) {
-    this.ratisBasedFinalizationTimeout = timeout;
-  }
-}
diff --git 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
index d265e6dfd8..51db6a5f3a 100644
--- 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
+++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
@@ -983,10 +983,9 @@ private void instantiateServices(boolean withNewSnapshot) 
throws IOException {
         LOG.info("New OM snapshot received with higher layout version {}. " +
             "Attempting to finalize current OM to that version.",
             layoutVersionInDB);
-        OmUpgradeConfig uConf = configuration.getObject(OmUpgradeConfig.class);
         upgradeFinalizer.finalizeAndWaitForCompletion(
             "om-ratis-snapshot", this,
-            uConf.getRatisBasedFinalizationTimeout());
+            config.getRatisBasedFinalizationTimeout());
         if (versionManager.getMetadataLayoutVersion() < layoutVersionInDB) {
           throw new IOException("Unable to finalize OM to the desired layout " 
+
               "version " + layoutVersionInDB + " present in the snapshot DB.");


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to