HBASE-30303: Fix balancing for regions assigned through RSGroup fallback - #8519
HBASE-30303: Fix balancing for regions assigned through RSGroup fallback#8519Sigma-Ma wants to merge 1 commit into
Conversation
| // server of default group crash, regions move to any other group | ||
| crashRsInGroup(RSGroupInfo.DEFAULT_GROUP); | ||
| assertRegionsInGroup(tableName, FALLBACK_GROUP); | ||
| assertEquals(0, MASTER.balance().getMovesCalculated()); |
There was a problem hiding this comment.
maybe we need trigger balancer once before we check the balance plan,and make sure balancer is doing to generate plan, because the default balance is scheduled
There was a problem hiding this comment.
Thanks, good catch. movesCalculated is also zero when the balancer is skipped, so the previous assertion could pass without balanceCluster actually running.
I updated the test to capture the BalanceResponse from the same balance invocation, assert isBalancerRan() first, and then assert that getMovesCalculated() is zero for both fallback cases.
|
please confirm all UT test passed @Sigma-Ma |
3c336d0 to
7dbbeec
Compare
I ran the unit test suite with: 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
mvn \
-pl hbase-server \
-am \
-P runAllTests \
testThe HBASE-30303 related tests passed, but the full run encountered one unrelated failure: TestExecutorService hit an existing synchronization race under high system load. I also reproduced the TestExecutorService failure in isolation. |
JIRA: https://issues.apache.org/jira/browse/HBASE-30303
What changes were proposed in this pull request?
This pull request updates
RSGroupBasedLoadBalancer#correctAssignmentsto use the same candidate-server selection logic as region assignment when RSGroup fallback is enabled.When the target RSGroup has no online RegionServers,
correctAssignmentsnow validates region locations against the effective fallback candidates.The existing
TestRSGroupsFallbacktest 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,
correctAssignmentsonly 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:
TestRSGroupsFallbackverifies that balancing calculates no moves after regions fall back to the default RSGroup and after they fall back to another available RSGroup.