From 4ed0aefe9fd3c79546d39e10ec81a142fa7b80ac Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Wed, 18 Sep 2019 16:47:46 -0700 Subject: [PATCH] HDFS-14822. [SBN read] Revisit GlobalStateIdContext locking when getting server state id. Contributed by Chen Liang. --- .../hadoop/hdfs/server/namenode/GlobalStateIdContext.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/GlobalStateIdContext.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/GlobalStateIdContext.java index 3986a09449..7d613594ef 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 @@ -165,7 +165,9 @@ public long receiveRequestState(RpcRequestHeaderProto header, @Override public long getLastSeenStateId() { - return namesystem.getFSImage().getCorrectLastAppliedOrWrittenTxId(); + // Should not need to call getCorrectLastAppliedOrWrittenTxId() + // see HDFS-14822. + return namesystem.getFSImage().getLastAppliedOrWrittenTxId(); } @Override