HDFS-7894. Rolling upgrade readiness is not updated in jmx until query command is issued. Contributed by Brahma Reddy Battula.
This commit is contained in:
parent
241a72af0d
commit
6f622672b6
|
@ -765,6 +765,9 @@ Release 2.7.1 - UNRELEASED
|
||||||
|
|
||||||
HDFS-8226. Non-HA rollback compatibility broken (J.Andreina via vinayakumarb)
|
HDFS-8226. Non-HA rollback compatibility broken (J.Andreina via vinayakumarb)
|
||||||
|
|
||||||
|
HDFS-7894. Rolling upgrade readiness is not updated in jmx until query
|
||||||
|
command is issued. (Brahma Reddy Battula via kihwal)
|
||||||
|
|
||||||
Release 2.7.0 - 2015-04-20
|
Release 2.7.0 - 2015-04-20
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -7608,11 +7608,30 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
||||||
|
|
||||||
@Override // NameNodeMXBean
|
@Override // NameNodeMXBean
|
||||||
public RollingUpgradeInfo.Bean getRollingUpgradeStatus() {
|
public RollingUpgradeInfo.Bean getRollingUpgradeStatus() {
|
||||||
|
if (!isRollingUpgrade()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
RollingUpgradeInfo upgradeInfo = getRollingUpgradeInfo();
|
RollingUpgradeInfo upgradeInfo = getRollingUpgradeInfo();
|
||||||
if (upgradeInfo != null) {
|
if (upgradeInfo.createdRollbackImages()) {
|
||||||
return new RollingUpgradeInfo.Bean(upgradeInfo);
|
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? */
|
/** Is rolling upgrade in progress? */
|
||||||
|
|
Loading…
Reference in New Issue