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

sumitagrawal 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 734070e274 HDDS-9216. Update log in exception while processing ICR for 
container. (#5226)
734070e274 is described below

commit 734070e274172c32d02c6e73c4a260764da3ea50
Author: ashishkumar50 <[email protected]>
AuthorDate: Thu Aug 31 15:28:29 2023 +0530

    HDDS-9216. Update log in exception while processing ICR for container. 
(#5226)
---
 .../scm/container/IncrementalContainerReportHandler.java    | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/IncrementalContainerReportHandler.java
 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/IncrementalContainerReportHandler.java
index 27582b5840..bb4cee3331 100644
--- 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/IncrementalContainerReportHandler.java
+++ 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/IncrementalContainerReportHandler.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.hdds.protocol.DatanodeDetails;
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos
     .ContainerReplicaProto;
 import org.apache.hadoop.hdds.scm.container.report.ContainerReportValidator;
+import org.apache.hadoop.hdds.scm.exceptions.SCMException;
 import org.apache.hadoop.hdds.scm.ha.SCMContext;
 import org.apache.hadoop.hdds.scm.node.NodeManager;
 import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException;
@@ -33,7 +34,6 @@ import 
org.apache.hadoop.hdds.scm.server.SCMDatanodeHeartbeatDispatcher
 import org.apache.hadoop.hdds.server.events.EventHandler;
 import org.apache.hadoop.hdds.server.events.EventPublisher;
 import 
org.apache.hadoop.ozone.common.statemachine.InvalidStateTransitionException;
-import org.apache.ratis.protocol.exceptions.NotLeaderException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -108,9 +108,14 @@ public class IncrementalContainerReportHandler extends
         } catch (ContainerReplicaNotFoundException e) {
           LOG.warn("Container {} replica not found!",
               replicaProto.getContainerID());
-        } catch (NotLeaderException nle) {
-          LOG.warn("Failed to process " + replicaProto.getState()
-              + " Container " + id + " due to " + nle);
+        } catch (SCMException ex) {
+          if (ex.getResult() == SCMException.ResultCodes.SCM_NOT_LEADER) {
+            LOG.warn("Failed to process {} container {}: {}",
+                replicaProto.getState(), id, ex.getMessage());
+          } else {
+            LOG.error("Exception while processing ICR for container {}",
+                replicaProto.getContainerID(), ex);
+          }
         } catch (IOException | InvalidStateTransitionException |
                  TimeoutException e) {
           LOG.error("Exception while processing ICR for container {}",


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

Reply via email to