HDFS-16244.Add the necessary write lock in Checkpointer#doCheckpoint(). (#3497)
This commit is contained in:
parent
8c271caa81
commit
ff24fe6197
@ -244,9 +244,14 @@ void doCheckpoint() throws IOException {
|
||||
|
||||
if(needReloadImage) {
|
||||
LOG.info("Loading image with txid " + sig.mostRecentCheckpointTxId);
|
||||
backupNode.namesystem.writeLock();
|
||||
try {
|
||||
File file = bnStorage.findImageFile(NameNodeFile.IMAGE,
|
||||
sig.mostRecentCheckpointTxId);
|
||||
bnImage.reloadFromImageFile(file, backupNode.getNamesystem());
|
||||
} finally {
|
||||
backupNode.namesystem.writeUnlock();
|
||||
}
|
||||
}
|
||||
rollForwardByApplyingLogs(manifest, bnImage, backupNode.getNamesystem());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user