Skip to content

Commit 033a3d7

Browse files
committed
HDFS-15111. stopStandbyServices() should log which service state it is transitioning from. Contributed by Xieming Li.
1 parent 2096304 commit 033a3d7

File tree

1 file changed

+3
-1
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode

1 file changed

+3
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_STORAGE_POLICY_ENABLED_KEY;
9898
import static org.apache.hadoop.hdfs.server.namenode.FSDirStatAndListingOp.*;
9999
import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.ACTIVE;
100+
import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.STANDBY;
100101
import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.OBSERVER;
101102

102103
import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicyInfo;
@@ -1495,7 +1496,8 @@ void prepareToStopStandbyServices() throws ServiceFailedException {
14951496

14961497
/** Stop services required in standby state */
14971498
void stopStandbyServices() throws IOException {
1498-
LOG.info("Stopping services started for standby state");
1499+
HAServiceState curState = getState() == OBSERVER? OBSERVER : STANDBY;
1500+
LOG.info("Stopping services started for {} state", curState);
14991501
if (standbyCheckpointer != null) {
15001502
standbyCheckpointer.stop();
15011503
}

0 commit comments

Comments
 (0)