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 d91186348a9..9ed6736ac73 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 @@ -427,7 +427,7 @@ public class ReplicationSourceManager { * @param path full path of the node whose children have changed */ public void nodeChildrenChanged(String path) { - if (stopper.isStopped()) { + if (stopper == null || stopper.isStopped()) { return; } refreshRegionServersList(path); diff --git a/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java b/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java index 645b8ce0060..2f73df55484 100644 --- a/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java +++ b/src/test/java/org/apache/hadoop/hbase/client/replication/TestReplicationAdmin.java @@ -77,16 +77,16 @@ public class TestReplicationAdmin { // OK! } assertEquals(1, admin.getPeersCount()); - // Add a second, returns illegal since multi-slave isn't supported + // Add a second since multi-slave is supported try { admin.addPeer(ID_SECOND, KEY_SECOND); - fail(); } catch (IllegalStateException iae) { + fail(); // OK! } - assertEquals(1, admin.getPeersCount()); + assertEquals(2, admin.getPeersCount()); // Remove the first peer we added admin.removePeer(ID_ONE); - assertEquals(0, admin.getPeersCount()); + assertEquals(1, admin.getPeersCount()); } }