Caideyipi opened a new pull request, #19322:
URL: https://github.com/apache/iotdb/pull/19322

   ## Description
   
   During a consensus subscription writer handoff, the previous writer can stop 
reporting safe times while it is still routed. Consuming its last safe frontier 
does not mean it cannot supply more events. After it leaves routing, already 
applied writes can still be waiting to become readable from the WAL.
   
   ### Example
   
   Writer A last reported safe time `1000`. Its write at `1500` has been 
applied but is not yet readable from the WAL. Writer B has a write at `2000` 
ready to deliver.
   
   - Before: The queue could drop A's barrier after consuming the frontier at 
`1000` and deliver `2000` first.
   - After: The queue keeps A's barrier while it is still routed. If A leaves 
routing, the queue waits for its known applied progress to be replayed. When 
the delayed WAL becomes available, the subscriber receives `1500` before 
`2000`, without duplicates.
   
   The queue retains barriers across repeated and consecutive routing updates, 
applies the same ordering to pending and realtime events, and exposes an 
active-writer-count gauge per queue and region.
   
   ## Verification
   
   - [x] Independently reviewed the full change.
   - [x] Passed 17 targeted tests locally, including all new tests for writer 
ordering and metric registration and removal.


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