Author: jdcryans
Date: Tue Dec 14 20:28:06 2010
New Revision: 1049251
URL: http://svn.apache.org/viewvc?rev=1049251&view=rev
Log:
HBASE-3355 Stopping a stopped cluster leaks an HMaster
HBASE-3356 Add more checks in replication if RS is stopped
Modified:
hbase/branches/0.90/CHANGES.txt
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
Modified: hbase/branches/0.90/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1049251&r1=1049250&r2=1049251&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Tue Dec 14 20:28:06 2010
@@ -745,6 +745,8 @@ Release 0.90.0 - Unreleased
HBASE-3337 Restore HBCK fix of unassignment and dupe assignment for new
master
HBASE-3332 Regions stuck in transition after RS failure
+ HBASE-3355 Stopping a stopped cluster leaks an HMaster
+ HBASE-3356 Add more checks in replication if RS is stopped
IMPROVEMENTS
Modified:
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
URL:
http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java?rev=1049251&r1=1049250&r2=1049251&view=diff
==============================================================================
---
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
(original)
+++
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java
Tue Dec 14 20:28:06 2010
@@ -157,6 +157,9 @@ public class HMasterCommandLine extends
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");
Modified:
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java
URL:
http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java?rev=1049251&r1=1049250&r2=1049251&view=diff
==============================================================================
---
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java
(original)
+++
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java
Tue Dec 14 20:28:06 2010
@@ -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);
}
}
Modified:
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
URL:
http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java?rev=1049251&r1=1049250&r2=1049251&view=diff
==============================================================================
---
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
(original)
+++
hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
Tue Dec 14 20:28:06 2010
@@ -150,7 +150,7 @@ public class ReplicationSourceManager {
for (String id : this.zkHelper.getPeerClusters().keySet()) {
addSource(id);
}
- List<String> currentReplicators =
this.zkHelper.getRegisteredRegionServers();
+ List<String> 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);
}