diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GlobalStateIdContext.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GlobalStateIdContext.java index 0da8995cd4b..932074857b5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GlobalStateIdContext.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GlobalStateIdContext.java @@ -124,9 +124,11 @@ class GlobalStateIdContext implements AlignmentContext { @Override public long receiveRequestState(RpcRequestHeaderProto header, long clientWaitTime) throws RetriableException { - long serverStateId = - namesystem.getFSImage().getCorrectLastAppliedOrWrittenTxId(); + long serverStateId = getLastSeenStateId(); long clientStateId = header.getStateId(); + FSNamesystem.LOG.trace("Client State ID= {} and Server State ID= {}", + clientStateId, serverStateId); + if (clientStateId > serverStateId && HAServiceState.ACTIVE.equals(namesystem.getState())) { FSNamesystem.LOG.warn("A client sent stateId: " + clientStateId +