diff --git a/CHANGES.txt b/CHANGES.txt index eb157ce49d7..b4f15fb078c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -399,6 +399,8 @@ Release 0.90.4 - Unreleased HBASE-4045 [replication] NPE in ReplicationSource when ZK is gone HBASE-4034 HRegionServer should be stopped even if no META regions are hosted by the HRegionServer (Akash Ashok) + HBASE-4033 The shutdown RegionServer could be added to + AssignmentManager.servers again (Jieshan Bean) IMPROVEMENT HBASE-3882 hbase-config.sh needs to be updated so it can auto-detects the diff --git a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java index bde5f485c8d..9b5a0215670 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java +++ b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java @@ -882,9 +882,15 @@ public class AssignmentManager extends ZooKeeperListener { ServerName oldSn = this.regions.get(regionInfo); if (oldSn != null) LOG.warn("Overwriting " + regionInfo.getEncodedName() + " on " + oldSn + " with " + sn); - this.regions.put(regionInfo, sn); - addToServers(sn, regionInfo); - this.regions.notifyAll(); + + if (isServerOnline(sn)) { + this.regions.put(regionInfo, sn); + addToServers(sn, regionInfo); + this.regions.notifyAll(); + } else { + LOG.info("The server is not in online servers, ServerName=" + + sn.getServerName() + ", region=" + regionInfo.getEncodedName()); + } } // Remove plan if one. clearRegionPlan(regionInfo); @@ -2364,4 +2370,11 @@ public class AssignmentManager extends ZooKeeperListener { public void stop() { this.timeoutMonitor.interrupt(); } + + /** + * Check whether the RegionServer is online. + */ + public boolean isServerOnline(ServerName serverName) { + return this.serverManager.isServerOnline(serverName); + } }