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 ecd2de095e HDDS-12409. Log an error before increasing the sequence id 
of a CLOSED container in SCM (#7964)
ecd2de095e is described below

commit ecd2de095ef4de1d50ab069bdd500992f5df1056
Author: Siddhant Sangwan <[email protected]>
AuthorDate: Fri Mar 7 14:55:56 2025 +0530

    HDDS-12409. Log an error before increasing the sequence id of a CLOSED 
container in SCM (#7964)
---
 .../hdds/scm/container/AbstractContainerReportHandler.java       | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java
 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java
index aeb96cbf31..90361dbc97 100644
--- 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java
+++ 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java
@@ -18,6 +18,7 @@
 package org.apache.hadoop.hdds.scm.container;
 
 import com.google.common.base.Preconditions;
+import com.google.protobuf.TextFormat;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -132,6 +133,14 @@ private void updateContainerStats(final DatanodeDetails 
datanodeDetails,
                                     final ContainerInfo containerInfo,
                                     final ContainerReplicaProto replicaProto)
       throws ContainerNotFoundException {
+    if (containerInfo.getState() == HddsProtos.LifeCycleState.CLOSED && 
containerInfo.getSequenceId() <
+        replicaProto.getBlockCommitSequenceId()) {
+      logger.error(
+          "There is a CLOSED container with lower sequence ID than a replica. 
Container: {}, Container's " +
+              "sequence ID: {}, Replica: {}, Replica's sequence ID: {}, 
Datanode: {}.", containerInfo,
+          containerInfo.getSequenceId(), 
TextFormat.shortDebugString(replicaProto),
+          replicaProto.getBlockCommitSequenceId(), datanodeDetails);
+    }
 
     if (isHealthy(replicaProto::getState)) {
       if (containerInfo.getSequenceId() <


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

Reply via email to