Skip to content

HBASE-30323 [RSGroup] Forward-port HBASE-22658 to branch-2 - #8547

Open
Umeshkumar9414 wants to merge 1 commit into
apache:branch-2from
Umeshkumar9414:HBASE-30323
Open

HBASE-30323 [RSGroup] Forward-port HBASE-22658 to branch-2#8547
Umeshkumar9414 wants to merge 1 commit into
apache:branch-2from
Umeshkumar9414:HBASE-30323

Conversation

@Umeshkumar9414

Copy link
Copy Markdown
Contributor

RegionMover.unloadRegions() previously picked destination servers from all online RegionServers regardless of RSGroup membership, potentially trying to move regions out of their assigned group during server decommission, althoug HMaster prevents it.

This is a branch-2-compatible port of HBASE-22740. On master/branch-3 the fix used admin.getRSGroup() which is integrated directly into the Admin interface (via HBASE-22971). On branch-2 RSGroup remains an optional coprocessor (RSGroupAdminEndpoint), so we:

  1. Check for RSGroupAdminEndpoint via getMasterCoprocessorNames() to skip the RSGroup path on clusters that do not use RSGroups.
  2. Call getRSGroupInfoOfServer() via the RSGroupAdminService coprocessor RPC, using the unshaded protobuf service from hbase-protocol.
  3. Filter the destination server list to only servers in the same RSGroup (filterRSGroupServers); filtering is always applied by membership — the DEFAULT_GROUP short-circuit that could leak regions across groups is removed.
  4. Log a DEBUG message when hasRSGroupInfo()==false to aid diagnosis of hostname-vs-IP address-form mismatches (HBASE-27304).

RSGroupAdmin.proto is moved from hbase-rsgroup to hbase-protocol so that hbase-server can use RSGroupAdminService without creating a circular dependency with hbase-rsgroup. Both modules depended on the same generated FQN; consolidating in hbase-protocol (which both already depend on) is best I could think of.

Tests:

  • TestRegionMoverWithRSGroupEnable (hbase-rsgroup): 5-node mini cluster integration test with RSGroupAdminEndpoint enabled. Verifies that unloading a non-default-group server places all regions exclusively on the remaining server in that group (positive assertion) and that no default-group server receives any of those regions (isolation assertion). Also tests the guard path: unloading a default-group server succeeds end-to-end when RSGroups are enabled.
  • TestRegionMoverFilterRSGroupServers (hbase-server): unit tests for filterRSGroupServers() — default group returns full server list, non-default group filters to members only, no-match group returns empty.

RegionMover.unloadRegions() previously picked destination servers from
all online RegionServers regardless of RSGroup membership, potentially
trying to move regions out of their assigned group during server
decommission, althoug HMaster prevents it.

This is a branch-2-compatible port of HBASE-22740. On master/branch-3
the fix used admin.getRSGroup() which is integrated directly into the
Admin interface (via HBASE-22971). On branch-2 RSGroup remains an
optional coprocessor (RSGroupAdminEndpoint), so we:

1. Check for RSGroupAdminEndpoint via getMasterCoprocessorNames() to
   skip the RSGroup path on clusters that do not use RSGroups.
2. Call getRSGroupInfoOfServer() via the RSGroupAdminService coprocessor
   RPC, using the unshaded protobuf service from hbase-protocol.
3. Filter the destination server list to only servers in the same
   RSGroup (filterRSGroupServers); filtering is always applied by
   membership — the DEFAULT_GROUP short-circuit that could leak regions
   across groups is removed.
4. Log a DEBUG message when hasRSGroupInfo()==false to aid diagnosis
   of hostname-vs-IP address-form mismatches (HBASE-27304).

RSGroupAdmin.proto is moved from hbase-rsgroup to hbase-protocol so
that hbase-server can use RSGroupAdminService without creating a
circular dependency with hbase-rsgroup. Both modules depended on the
same generated FQN; consolidating in hbase-protocol (which both
already depend on) is best I could think of.

Tests:
- TestRegionMoverWithRSGroupEnable (hbase-rsgroup): 5-node mini
  cluster integration test with RSGroupAdminEndpoint enabled. Verifies
  that unloading a non-default-group server places all regions
  exclusively on the remaining server in that group (positive assertion)
  and that no default-group server receives any of those regions
  (isolation assertion). Also tests the guard path: unloading a
  default-group server succeeds end-to-end when RSGroups are enabled.
- TestRegionMoverFilterRSGroupServers (hbase-server): unit tests for
  filterRSGroupServers() — default group returns full server list,
  non-default group filters to members only, no-match group returns
  empty.

Co-authored-by: Claude Sonnet 4.6 <claude@anthropic.com>

@sanjeet006py sanjeet006py left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about adding an IT test case for scenario when all servers in test RS group go down and fallback config is enabled (hbase.rsgroup.fallback.enable = true), then regions from test RS group do move to default RS group servers on calling RegionMover.unload().

.map(JVMClusterUtil.RegionServerThread::getRegionServer)
.filter(rs -> rs.getServerName().equals(defaultSN)).findFirst().get();
assertEquals(0, decommRS.getRegions(defaultTable).size(),
"Decommissioned default-group server must hold no regions after unload");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we also please add assertion that default group regions don't land on test RS group servers?


/** A non-default group with one member must return only that member. */
@Test
public void testNonDefaultGroupFiltersToMembers() throws Exception {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add a test case where there is default RS group and some test RS group. And, assertion is that output of filter for default RS group should not have any server of test RS group. Please correct me if my understanding is wrong.

@Umeshkumar9414

Copy link
Copy Markdown
Contributor Author

How about adding an IT test case for scenario when all servers in test RS group go down and fallback config is enabled (hbase.rsgroup.fallback.enable = true), then regions from test RS group do move to default RS group servers on calling RegionMover.unload().

There is already test written for that, 'TestRSGroupsFallback'.

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.

4 participants