Skip to content

HBASE-30566 Wait for target RegionServer first report in RegionMover - #8927

Open
jackMintao wants to merge 1 commit into
apache:branch-2.6from
jackMintao:HBASE-30566
Open

jackMintao wants to merge 1 commit into
apache:branch-2.6from
jackMintao:HBASE-30566

Conversation

@jackMintao

Copy link
Copy Markdown

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

Problem

After HBASE-25032, HMaster excludes an online RegionServer from
ServerManager#createDestinationServersList() until
ServerMetrics#getLastReportTimestamp() > 0.

RegionMover#getTargetServer() only waits for the target server to appear
in Admin#getRegionServers(). During graceful_stop.sh --reload, the
target RS is typically listed there before its first RegionServerReport
has been processed. RegionMover therefore starts moving regions while the
target is still ineligible for assignment. The master reopens the region
on the source RS, MoveWithAck waits for the source to change, and after
hbase.move.wait.max (default 60s) the move pool reports
InterruptedException: sleep interrupted (single meta region) or
Could not move region (multiple regions). graceful_stop.sh still prints
Reloaded and exits 0.

Fix

Wait for ServerMetrics#getLastReportTimestamp() > 0 in
RegionMover#getTargetServer() before returning the target, matching the
master's assignment eligibility check. The existing
hbase.serverstart.wait.max timeout is preserved, and a clear error is
raised if the RS never reports.

Only RegionMover.java is changed. graceful_stop.sh is not modified.

Tests

  • TestRegionMover1 (11), TestRegionMover2 (12), TestRegionMover3 (1),
    TestRegionMoverFilterRSGroupServers (3), TestRegionMoverUseIp (1):
    28 tests, 0 failures, 0 errors.
  • Manual reproduction on official HBase 2.6.7-hadoop3 with JDK 11:
    unpatched reload fails after 60s with sleep interrupted; with the fix
    the reload succeeds without a fixed delay.
  • A/B on official HBase 2.4.18 (no HBASE-25032) under the same JDK,
    configuration, startup sequence and script: reload succeeds.

Since HBASE-25032, HMaster excludes region servers that have not sent their first RegionServerReport from createDestinationServersList(). RegionMover.getTargetServer() only waited for the target to appear in Admin#getRegionServers(), so graceful_stop --reload could target an ineligible server, leave the region on the source RS and time out after 60s.

Wait for ServerMetrics#getLastReportTimestamp() > 0 before returning the target server, matching the master's assignment eligibility check.
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.

2 participants