Skip to content

HBASE-30389 Fix regionLocation inconsistency when switching master - #8668

Open
Huginn-kio wants to merge 1 commit into
apache:masterfrom
Huginn-kio:HBASE-30389
Open

Huginn-kio wants to merge 1 commit into
apache:masterfrom
Huginn-kio:HBASE-30389

Conversation

@Huginn-kio

Copy link
Copy Markdown
Contributor

HBASE-30389

Summary

Normalize stale region locations while the active master rebuilds assignment state from
hbase:meta after failover.

Root cause

AssignmentManager.RegionMetaLoadingVisitor.visitRegionState copies the region server location
from hbase:meta into RegionStateNode, while only states with current-host semantics are added to
the per-server assignment state. A stale location can therefore remain visible for CLOSED or
other non-online regions.

Fix

  • Normalize the loaded location to null for states without current-host semantics.
  • Preserve lastHost for locality and recovery decisions.
  • Add regression coverage for CLOSED, OPEN, and implicit OFFLINE states across master failover,
    plus a split recovery case.

Testing

  • mvn --batch-mode -Dtest=TestAssignmentManagerLoadMetaRegionState,TestMasterAbortWhileSplittingRegion -Dsurefire.rerunFailingTestsCount=0 -Dsurefire.parallel.forcedTimeout=900 -Dsurefire.shutdown=kill -DtrimStackTrace=false -DforkCount=0.5C -am -pl ./hbase-server test
    • 5 tests run, 0 failures, 0 errors.
  • mvn --batch-mode -pl hbase-server -DskipTests apache-rat:check
    • Passed.

Compatibility

  • No public API changes.
  • No configuration, persisted-format, or wire-format changes.

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