Pārlūkot izejas kodu

HDFS-14456:HAState#prepareToEnterState neednt a lock (#770) Contributed by hunshenshi.

hunshenshi 6 gadi atpakaļ
vecāks
revīzija
a38b9e137e

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java

@@ -982,9 +982,9 @@ public class NameNode extends ReconfigurableBase implements
     try {
       initializeGenericKeys(conf, nsId, namenodeId);
       initialize(getConf());
+      state.prepareToEnterState(haContext);
       try {
         haContext.writeLock();
-        state.prepareToEnterState(haContext);
         state.enterState(haContext);
       } finally {
         haContext.writeUnlock();