/** * Check if a server is known to be dead. A server can be online, * or known to be dead, or unknown to this manager (i.e, not online, * not known to be dead either. it is simply not tracked by the * master any more, for example, a very old previous instance). */ public synchronized boolean isServerDead(ServerName serverName) { return serverName == null || deadservers.isDeadServer(serverName); }
/** * If this server is on the dead list, reject it with a YouAreDeadException. * If it was dead but came back with a new start code, remove the old entry * from the dead list. * @param what START or REPORT */ private void checkIsDead(final ServerName serverName, final String what) throws YouAreDeadException { if (this.deadservers.isDeadServer(serverName)) { // host name, port and start code all match with existing one of the // dead servers. So, this server must be dead. String message = "Server " + what + " rejected; currently processing " + serverName + " as dead server"; LOG.debug(message); throw new YouAreDeadException(message); } // remove dead server with same hostname and port of newly checking in rs after master // initialization.See HBASE-5916 for more information. if ((this.master == null || this.master.isInitialized()) && this.deadservers.cleanPreviousInstance(serverName)) { // This server has now become alive after we marked it as dead. // We removed it's previous entry from the dead list to reflect it. LOG.debug(what + ":" + " Server " + serverName + " came back up," + " removed it from the dead servers list"); } }
private void waitForRSShutdownToStartAndFinish(JVMClusterUtil.MasterThread activeMaster, ServerName serverName) throws InterruptedException { ServerManager sm = activeMaster.getMaster().getServerManager(); // First wait for it to be in dead list while (!sm.getDeadServers().isDeadServer(serverName)) { LOG.debug("Waiting for [" + serverName + "] to be listed as dead in master"); Thread.sleep(SLEEP_TIME); } LOG.debug("Server [" + serverName + "] marked as dead, waiting for it to " + "finish dead processing"); while (sm.areDeadServersInProgress()) { LOG.debug("Server [" + serverName + "] still being processed, waiting"); Thread.sleep(SLEEP_TIME); } LOG.debug("Server [" + serverName + "] done with server shutdown processing"); } }
if (this.deadservers.isDeadServer(serverName)) { LOG.warn("Expiration called on {} but crash processing already in progress", serverName); return false;
private void waitForRSShutdownToStartAndFinish(MasterThread activeMaster, ServerName serverName) throws InterruptedException { ServerManager sm = activeMaster.getMaster().getServerManager(); // First wait for it to be in dead list while (!sm.getDeadServers().isDeadServer(serverName)) { log("Waiting for [" + serverName + "] to be listed as dead in master"); Thread.sleep(1); } log("Server [" + serverName + "] marked as dead, waiting for it to " + "finish dead processing"); while (sm.areDeadServersInProgress()) { log("Server [" + serverName + "] still being processed, waiting"); Thread.sleep(100); } log("Server [" + serverName + "] done with server shutdown processing"); }
assertFalse(ds.cleanPreviousInstance(deadServer)); ds.add(deadServer); assertTrue(ds.isDeadServer(deadServer)); Set<ServerName> deadServerNames = ds.copyServerNames(); for (ServerName eachDeadServer : deadServerNames) { ServerName.valueOf("127.0.0.1", 9090, 223341L); assertTrue(ds.cleanPreviousInstance(deadServerHostComingAlive)); assertFalse(ds.isDeadServer(deadServer)); assertFalse(ds.cleanPreviousInstance(deadServerHostComingAlive));
/** * Check if a server is known to be dead. A server can be online, * or known to be dead, or unknown to this manager (i.e, not online, * not known to be dead either. it is simply not tracked by the * master any more, for example, a very old previous instance). */ public synchronized boolean isServerDead(ServerName serverName) { return serverName == null || deadservers.isDeadServer(serverName) || queuedDeadServers.contains(serverName) || requeuedDeadServers.containsKey(serverName); }
/** * @param serverName Server name * @return true if server is dead */ public boolean isDeadServer(final String serverName) { return isDeadServer(new ServerName(serverName)); }
/** * If this server is on the dead list, reject it with a YouAreDeadException. * If it was dead but came back with a new start code, remove the old entry * from the dead list. * @param serverName * @param what START or REPORT * @throws YouAreDeadException */ private void checkIsDead(final ServerName serverName, final String what) throws YouAreDeadException { if (this.deadservers.isDeadServer(serverName)) { // host name, port and start code all match with existing one of the // dead servers. So, this server must be dead. String message = "Server " + what + " rejected; currently processing " + serverName + " as dead server"; LOG.debug(message); throw new YouAreDeadException(message); } // remove dead server with same hostname and port of newly checking in rs after master // initialization.See HBASE-5916 for more information. if ((this.services == null || ((HMaster) this.services).isInitialized()) && this.deadservers.cleanPreviousInstance(serverName)) { // This server has now become alive after we marked it as dead. // We removed it's previous entry from the dead list to reflect it. LOG.debug(what + ":" + " Server " + serverName + " came back up," + " removed it from the dead servers list"); } }
/** * If this server is on the dead list, reject it with a YouAreDeadException. * If it was dead but came back with a new start code, remove the old entry * from the dead list. * @param serverName * @param what START or REPORT * @throws org.apache.hadoop.hbase.YouAreDeadException */ private void checkIsDead(final ServerName serverName, final String what) throws YouAreDeadException { if (this.deadservers.isDeadServer(serverName)) { // host name, port and start code all match with existing one of the // dead servers. So, this server must be dead. String message = "Server " + what + " rejected; currently processing " + serverName + " as dead server"; LOG.debug(message); throw new YouAreDeadException(message); } // remove dead server with same hostname and port of newly checking in rs after master // initialization.See HBASE-5916 for more information. if ((this.services == null || ((HMaster) this.services).isInitialized()) && this.deadservers.cleanPreviousInstance(serverName)) { // This server has now become alive after we marked it as dead. // We removed it's previous entry from the dead list to reflect it. LOG.debug(what + ":" + " Server " + serverName + " came back up," + " removed it from the dead servers list"); } }
while (retryCounter.shouldRetry()) { synchronized (this.onlineServers) { if (this.deadservers.isDeadServer(server)) { return false;
private void waitForRSShutdownToStartAndFinish(MasterThread activeMaster, ServerName serverName) throws InterruptedException { ServerManager sm = activeMaster.getMaster().getServerManager(); // First wait for it to be in dead list while (!sm.getDeadServers().isDeadServer(serverName)) { log("Waiting for [" + serverName + "] to be listed as dead in master"); Thread.sleep(1); } log("Server [" + serverName + "] marked as dead, waiting for it to " + "finish dead processing"); while (sm.areDeadServersInProgress()) { log("Server [" + serverName + "] still being processed, waiting"); Thread.sleep(100); } log("Server [" + serverName + "] done with server shutdown processing"); }
return; if (this.deadservers.isDeadServer(serverName)) {
assertFalse(ds.cleanPreviousInstance(deadServer)); ds.add(deadServer); assertTrue(ds.isDeadServer(deadServer)); Set<ServerName> deadServerNames = ds.copyServerNames(); for (ServerName eachDeadServer : deadServerNames) { ServerName.valueOf("127.0.0.1", 9090, 223341L); assertTrue(ds.cleanPreviousInstance(deadServerHostComingAlive)); assertFalse(ds.isDeadServer(deadServer)); assertFalse(ds.cleanPreviousInstance(deadServerHostComingAlive));