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

View File

@ -982,9 +982,9 @@ protected NameNode(Configuration conf, NamenodeRole role)
try {
initializeGenericKeys(conf, nsId, namenodeId);
initialize(getConf());
state.prepareToEnterState(haContext);
try {
haContext.writeLock();
state.prepareToEnterState(haContext);
state.enterState(haContext);
} finally {
haContext.writeUnlock();