nirdosh0110 commented on code in PR #8707:
URL: https://github.com/apache/hbase/pull/8707#discussion_r4254995272


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java:
##########
@@ -1230,8 +1230,17 @@ private void 
reportRegionStateTransition(ReportRegionStateTransitionResponse.Bui
           final RegionInfo hri = 
ProtobufUtil.toRegionInfo(transition.getRegionInfo(0));
           long procId =
             transition.getProcIdCount() > 0 ? transition.getProcId(0) : 
Procedure.NO_PROC_ID;
-          updateRegionTransition(serverNode, transition.getTransitionCode(), 
hri,
-            transition.hasOpenSeqNum() ? transition.getOpenSeqNum() : 
HConstants.NO_SEQNUM, procId);
+          long seqId =
+            transition.hasOpenSeqNum() ? transition.getOpenSeqNum() : 
HConstants.NO_SEQNUM;
+          // On CLOSE, seed the master's flushed-seqid watermark with the 
region's final flushed
+          // seqid (reported by the RS). This complements the OPEN-time seed 
(HBASE-30335) and
+          // narrows the graceful-close window where a WAL split of a crashed 
source RS could
+          // write orphaned recovered.edits for already-durable edits. Uses 
the same monotonic
+          // merge(Math::max) seed, so it never regresses a higher value.
+          if (transition.getTransitionCode() == TransitionCode.CLOSED && seqId 
>= 0) {
+            master.getServerManager().reportRegionOpen(hri, seqId);

Review Comment:
   > Since now region OPEN, FAILED_OPEN and CLOSED cases use the same 
ServerManager API, instead of calling it `reportRegionOpen()`, we can rename it 
to something generic like `advanceRegionFlushedSeq()`.
   
   Renamed the API to advanceRegionFlushedSeq(). JFYI FAILED_OPEN region state 
doesn't move the watermark forward, since a failed open has nothing new made 
durable to report.



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