nirdosh0110 commented on PR #8584:
URL: https://github.com/apache/hbase/pull/8584#issuecomment-5705326810

   > Copilot's review (2026-09-02, reiterated 2026-09-16) highlights a real 
race. This has to be fixed now, not deferred to another followup, otherwise 
what is the point. A stale in-flight heartbeat from the (soon to be dead) 
source RS can read null/a low value, race past the OPEN-seed, and then 
overwrite it with its lower value, reintroducing the bug this PR is meant to 
fix, just in a narrower window.
   
   @apurtell Got it. The race was in updateLastFlushedSequenceIds: it did a 
non-atomic get-then-put, so a stale in-flight heartbeat could read null/low, 
race past the reportRegionOpen seed, and put its lower value on top.
   
   Both the region- and store-level updates now go through an atomic compute 
that keeps the existing "never lower the watermark" rule. With the 
merge(Math::max) seed on the OPEN side, every writer on the live serving path 
is now an atomic max-merge — the stored value is monotonic non-decreasing, so a 
concurrent seed can no longer be clobbered. Whatever the interleaving: 
heartbeat-before-seed → the seed lifts it to openSeqNum; heartbeat-after-seed → 
compute refuses to lower it.
   
   Added TestServerManager#testConcurrentStaleHeartbeatDoesNotClobberOpenSeed 
to test the scenerio. 


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