HBASE-19906 TestZooKeeper Timeout

This commit is contained in:
Michael Stack 2018-01-31 14:02:11 -08:00
parent 4148d7c614
commit 80af9bdef0
2 changed files with 17 additions and 1 deletions

View File

@ -865,6 +865,11 @@ public class HMaster extends HRegionServer implements MasterServices {
// Make sure meta assigned before proceeding.
status.setStatus("Recovering Meta Region");
// Check if master is shutting down because issue initializing regionservers or balancer.
if (isStopped()) {
return;
}
// we recover hbase:meta region servers inside master initialization and
// handle other failed servers in SSH in order to start up master node ASAP
MasterMetaBootstrap metaBootstrap = createMetaBootstrap(this, status);

View File

@ -1895,9 +1895,20 @@ public class AssignmentManager implements ServerListener {
.getRegionInfoForReplica(RegionInfoBuilder.FIRST_META_REGIONINFO,
RegionInfo.DEFAULT_REPLICA_ID);
RegionState regionStateNode = getRegionStates().getRegionState(hri);
if (!regionStateNode.getServerName().equals(serverName)) {
if (regionStateNode == null) {
LOG.warn("RegionStateNode is null for " + hri);
return;
}
ServerName rsnServerName = regionStateNode.getServerName();
if (rsnServerName == null) {
return;
}
if (rsnServerName != null && !rsnServerName.equals(serverName)) {
return;
} else {
LOG.warn("Empty ServerName in RegionStateNode; proceeding regardless in case latched " +
"RecoverMetaProcedure procedure for clean up.");
}
// meta has been assigned to crashed server.
LOG.info("Meta assigned to crashed " + serverName + "; reassigning...");
// Handle failure and wake event