diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/StaleNodeHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/StaleNodeHandler.java index 4055449e7b8..93630f04200 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/StaleNodeHandler.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/StaleNodeHandler.java @@ -56,6 +56,8 @@ public class StaleNodeHandler implements EventHandler { EventPublisher publisher) { Set pipelineIds = nodeManager.getPipelines(datanodeDetails); + LOG.info("Datanode {} moved to stale state. Finalizing its pipelines {}", + datanodeDetails, pipelineIds); for (PipelineID pipelineID : pipelineIds) { try { Pipeline pipeline = pipelineManager.getPipeline(pipelineID); diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineActionHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineActionHandler.java index c467b9e91c3..94f757b5f0a 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineActionHandler.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineActionHandler.java @@ -57,6 +57,8 @@ public class PipelineActionHandler pipelineID = PipelineID. getFromProtobuf(action.getClosePipeline().getPipelineID()); Pipeline pipeline = pipelineManager.getPipeline(pipelineID); + LOG.info("Received pipeline action {} for {} from datanode [}", + action.getAction(), pipeline, report.getDatanodeDetails()); RatisPipelineUtils .finalizeAndDestroyPipeline(pipelineManager, pipeline, ozoneConf, true); diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineReportHandler.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineReportHandler.java index 2d4bae1c7e6..daffe1e611b 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineReportHandler.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineReportHandler.java @@ -84,6 +84,7 @@ public class PipelineReportHandler implements } if (pipeline.getPipelineState() == Pipeline.PipelineState.ALLOCATED) { + LOGGER.info("Pipeline {} reported by {}", pipeline.getId(), dn); pipeline.reportDatanode(dn); if (pipeline.isHealthy()) { // if all the dns have reported, pipeline can be moved to OPEN state @@ -94,6 +95,8 @@ public class PipelineReportHandler implements if (numContainers == 0) { // since all the containers have been closed the pipeline can be // destroyed + LOGGER.info("Destroying pipeline {} as all containers are closed", + pipeline); RatisPipelineUtils.destroyPipeline(pipelineManager, pipeline, conf); } } else { diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateManager.java index be8f391c013..a0ef964fb21 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateManager.java @@ -23,6 +23,8 @@ import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType; import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationFactor; import org.apache.hadoop.hdds.scm.container.ContainerID; import org.apache.hadoop.hdds.scm.pipeline.Pipeline.PipelineState; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.List; @@ -37,6 +39,9 @@ import java.util.NavigableSet; */ class PipelineStateManager { + private static final Logger LOG = + LoggerFactory.getLogger(PipelineStateManager.class); + private final PipelineStateMap pipelineStateMap; PipelineStateManager(Configuration conf) { @@ -45,6 +50,9 @@ class PipelineStateManager { void addPipeline(Pipeline pipeline) throws IOException { pipelineStateMap.addPipeline(pipeline); + if (pipeline.getPipelineState() == PipelineState.OPEN) { + LOG.info("Created pipeline " + pipeline); + } } void addContainerToPipeline(PipelineID pipelineId, ContainerID containerID) @@ -87,7 +95,9 @@ class PipelineStateManager { } Pipeline removePipeline(PipelineID pipelineID) throws IOException { - return pipelineStateMap.removePipeline(pipelineID); + Pipeline pipeline = pipelineStateMap.removePipeline(pipelineID); + LOG.info("Pipeline {} removed from db", pipeline); + return pipeline; } void removeContainerFromPipeline(PipelineID pipelineID, @@ -101,6 +111,7 @@ class PipelineStateManager { if (!pipeline.isClosed()) { pipeline = pipelineStateMap .updatePipelineState(pipelineId, PipelineState.CLOSED); + LOG.info("Pipeline {} moved to CLOSED state", pipeline); } return pipeline; } @@ -113,6 +124,7 @@ class PipelineStateManager { if (pipeline.getPipelineState() == PipelineState.ALLOCATED) { pipeline = pipelineStateMap .updatePipelineState(pipelineId, PipelineState.OPEN); + LOG.info("Pipeline {} moved to OPEN state", pipeline.toString()); } return pipeline; }