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

   Backport of #8584 to `branch-2` (JIRA: 
[HBASE-30335](https://issues.apache.org/jira/browse/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**
   


-- 
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