diff --git a/CHANGES.txt b/CHANGES.txt index 6c6c94a2718..458af10993b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -775,6 +775,8 @@ Release 0.90.0 - Unreleased HBASE-3351 ReplicationZookeeper goes to ZK every time a znode is modified HBASE-3326 Replication state's znode should be created else it defaults to false + HBASE-3355 Stopping a stopped cluster leaks an HMaster + HBASE-3356 Add more checks in replication if RS is stopped IMPROVEMENTS diff --git a/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java b/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java index f0f85e2e8e6..c050eb95613 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java +++ b/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java @@ -157,6 +157,9 @@ public class HMasterCommandLine extends ServerCommandLine { private int stopMaster() { HBaseAdmin adm = null; try { + Configuration conf = getConf(); + // Don't try more than once + conf.setInt("hbase.client.retries.number", 1); adm = new HBaseAdmin(getConf()); } catch (MasterNotRunningException e) { LOG.error("Master not running"); diff --git a/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java b/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java index 30c9b4ae84a..893015bfc62 100644 --- a/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java +++ b/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java @@ -612,6 +612,10 @@ public class ReplicationZookeeper { ZKUtil.deleteNodeRecursively(this.zookeeper, this.rsServerNameZnode); } catch (KeeperException e) { + // if the znode is already expired, don't bother going further + if (e instanceof KeeperException.SessionExpiredException) { + return; + } this.abortable.abort("Failed delete of " + this.rsServerNameZnode, e); } } diff --git a/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java b/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java index 3680395cf17..3adb290bb87 100644 --- a/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java +++ b/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java @@ -150,7 +150,7 @@ public class ReplicationSourceManager { for (String id : this.zkHelper.getPeerClusters().keySet()) { addSource(id); } - List currentReplicators = this.zkHelper.getRegisteredRegionServers(); + List currentReplicators = this.zkHelper.getListOfReplicators(); if (currentReplicators == null || currentReplicators.size() == 0) { return; } @@ -406,6 +406,9 @@ public class ReplicationSourceManager { * @param path full path of the deleted node */ public void nodeDeleted(String path) { + if (stopper.isStopped()) { + return; + } boolean cont = refreshRegionServersList(path); if (!cont) { return; @@ -419,6 +422,9 @@ public class ReplicationSourceManager { * @param path full path of the node whose children have changed */ public void nodeChildrenChanged(String path) { + if (stopper.isStopped()) { + return; + } refreshRegionServersList(path); }