Index: src/main/java/org/apache/hadoop/hbase/master/ServerManager.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/ServerManager.java (revision 1001097) +++ src/main/java/org/apache/hadoop/hbase/master/ServerManager.java (working copy) @@ -84,6 +84,7 @@ private final Server master; private final MasterServices services; + private final boolean freshClusterStartup; private final ServerMonitor serverMonitorThread; @@ -119,10 +120,14 @@ * Constructor. * @param master * @param services + * @param freshClusterStartup True if we are original master on a fresh + * cluster startup else if false, we are joining an already running cluster. */ - public ServerManager(final Server master, final MasterServices services) { + public ServerManager(final Server master, final MasterServices services, + final boolean freshClusterStartup) { this.master = master; this.services = services; + this.freshClusterStartup = freshClusterStartup; Configuration c = master.getConfiguration(); int monitorInterval = c.getInt("hbase.master.monitor.interval", 60 * 1000); this.metrics = new MasterMetrics(master.getServerName()); @@ -249,9 +254,19 @@ // If we don't know this server, tell it shutdown. HServerInfo storedInfo = this.onlineServers.get(info.getServerName()); if (storedInfo == null) { - LOG.warn("Received report from unknown server -- telling it " + - "to " + HMsg.Type.STOP_REGIONSERVER + ": " + info.getServerName()); - return HMsg.STOP_REGIONSERVER_ARRAY; + if (!this.freshClusterStartup) { + // If we are joining an existing cluster, then soon as we come up we'll + // be getting reports from already running regionservers. + // TODO: What if report is a split? It won't succeed. Throw PleaseHoldException? + LOG.info("Registering new server: " + info.getServerName()); + recordNewServer(info); + } else { + // Are we a master joining an existing cluster? If so, as soon as we + // come up we'll start getting regionServerReports + LOG.warn("Received report from unknown server -- telling it " + + "to " + HMsg.Type.STOP_REGIONSERVER + ": " + info.getServerName()); + return HMsg.STOP_REGIONSERVER_ARRAY; + } } // Check startcodes Index: src/main/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/HMaster.java (revision 1001097) +++ src/main/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -241,7 +241,7 @@ this.connection = HConnectionManager.getConnection(conf); this.executorService = new ExecutorService(getServerName()); - this.serverManager = new ServerManager(this, this); + this.serverManager = new ServerManager(this, this, this.freshClusterStartup); this.catalogTracker = new CatalogTracker(this.zooKeeper, this.connection, this, conf.getInt("hbase.master.catalog.timeout", Integer.MAX_VALUE)); @@ -496,9 +496,8 @@ } private static Thread getAndStartBalancerChore(final HMaster master) { - String name = master.getServerName() + "-balancerChore"; - int period = master.getConfiguration(). - getInt("hbase.balancer.period", 3000000); + String name = master.getServerName() + "-BalancerChore"; + int period = master.getConfiguration().getInt("hbase.balancer.period", 300000); // Start up the load balancer chore Chore chore = new Chore(name, period, master) { @Override @@ -566,10 +565,7 @@ return !isStopped(); } - /** - * Run the balancer. - * @return True if balancer ran, false otherwise. - */ + @Override public boolean balance() { // If balance not true, don't run balancer. if (!this.balance) return false; Index: src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java (revision 1001097) +++ src/main/java/org/apache/hadoop/hbase/ipc/HBaseRPCProtocolVersion.java (working copy) @@ -77,7 +77,8 @@ *