Skip to content

HBASE-30303: Fix balancing for regions assigned through RSGroup fallback - #8519

Open
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-30303-fix-rsgroup-fallback-balancing
Open

HBASE-30303: Fix balancing for regions assigned through RSGroup fallback#8519
Sigma-Ma wants to merge 1 commit into
apache:masterfrom
Sigma-Ma:HBASE-30303-fix-rsgroup-fallback-balancing

Conversation

@Sigma-Ma

Copy link
Copy Markdown
Contributor

JIRA: https://issues.apache.org/jira/browse/HBASE-30303

What changes were proposed in this pull request?

This pull request updates RSGroupBasedLoadBalancer#correctAssignments to use the same candidate-server selection logic as region assignment when RSGroup fallback is enabled.

When the target RSGroup has no online RegionServers, correctAssignments now validates region locations against the effective fallback candidates.

The existing TestRSGroupsFallback test is also extended to verify that no region moves are calculated when regions are correctly hosted on fallback servers.

Why are the changes needed?

When RSGroup fallback is enabled and a table's target RSGroup has no online RegionServers, its regions are assigned to the default RSGroup, or to any available RegionServer if the default group is also unavailable.

Previously, correctAssignments only validated these regions against the table's original RSGroup. Therefore, regions already hosted on valid fallback servers were incorrectly classified as misplaced during every balance run, resulting in continuous and unnecessary region movement.

How was this patch tested?

The following tests were executed:

mvn -pl hbase-server \
  -am \
  -Dtest=org.apache.hadoop.hbase.rsgroup.TestRSGroupsFallback \
  -Dsurefire.failIfNoSpecifiedTests=false \
  test

mvn -pl hbase-server \
  -am \
  -Dtest=org.apache.hadoop.hbase.master.balancer.TestRSGroupBasedLoadBalancer \
  -Dsurefire.failIfNoSpecifiedTests=false \
  test

TestRSGroupsFallback verifies that balancing calculates no moves after regions fall back to the default RSGroup and after they fall back to another available RSGroup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant