HBASE-6227 SSH and cluster startup causes data loss
Submitted by:Chunhui Reviewed by:Ram, Ted git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1354634 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ccd5082e53
commit
dc9223f3dd
|
@ -447,6 +447,13 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
// no lock concurrent access ok: some threads may be adding/removing items but its java-valid
|
// no lock concurrent access ok: some threads may be adding/removing items but its java-valid
|
||||||
nodes.removeAll(regionsInTransition.keySet());
|
nodes.removeAll(regionsInTransition.keySet());
|
||||||
|
|
||||||
|
// If some dead servers are processed by ServerShutdownHandler, we shouldn't
|
||||||
|
// assign all user regions( some would be assigned by
|
||||||
|
// ServerShutdownHandler), consider it as a failover
|
||||||
|
if (!this.serverManager.getDeadServers().isEmpty()) {
|
||||||
|
this.failover = true;
|
||||||
|
}
|
||||||
|
|
||||||
// If we found user regions out on cluster, its a failover.
|
// If we found user regions out on cluster, its a failover.
|
||||||
if (this.failover) {
|
if (this.failover) {
|
||||||
LOG.info("Found regions out on cluster or in RIT; failover");
|
LOG.info("Found regions out on cluster or in RIT; failover");
|
||||||
|
@ -2811,6 +2818,9 @@ public class AssignmentManager extends ZooKeeperListener {
|
||||||
// skip regions of dead servers because SSH will process regions during rs expiration.
|
// skip regions of dead servers because SSH will process regions during rs expiration.
|
||||||
// see HBASE-5916
|
// see HBASE-5916
|
||||||
if (actualDeadServers.contains(deadServer.getKey())) {
|
if (actualDeadServers.contains(deadServer.getKey())) {
|
||||||
|
for (Pair<HRegionInfo, Result> deadRegion : deadServer.getValue()) {
|
||||||
|
nodes.remove(deadRegion.getFirst().getEncodedName());
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<Pair<HRegionInfo, Result>> regions = deadServer.getValue();
|
List<Pair<HRegionInfo, Result>> regions = deadServer.getValue();
|
||||||
|
|
Loading…
Reference in New Issue