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) {
|
if(needReloadImage) {
|
||||||
LOG.info("Loading image with txid " + sig.mostRecentCheckpointTxId);
|
LOG.info("Loading image with txid " + sig.mostRecentCheckpointTxId);
|
||||||
File file = bnStorage.findImageFile(NameNodeFile.IMAGE,
|
backupNode.namesystem.writeLock();
|
||||||
sig.mostRecentCheckpointTxId);
|
try {
|
||||||
bnImage.reloadFromImageFile(file, backupNode.getNamesystem());
|
File file = bnStorage.findImageFile(NameNodeFile.IMAGE,
|
||||||
|
sig.mostRecentCheckpointTxId);
|
||||||
|
bnImage.reloadFromImageFile(file, backupNode.getNamesystem());
|
||||||
|
} finally {
|
||||||
|
backupNode.namesystem.writeUnlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rollForwardByApplyingLogs(manifest, bnImage, backupNode.getNamesystem());
|
rollForwardByApplyingLogs(manifest, bnImage, backupNode.getNamesystem());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user