nirdosh0110 opened a new pull request, #8760:
URL: https://github.com/apache/hbase/pull/8760

   JIRA: https://issues.apache.org/jira/browse/HBASE-30433
   
   Backport of #8707 to branch-2: `cherry-pick -x` of both master commits.
   
   ### Summary
   
   Seed the master's `flushedSequenceIdByRegion` watermark 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 
orphaned `recovered.edits`. This complements the OPEN-time seed from 
HBASE-30335 (#8736, already on branch-2). Both go through the same monotonic 
`merge(Math::max)`, so they can never regress a higher value.
   
   ### Change
   
   - **RegionServer:** on the `CLOSED` transition, `CloseRegionHandler` and 
`UnassignRegionHandler` report `HRegion.getMaxFlushedSeqId()` (previously 
`NO_SEQNUM`). `HRegionServer` sets the wire `openSeqNum` field for `CLOSED` as 
well as `OPENED`. No protobuf change.
   - **Master:** on `CLOSED`, `AssignmentManager` advances the watermark when 
`seqId >= 0`.
   - **Rename (from #8707 review):** `ServerManager#reportRegionOpen` is 
renamed to `advanceRegionFlushedSeq`, because it now serves both OPEN and CLOSE.
   
   ### Test
   
   `TestGetLastFlushedSequenceId#testFlushedSequenceIdSeededOnRegionClose` 
leaves edits unflushed, so the close's own flush advances `maxFlushedSeqId`; 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-replica 
`removeCatalogReplicationSource` block ahead of the CLOSED report.
   - `TestGetLastFlushedSequenceId`: `SingleProcessHBaseCluster` changed to 
`MiniHBaseCluster`.
   
   ### Local run (JDK17, `-Dhadoop.profile=3.0`)
   
   All green: `TestGetLastFlushedSequenceId` 3/3, `TestServerManager` 5/5, 
`TestMergeTableRegionsProcedure` 9/9, `TestAssignmentManagerUtil` 3/3, 
`TestMaster` 6/6, `TestDLSFSHLog` 2/2, `TestDLSAsyncFSWAL` 2/2. 
`spotless:check` is clean.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to