Skip to content

HBASE-29006. The region assignment retry logic in unconstrained and may cause workload amplification #6983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: branch-2.6
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -174,6 +174,8 @@ public class AssignmentManager {

public static final int DEFAULT_FORCE_REGION_RETAINMENT_RETRIES = 600;

private static final int MAX_RETRY_LIMIT = 5;

private final ProcedureEvent<?> metaAssignEvent = new ProcedureEvent<>("meta assign");
private final ProcedureEvent<?> metaLoadEvent = new ProcedureEvent<>("meta load");

@@ -186,6 +188,8 @@ public class AssignmentManager {
private final RegionStates regionStates = new RegionStates();
private final RegionStateStore regionStateStore;

private final Map<RegionInfo, Integer> retryCountMap = new HashMap<>();

/**
* When the operator uses this configuration option, any version between the current cluster
* version and the value of "hbase.min.version.move.system.tables" does not trigger any
@@ -2483,7 +2487,21 @@ private void processAssignmentPlans(final HashMap<RegionInfo, RegionStateNode> r
acceptPlan(regions, balancer.retainAssignment(retainMap, servers));
} catch (HBaseIOException e) {
LOG.warn("unable to retain assignment", e);
addToPendingAssignment(regions, retainMap.keySet());

for(RegionInfo hri : retainMap.keySet()) {
int retryCount = retryCountMap.getOrDefault(hri,0) + 1;
retryCountMap.put(hri, retryCount);

if(retryCount > MAX_RETRY_LIMIT) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better add a backoff here? If we go with this PR, the region will be in RIT state forever and only restarting master can trigger the reassign...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, we can consider using backoff to solve the feedback loop as well. Simple blocking may be to harsh on the system.

// Drop the region assignment and log an error
LOG.error("Dropping region " + hri + " after exceeding retry limit " + MAX_RETRY_LIMIT);
retryCountMap.remove(hri);
}
else {
// Add back to pending assignment for retry
addToPendingAssignment(regions, Collections.singleton(hri));
}
}
}
}

@@ -2527,6 +2545,8 @@ private void acceptPlan(final HashMap<RegionInfo, RegionStateNode> regions,
}
} else {
events[evcount++] = regionNode.getProcedureEvent();
// Remove successfully assigned regions from retryCountMap
retryCountMap.remove(hri);
}
}
}