HDFS-14886. In NameNode Web UI's Startup Progress page, Loading edits always shows 0 sec. Contributed by hemanthboyina.

This commit is contained in:
Surendra Singh Lilhore 2019-10-14 23:31:43 +05:30
parent fabd41fa48
commit 336abbd873
1 changed files with 2 additions and 3 deletions

View File

@ -757,8 +757,10 @@ public class FSImage implements Closeable {
prog.endPhase(Phase.LOADING_FSIMAGE); prog.endPhase(Phase.LOADING_FSIMAGE);
if (!rollingRollback) { if (!rollingRollback) {
prog.beginPhase(Phase.LOADING_EDITS);
long txnsAdvanced = loadEdits(editStreams, target, Long.MAX_VALUE, long txnsAdvanced = loadEdits(editStreams, target, Long.MAX_VALUE,
startOpt, recovery); startOpt, recovery);
prog.endPhase(Phase.LOADING_EDITS);
needToSave |= needsResaveBasedOnStaleCheckpoint(imageFile.getFile(), needToSave |= needsResaveBasedOnStaleCheckpoint(imageFile.getFile(),
txnsAdvanced); txnsAdvanced);
} else { } else {
@ -890,8 +892,6 @@ public class FSImage implements Closeable {
StartupOption startOpt, MetaRecoveryContext recovery) StartupOption startOpt, MetaRecoveryContext recovery)
throws IOException { throws IOException {
LOG.debug("About to load edits:\n " + Joiner.on("\n ").join(editStreams)); LOG.debug("About to load edits:\n " + Joiner.on("\n ").join(editStreams));
StartupProgress prog = NameNode.getStartupProgress();
prog.beginPhase(Phase.LOADING_EDITS);
long prevLastAppliedTxId = lastAppliedTxId; long prevLastAppliedTxId = lastAppliedTxId;
long remainingReadTxns = maxTxnsToRead; long remainingReadTxns = maxTxnsToRead;
@ -930,7 +930,6 @@ public class FSImage implements Closeable {
} finally { } finally {
FSEditLog.closeAllStreams(editStreams); FSEditLog.closeAllStreams(editStreams);
} }
prog.endPhase(Phase.LOADING_EDITS);
return lastAppliedTxId - prevLastAppliedTxId; return lastAppliedTxId - prevLastAppliedTxId;
} }