HBASE-10333 Assignments are not retained on a cluster start
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1558963 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5f3e90573d
commit
c661d926c0
|
@ -633,17 +633,19 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||
}
|
||||
// Put it back in transition so that SSH can re-assign it
|
||||
regionStates.updateRegionState(regionInfo, State.OFFLINE, sn);
|
||||
// No mater the previous server is online or offline,
|
||||
// we need to reset the last region server of the region.
|
||||
regionStates.setLastRegionServerOfRegion(sn, encodedName);
|
||||
|
||||
if (regionInfo.isMetaRegion()) {
|
||||
// If it's meta region, reset the meta location.
|
||||
// So that master knows the right meta region server.
|
||||
MetaRegionTracker.setMetaLocation(watcher, sn);
|
||||
}
|
||||
// Make sure we know the server is dead.
|
||||
if (!serverManager.isServerDead(sn)) {
|
||||
serverManager.expireServer(sn);
|
||||
} else {
|
||||
// No matter the previous server is online or offline,
|
||||
// we need to reset the last region server of the region.
|
||||
regionStates.setLastRegionServerOfRegion(sn, encodedName);
|
||||
// Make sure we know the server is dead.
|
||||
if (!serverManager.isServerDead(sn)) {
|
||||
serverManager.expireServer(sn);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -999,14 +999,21 @@ MasterServices, Server {
|
|||
assigned++;
|
||||
if (!rit) {
|
||||
// Assign meta since not already in transition
|
||||
if (!serverManager.isServerDead(currentMetaServer)) {
|
||||
LOG.info("Forcing expire of " + currentMetaServer);
|
||||
serverManager.expireServer(currentMetaServer);
|
||||
if (currentMetaServer != null) {
|
||||
// If the meta server is not known to be dead or online,
|
||||
// just split the meta log, and don't expire it since this
|
||||
// could be a full cluster restart. Otherwise, we will think
|
||||
// this is a failover and lose previous region locations.
|
||||
// If it is really a failover case, AM will find out in rebuilding
|
||||
// user regions. Otherwise, we are good since all logs are split
|
||||
// or known to be replayed before user regions are assigned.
|
||||
if (serverManager.isServerOnline(currentMetaServer)) {
|
||||
LOG.info("Forcing expire of " + currentMetaServer);
|
||||
serverManager.expireServer(currentMetaServer);
|
||||
}
|
||||
splitMetaLogBeforeAssignment(currentMetaServer);
|
||||
previouslyFailedMetaRSs.add(currentMetaServer);
|
||||
}
|
||||
// Make sure following meta assignment happens
|
||||
assignmentManager.getRegionStates().clearLastAssignment(HRegionInfo.FIRST_META_REGIONINFO);
|
||||
assignmentManager.assignMeta();
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue