HBASE-25621 Balancer should check region plan source to avoid misplace region groups (#3002)
Signed-off-by: stack <stack@duboce.net>
This commit is contained in:
parent
625bea3ecc
commit
0ef892b68a
|
@ -1767,7 +1767,7 @@ public class HMaster extends HRegionServer implements MasterServices {
|
|||
LOG.info("balance " + plan);
|
||||
//TODO: bulk assign
|
||||
try {
|
||||
this.assignmentManager.moveAsync(plan);
|
||||
this.assignmentManager.balance(plan);
|
||||
} catch (HBaseIOException hioe) {
|
||||
//should ignore failed plans here, avoiding the whole balance plans be aborted
|
||||
//later calls of balance() can fetch up the failed and skipped plans
|
||||
|
|
|
@ -732,6 +732,17 @@ public class AssignmentManager {
|
|||
return ProcedureSyncWait.submitProcedure(master.getMasterProcedureExecutor(), proc);
|
||||
}
|
||||
|
||||
public Future<byte[]> balance(RegionPlan regionPlan) throws HBaseIOException {
|
||||
ServerName current =
|
||||
this.getRegionStates().getRegionAssignments().get(regionPlan.getRegionInfo());
|
||||
if (!current.equals(regionPlan.getSource())) {
|
||||
LOG.debug("Skip region plan {}, source server not match, current region location is {}",
|
||||
regionPlan, current);
|
||||
return null;
|
||||
}
|
||||
return moveAsync(regionPlan);
|
||||
}
|
||||
|
||||
// ============================================================================================
|
||||
// RegionTransition procedures helpers
|
||||
// ============================================================================================
|
||||
|
|
Loading…
Reference in New Issue