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

This commit is contained in:
hunshenshi 2019-08-17 05:53:06 +08:00 committed by Wei-Chiu Chuang
parent 8943e1340d
commit a38b9e137e
1 changed files with 1 additions and 1 deletions

View File

@ -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();