HBASE-30335 Seed master flushedSequenceIdByRegion with openSeqNum on region OPEN (branch-2) - #8736
Open
nirdosh0110 wants to merge 1 commit into
Open
nirdosh0110 wants to merge 1 commit into
nirdosh0110 wants to merge 1 commit into
Conversation
…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.
2 tasks
virajjasani
self-requested a review
October 5, 2026 19:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #8584 to
branch-2(JIRA: HBASE-30335).Problem
The master's
flushedSequenceIdByRegionis only updated by periodic RegionServer heartbeats. Right after a region OPEN the entry is absent or stale, soServerManager.getLastFlushedSequenceIdcan returnNO_SEQNUM(or an old value) andWALSplittertreats already-durable edits as unflushed. If the source RS of a graceful move crashes before the next heartbeat, SCP produces orphanedrecovered.edits, which later block merge/split and leave regions stuck in RIT.Change
ServerManager.reportRegionOpen(regionInfo, openSeqNum)seeds the cache withmerge(openSeqNum, Math::max);AssignmentManagercalls it on region OPEN.updateLastFlushedSequenceIdsnow uses atomiccompute()instead of get-then-put, so a stale in-flight heartbeat cannot overwrite the OPEN seed with a lower value.Tests
TestServerManager(seed, monotonicity, concurrent stale-heartbeat race).TestGetLastFlushedSequenceId#testFlushedSequenceIdSeededOnRegionOpen; existing test updated for the new invariant.AbstractTestDLS#makeWALaligns synthetic WAL seqids withopenSeqNum.Backport notes
TestGetLastFlushedSequenceId: kept branch-2'sHMaster#getLastSequenceId/MiniHBaseClusterAPIs.TestMaster#testFlushedSequenceIdPersistLoadchange 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: 0mvn -pl hbase-server spotless:check→ BUILD SUCCESS