Repository navigation
HBASE-30433 Seed the master's flushedSequenceIdByRegion watermark with the region's final flushed seqid on region CLOSE - #8760
Open
nirdosh0110 wants to merge 2 commits into
Conversation
added 2 commits
October 13, 2026 10:50
…h the region's final flushed seqid on region CLOSE On graceful region CLOSE the RegionServer now reports the region's durable flushed seqid (HRegion.getMaxFlushedSeqId()) on the CLOSED transition, and the master lifts its flushedSequenceIdByRegion watermark from it via the existing monotonic reportRegionOpen(merge(Math::max)) seed. This narrows the graceful-close window where a subsequent WAL split of a crashed source RS could otherwise treat already-durable edits as unflushed and write orphaned recovered.edits. No proto/RPC change: the RegionStateTransition message already carries an optional openSeqNum field and the CLOSED transition is already routed through the same master-side handler. HRegionServer now also sets that field for CLOSED (not just OPENED), and AssignmentManager seeds the watermark on CLOSED when seqId >= 0. Adds TestGetLastFlushedSequenceId#testFlushedSequenceIdSeededOnRegionClose. (cherry picked from commit dc643a2)
…n close-seed test - Rename ServerManager#reportRegionOpen to advanceRegionFlushedSeq since it is now called on both region OPEN and CLOSE; generalize its javadoc. - testFlushedSequenceIdSeededOnRegionClose now leaves edits unflushed so the close flush itself advances maxFlushedSeqId (a pre-close heartbeat cannot carry that value), and asserts the master's watermark equals it. The old version passed even with the CLOSE seed disabled because 1s heartbeats delivered the same value. (cherry picked from commit a9784fa)
virajjasani
self-requested a review
October 13, 2026 15:42
virajjasani
approved these changes
Oct 13, 2026
virajjasani
left a comment
Contributor
There was a problem hiding this comment.
+1, awaiting workflow results
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.
JIRA: https://issues.apache.org/jira/browse/HBASE-30433
Backport of #8707 to branch-2:
cherry-pick -xof both master commits.Summary
Seed the master's
flushedSequenceIdByRegionwatermark with the region's final flushed seqid on region CLOSE. A subsequent WAL split of a drained or crashed source RS then recognizes already-durable edits instead of writing orphanedrecovered.edits. This complements the OPEN-time seed from HBASE-30335 (#8736, already on branch-2). Both go through the same monotonicmerge(Math::max), so they can never regress a higher value.Change
CLOSEDtransition,CloseRegionHandlerandUnassignRegionHandlerreportHRegion.getMaxFlushedSeqId()(previouslyNO_SEQNUM).HRegionServersets the wireopenSeqNumfield forCLOSEDas well asOPENED. No protobuf change.CLOSED,AssignmentManageradvances the watermark whenseqId >= 0.ServerManager#reportRegionOpenis renamed toadvanceRegionFlushedSeq, because it now serves both OPEN and CLOSE.Test
TestGetLastFlushedSequenceId#testFlushedSequenceIdSeededOnRegionCloseleaves edits unflushed, so the close's own flush advancesmaxFlushedSeqId; a heartbeat sent before the close can't carry that value. It then asserts that the master's watermark equals that value. With the CLOSE seed disabled, the test fails (expected 7, got 2).Backport conflicts
UnassignRegionHandler: kept branch-2's hbase:meta read-replicaremoveCatalogReplicationSourceblock ahead of the CLOSED report.TestGetLastFlushedSequenceId:SingleProcessHBaseClusterchanged toMiniHBaseCluster.Local run (JDK17,
-Dhadoop.profile=3.0)All green:
TestGetLastFlushedSequenceId3/3,TestServerManager5/5,TestMergeTableRegionsProcedure9/9,TestAssignmentManagerUtil3/3,TestMaster6/6,TestDLSFSHLog2/2,TestDLSAsyncFSWAL2/2.spotless:checkis clean.🤖 Generated with Claude Code