From 3d3677932a4ec98c12121c879ac5e2ea71925ea5 Mon Sep 17 00:00:00 2001 From: tedyu Date: Thu, 7 Jan 2016 09:14:00 -0800 Subject: [PATCH] HBASE-15070 DistributedHBaseCluster#restoreRegionServers() starts new RS process on master server (Samir Ahmic) --- .../org/apache/hadoop/hbase/DistributedHBaseCluster.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java index 62f5c66dd3b..6f3baa0aa3b 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java @@ -433,6 +433,8 @@ public class DistributedHBaseCluster extends HBaseCluster { Set toKill = new TreeSet(new ServerNameIgnoreStartCodeComparator()); toStart.addAll(initial.getServers()); toKill.addAll(current.getServers()); + + ServerName master = initial.getMaster(); for (ServerName server : current.getServers()) { toStart.remove(server); @@ -447,7 +449,8 @@ public class DistributedHBaseCluster extends HBaseCluster { try { if (!clusterManager.isRunning(ServiceType.HBASE_REGIONSERVER, sn.getHostname(), - sn.getPort())) { + sn.getPort()) + && master.getPort() != sn.getPort()) { LOG.info("Restoring cluster - starting initial region server: " + sn.getHostAndPort()); startRegionServer(sn.getHostname(), sn.getPort()); } @@ -460,7 +463,8 @@ public class DistributedHBaseCluster extends HBaseCluster { try { if (clusterManager.isRunning(ServiceType.HBASE_REGIONSERVER, sn.getHostname(), - sn.getPort())) { + sn.getPort()) + && master.getPort() != sn.getPort()){ LOG.info("Restoring cluster - stopping initial region server: " + sn.getHostAndPort()); stopRegionServer(sn); }