huginn created HBASE-30389:
------------------------------
Summary: Normalize region locations when loading state after
master failover
Key: HBASE-30389
URL: https://issues.apache.org/jira/browse/HBASE-30389
Project: HBase
Issue Type: Bug
Components: master
Affects Versions: 2.4.11
Reporter: huginn
Assignee: huginn
h2. What happens
After an active master failover, a region in a non-online state can retain an
old region server in the new master's in-memory region location.
h2. When it happens
This can occur when the active master rebuilds assignment state from hbase:meta
and the row still contains stale location columns for a region whose persisted
state is not one of OPEN, OPENING, CLOSING, SPLITTING, or MERGING.
h2. Impact
The new master can expose stale region ownership that is inconsistent with its
per-server assignment state, which can affect assignment-related decisions and
status reporting.
h2. Root cause
AssignmentManager.RegionMetaLoadingVisitor.visitRegionState unconditionally
copies the location read from hbase:meta into RegionStateNode, but only
current-host states are added to a ServerStateNode. For CLOSED and other
non-online states, a stale location can therefore remain in memory even though
the region is not assigned to that server.
See [AssignmentManager.java on community
master|https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java#L1865-L1889].
h2. Proposed fix
Normalize the loaded location to null for states that do not have current-host
semantics, while preserving lastHost for locality and recovery. Keep locations
for online and transitioning states unchanged, and add regression coverage for
master failover and state loading.
h2. Reproduction / Testing
Testing evidence will be added by the reporter.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)