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

nanda 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 72a9af46db HDDS-8872. New bootstrapped OM shouldn’t shutdown if ratis 
applies previous transactions (#4918)
72a9af46db is described below

commit 72a9af46dba370124338216cb9d681f2190bf268
Author: Aryan Gupta <[email protected]>
AuthorDate: Thu Jun 22 08:04:32 2023 +0530

    HDDS-8872. New bootstrapped OM shouldn’t shutdown if ratis applies previous 
transactions (#4918)
---
 .../hadoop/ozone/om/TestAddRemoveOzoneManager.java     |  1 -
 .../java/org/apache/hadoop/ozone/om/OzoneManager.java  | 18 +++++++++++-------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
index 83b69eb3f8..66caf3ec98 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
@@ -264,7 +264,6 @@ public class TestAddRemoveOzoneManager {
     newNodeId = "omNode-bootstrap-2";
     try {
       cluster.bootstrapOzoneManager(newNodeId, false, true);
-      Assert.fail();
     } catch (IOException e) {
       Assert.assertTrue(omLog.getOutput().contains("Couldn't add OM " +
           newNodeId + " to peer list."));
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 2843127caf..290bcfec45 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
@@ -1814,9 +1814,10 @@ public final class OzoneManager extends 
ServiceRuntimeInfoImpl
     }
 
     if (remoteOMConfig.getCurrentPeerList().contains(this.getOMNodeId())) {
-      throw new IOException("Remote OM " + remoteNodeId + " already contains " 
+
-          "bootstrapping OM(" + getOMNodeId() + ") as part of its Raft group " 
+
-          "peers.");
+      LOG.warn(
+          "Remote OM {} already contains bootstrapping OM({}) as part of "
+              + "its Raft group peers.",
+          remoteNodeId, getOMNodeId());
     }
 
     OMNodeDetails omNodeDetailsInRemoteConfig = remoteOMConfig
@@ -1959,15 +1960,18 @@ public final class OzoneManager extends 
ServiceRuntimeInfoImpl
 
         if (newOMNodeDetails == null) {
           // If new node information is not present in the newly loaded
-          // configuration also, throw an exception
-          throw new IOException("There is no OM configuration for node ID "
-              + newOMNodeId + " in ozone-site.xml.");
+          // configuration also, throw an exception.
+          // This case can also come when we have decommissioned a node and
+          // ratis will apply previous transactions to add that node back.
+          LOG.error(
+              "There is no OM configuration for node ID {} in ozone-site.xml.",
+              newOMNodeId);
+          return;
         }
       }
     } catch (IOException e) {
       LOG.error("{}: Couldn't add OM {} to peer list.", getOMNodeId(),
           newOMNodeId);
-      exitManager.exitSystem(1, e.getLocalizedMessage(), e, LOG);
     }
 
     if (omRatisSnapshotProvider == null) {


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

Reply via email to