HDFS-7894. Rolling upgrade readiness is not updated in jmx until query command is issued. Contributed by Brahma Reddy Battula.

(cherry picked from commit 6f622672b6)

(cherry picked from commit 802a5775f3)
(cherry picked from commit 995382c5234ad6c07f327e5d1f2a1c7e391a0b60)
This commit is contained in:
Kihwal Lee 2015-05-08 09:32:07 -05:00 committed by Vinod Kumar Vavilapalli
parent 08006b84f8
commit bbed4e67a9
2 changed files with 24 additions and 2 deletions

View File

@ -132,6 +132,9 @@ Release 2.6.1 - UNRELEASED
HDFS-8219. setStoragePolicy with folder behavior is different after cluster restart.
(surendra singh lilhore via Xiaoyu Yao)
HDFS-7894. Rolling upgrade readiness is not updated in jmx until query
command is issued. (Brahma Reddy Battula via kihwal)
Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES

View File

@ -8417,11 +8417,30 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
@Override // NameNodeMXBean
public RollingUpgradeInfo.Bean getRollingUpgradeStatus() {
if (!isRollingUpgrade()) {
return null;
}
RollingUpgradeInfo upgradeInfo = getRollingUpgradeInfo();
if (upgradeInfo != null) {
if (upgradeInfo.createdRollbackImages()) {
return new RollingUpgradeInfo.Bean(upgradeInfo);
}
return null;
readLock();
try {
// check again after acquiring the read lock.
upgradeInfo = getRollingUpgradeInfo();
if (upgradeInfo == null) {
return null;
}
if (!upgradeInfo.createdRollbackImages()) {
boolean hasRollbackImage = this.getFSImage().hasRollbackFSImage();
upgradeInfo.setCreatedRollbackImages(hasRollbackImage);
}
} catch (IOException ioe) {
LOG.warn("Encountered exception setting Rollback Image", ioe);
} finally {
readUnlock();
}
return new RollingUpgradeInfo.Bean(upgradeInfo);
}
/** Is rolling upgrade in progress? */