From 7bfa123d583d94607600e38bd754e38fbafc64d2 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Thu, 27 Feb 2020 04:02:26 +0530 Subject: [PATCH] HDFS-15111. stopStandbyServices() should log which service state it is transitioning from. Contributed by Xieming Li. (cherry picked from commit b182dd809cf42aed66806901631ad6062ca0820c) --- .../org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 59a380c5c6b..a9ef64f6f70 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -94,6 +94,7 @@ import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.hdfs.protocol.HdfsConstants; import static org.apache.hadoop.hdfs.server.namenode.FSDirStatAndListingOp.*; import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.ACTIVE; +import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.STANDBY; import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.OBSERVER; import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicyInfo; @@ -1452,7 +1453,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, /** Stop services required in standby state */ void stopStandbyServices() throws IOException { - LOG.info("Stopping services started for standby state"); + HAServiceState curState = getState() == OBSERVER? OBSERVER : STANDBY; + LOG.info("Stopping services started for {} state", curState); if (standbyCheckpointer != null) { standbyCheckpointer.stop(); }