HBASE-6587 Region would be assigned twice in the case of all RS offline (Chunhui)
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1373829 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c3d1bb07f8
commit
4d512d9019
@ -2811,11 +2811,19 @@ public class AssignmentManager extends ZooKeeperListener {
|
|||||||
// no lock concurrent access ok: we will be working on a copy, and it's java-valid to do
|
// no lock concurrent access ok: we will be working on a copy, and it's java-valid to do
|
||||||
// a copy while another thread is adding/removing items
|
// a copy while another thread is adding/removing items
|
||||||
for (RegionState regionState : regionStates.getRegionsInTransition().values()) {
|
for (RegionState regionState : regionStates.getRegionsInTransition().values()) {
|
||||||
if (regionState.getStamp() + timeout <= now ||
|
if (regionState.getStamp() + timeout <= now) {
|
||||||
(this.allRegionServersOffline && !noRSAvailable)) {
|
// decide on action upon timeout
|
||||||
//decide on action upon timeout or, if some RSs just came back online, we can start the
|
|
||||||
// the assignment
|
|
||||||
actOnTimeOut(regionState);
|
actOnTimeOut(regionState);
|
||||||
|
} else if (this.allRegionServersOffline && !noRSAvailable) {
|
||||||
|
RegionPlan existingPlan = regionPlans.get(regionState.getRegion()
|
||||||
|
.getEncodedName());
|
||||||
|
if (existingPlan == null
|
||||||
|
|| !this.serverManager.isServerOnline(existingPlan
|
||||||
|
.getDestination())) {
|
||||||
|
// if some RSs just came back online, we can start the assignment
|
||||||
|
// right away
|
||||||
|
actOnTimeOut(regionState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setAllRegionServersOffline(noRSAvailable);
|
setAllRegionServersOffline(noRSAvailable);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user