HDFS-14886. In NameNode Web UI's Startup Progress page, Loading edits always shows 0 sec. Contributed by hemanthboyina.
(cherry picked from commit 336abbd8737f3dff38f7bdad9721511c711c522b)
This commit is contained in:
parent
626a48d472
commit
a47680a3f9
@ -755,8 +755,10 @@ LayoutVersion.Feature.TXID_BASED_LAYOUT, getLayoutVersion())) {
|
|||||||
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 {
|
||||||
@ -888,8 +890,6 @@ public long loadEdits(Iterable<EditLogInputStream> editStreams,
|
|||||||
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;
|
||||||
@ -928,7 +928,6 @@ public long loadEdits(Iterable<EditLogInputStream> editStreams,
|
|||||||
} finally {
|
} finally {
|
||||||
FSEditLog.closeAllStreams(editStreams);
|
FSEditLog.closeAllStreams(editStreams);
|
||||||
}
|
}
|
||||||
prog.endPhase(Phase.LOADING_EDITS);
|
|
||||||
return lastAppliedTxId - prevLastAppliedTxId;
|
return lastAppliedTxId - prevLastAppliedTxId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user