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 { try {
initializeGenericKeys(conf, nsId, namenodeId); initializeGenericKeys(conf, nsId, namenodeId);
initialize(getConf()); initialize(getConf());
state.prepareToEnterState(haContext);
try { try {
haContext.writeLock(); haContext.writeLock();
state.prepareToEnterState(haContext);
state.enterState(haContext); state.enterState(haContext);
} finally { } finally {
haContext.writeUnlock(); haContext.writeUnlock();