HDFS-15111. stopStandbyServices() should log which service state it is transitioning from. Contributed by Xieming Li.

(cherry picked from commit b182dd809c)
This commit is contained in:
Ayush Saxena 2020-02-27 04:02:26 +05:30 committed by Wei-Chiu Chuang
parent 4924622e6e
commit 7bfa123d58
1 changed files with 3 additions and 1 deletions

View File

@ -94,6 +94,7 @@ import java.util.concurrent.atomic.AtomicLong;
import org.apache.hadoop.hdfs.protocol.HdfsConstants; import org.apache.hadoop.hdfs.protocol.HdfsConstants;
import static org.apache.hadoop.hdfs.server.namenode.FSDirStatAndListingOp.*; 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.ACTIVE;
import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.STANDBY;
import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.OBSERVER; import static org.apache.hadoop.ha.HAServiceProtocol.HAServiceState.OBSERVER;
import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicyInfo; import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicyInfo;
@ -1452,7 +1453,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
/** Stop services required in standby state */ /** Stop services required in standby state */
void stopStandbyServices() throws IOException { 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) { if (standbyCheckpointer != null) {
standbyCheckpointer.stop(); standbyCheckpointer.stop();
} }