hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject hadoop git commit: HDFS-7894. Rolling upgrade readiness is not updated in jmx until query command is issued. Contributed by Brahma Reddy Battula. (cherry picked from commit 6f622672b62aa8d719060063ef0e47480cdc8655)
Date Fri, 08 May 2015 14:33:01 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.7 1b95bf9e1 -> bbb9f6aaf


HDFS-7894. Rolling upgrade readiness is not updated in jmx until query command is issued.
Contributed by Brahma Reddy Battula.
(cherry picked from commit 6f622672b62aa8d719060063ef0e47480cdc8655)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/bbb9f6aa
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/bbb9f6aa
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/bbb9f6aa

Branch: refs/heads/branch-2.7
Commit: bbb9f6aafe3dc41bd6afee67047ee7eb18c0cfe9
Parents: 1b95bf9
Author: Kihwal Lee <kihwal@apache.org>
Authored: Fri May 8 09:32:44 2015 -0500
Committer: Kihwal Lee <kihwal@apache.org>
Committed: Fri May 8 09:32:44 2015 -0500

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt     |  3 +++
 .../hdfs/server/namenode/FSNamesystem.java      | 23 ++++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/bbb9f6aa/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index bdb3032..fee8cdd 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -70,6 +70,9 @@ Release 2.7.1 - UNRELEASED
 
     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
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/bbb9f6aa/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index de504c4..a2648d2 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -7612,11 +7612,30 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
 
   @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? */


Mime
View raw message