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

   ## Description
   
   A consensus subscription queue recovering from a realtime admission gap can 
have pending requests and free subscription memory while its replay cursor 
remains unchanged. A freshly rebuilt WAL iterator installs a search-index lower 
bound but starts at the first retained file, and `advanceTo()` previously 
returned immediately for that same bound. Bounded replay rounds can therefore 
spend many iterations scanning already covered history before reaching the gap.
   
   Allow a fresh iterator to realign at its existing bound, and perform that 
realignment on initialization and cursor resets. Historical files are skipped 
only after checking coverage of every writer; uncovered follower requests 
remain replayable. Repeated equal-bound probes after scanning starts keep their 
reader position without rechecking the same file footers.
   
   Start the cooperative 50 ms scan budget at the first WAL probe so queue 
housekeeping cannot exhaust it before replay begins. Preserve the shared 
physical-entry budget and incomplete request fragments across yields.
   
   Add the last completed prefetch duration/result and a WAL reader state 
snapshot (yield, temporary unreadability, buffered request, file version, entry 
offset, body-read attempts) to queue diagnostics. Warn after 60 seconds without 
cursor progress while lag remains positive, throttled to once per 30 seconds; 
reset the observation on progress, inactivity, or an empty backlog. Document 
per-region delivery alerts, recovery-time limits, and memory/capacity guidance 
in `docs/Subscription-WAL-Replay.md`.
   
   ## Validation
   
   - The delayed-first-probe and fresh-iterator realignment regressions fail 
before the fix and pass afterward.
   - Targeted WAL iterator, pending-gap/backpressure, queue, initialization, 
and seek tests: 87 run, zero failures/errors, one opt-in performance test 
skipped.
   - Full-reactor English `mvn -o test-compile -DskipTests`: passed (53 
modules).
   - Full-reactor Chinese `mvn -o test-compile -DskipTests -Pwith-zh-locale`: 
passed (53 modules).
   - English/Chinese message key parity and `git diff --check` pass.
   
   The original hour-long multi-region workload has not been rerun; end-to-end 
recovery latency still needs workload validation.
   
   This PR has:
   
   - [x] been self-reviewed, including concurrent lifecycle and consumer access.
   - [x] added documentation for the changed replay and diagnostic behavior.
   - [x] added comments explaining the progress and coverage constraints.
   - [x] added or extended unit tests for the changed paths.
   


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