Skip to content

HBASE-30335 Seed master flushedSequenceIdByRegion with openSeqNum on region OPEN (branch-2) - #8736

Open
nirdosh0110 wants to merge 1 commit into
apache:branch-2from
nirdosh0110:HBASE-30335-branch-2
Open

nirdosh0110 wants to merge 1 commit into
apache:branch-2from
nirdosh0110:HBASE-30335-branch-2

Conversation

@nirdosh0110

Copy link
Copy Markdown
Contributor

Backport of #8584 to branch-2 (JIRA: HBASE-30335).

Problem

The master's flushedSequenceIdByRegion is only updated by periodic RegionServer heartbeats. Right after a region OPEN the entry is absent or stale, so ServerManager.getLastFlushedSequenceId can return NO_SEQNUM (or an old value) and WALSplitter treats already-durable edits as unflushed. If the source RS of a graceful move crashes before the next heartbeat, SCP produces orphaned recovered.edits, which later block merge/split and leave regions stuck in RIT.

Change

  • ServerManager.reportRegionOpen(regionInfo, openSeqNum) seeds the cache with merge(openSeqNum, Math::max); AssignmentManager calls it on region OPEN.
  • updateLastFlushedSequenceIds now uses atomic compute() instead of get-then-put, so a stale in-flight heartbeat cannot overwrite the OPEN seed with a lower value.

Tests

  • New TestServerManager (seed, monotonicity, concurrent stale-heartbeat race).
  • TestGetLastFlushedSequenceId#testFlushedSequenceIdSeededOnRegionOpen; existing test updated for the new invariant.
  • AbstractTestDLS#makeWAL aligns synthetic WAL seqids with openSeqNum.

Backport notes

  • TestGetLastFlushedSequenceId: kept branch-2's HMaster#getLastSequenceId / MiniHBaseCluster APIs.
  • The master-side TestMaster#testFlushedSequenceIdPersistLoad change is dropped — flushed-seqid persistence does not exist on branch-2.

Verification (local, JDK17, -Dhadoop.profile=3.0)

  • mvn -pl hbase-server test -Dtest=TestServerManager,TestGetLastFlushedSequenceId,TestDLSFSHLog,TestDLSAsyncFSWAL → Tests run: 11, Failures: 0, Errors: 0
  • mvn -pl hbase-server spotless:check → BUILD SUCCESS

…region OPEN

Backport of apache#8584 to branch-2.

- ServerManager.reportRegionOpen(regionInfo, openSeqNum) seeds the master's
  flushed-sequence cache via merge(openSeqNum, Math::max); called from
  AssignmentManager on region OPEN.
- updateLastFlushedSequenceIds now uses atomic compute() so a stale in-flight
  heartbeat cannot clobber the OPEN seed with a lower value.
- Tests: new TestServerManager; TestGetLastFlushedSequenceId covers the OPEN
  seed; AbstractTestDLS#makeWAL respects the openSeqNum invariant.

The TestMaster#testFlushedSequenceIdPersistLoad change from master is not
applicable: flushed sequence id persistence does not exist on branch-2.
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