svn merge -c 1603239 merging from trunk to branch-2 to fix:HDFS-6545. Finalizing rolling upgrade can make NN unavailable for a long duration.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1603241 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kihwal Lee 2014-06-17 18:00:54 +00:00
parent 51dba744bd
commit 97d57ff1f4
2 changed files with 11 additions and 2 deletions

View File

@ -192,6 +192,9 @@ Release 2.5.0 - UNRELEASED
HDFS-6528. Add XAttrs to TestOfflineImageViewer. (Stephen Chu via wang)
HDFS-6545. Finalizing rolling upgrade can make NN unavailable for a long
duration. (kihwal)
OPTIMIZATIONS
HDFS-6214. Webhdfs has poor throughput for files >2GB (daryn)

View File

@ -7638,14 +7638,20 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
returnInfo = finalizeRollingUpgradeInternal(now());
getEditLog().logFinalizeRollingUpgrade(returnInfo.getFinalizeTime());
getFSImage().saveNamespace(this);
if (haEnabled) {
// roll the edit log to make sure the standby NameNode can tail
getFSImage().rollEditLog();
}
getFSImage().renameCheckpoint(NameNodeFile.IMAGE_ROLLBACK,
NameNodeFile.IMAGE);
} finally {
writeUnlock();
}
// getEditLog().logSync() is not needed since it does saveNamespace
if (!haEnabled) {
// Sync not needed for ha since the edit was rolled after logging.
getEditLog().logSync();
}
if (auditLog.isInfoEnabled() && isExternalInvocation()) {
logAuditEvent(true, "finalizeRollingUpgrade", null, null, null);