Repository navigation
[Bugfix] Bound consensus subscription WAL scans per prefetch round - #18849
Merged
jt2594838 merged 2 commits intoOct 14, 2026
Merged
Conversation
jt2594838
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When consensus subscription replay scans a wide WAL prefix or a fragmented request, a single
ProgressWALIterator.hasNext()can read many physical entries before returning a logical request. The queue's logical-request limit does not bound this work, so one region can occupy a shared prefetch worker for minutes while other regions stop delivering data.Share a physical-entry scan budget and a cooperative 50 ms time slice across WAL catch-up, pending-gap recovery, readability probes, and end-of-round scheduling. A yielded scan preserves its reader position, pending fragments, and buffered retry request, publishes completed tablets, and requeues the task so other regions can run. Repeated realtime jumps continue a yielded gap scan instead of reopening it at the old cursor. A yield is distinct from WAL exhaustion and does not trigger a WAL roll or an incomplete-scan error. The public unbounded iterator API retains its existing behavior.
Regression coverage checks skipped prefixes and replicated request fragments across several rounds, deadline expiry and buffered retries, and repeated pending gaps with exactly one delivery per request. Existing memory backpressure, seek, WAL corruption/retry, and queue tests also pass.
Validation:
mvn -nsu -Ddevelocity.off=true -pl iotdb-core/datanode spotless:applymvn -nsu -Ddevelocity.off=true -pl iotdb-core/datanode -am test-compile -DskipTestsmvn -nsu -Ddevelocity.off=true -pl iotdb-core/datanode -am test -Dtest=ProgressWALIteratorTest,ConsensusPrefetchingQueueTest,ConsensusPrefetchingQueueWalBackpressureTest,ConsensusPrefetchingQueueSeekTest -Dsurefire.failIfNoSpecifiedTests=false— 76 tests, 0 failures/errors, 1 optional benchmark skipped.mvn -nsu -Ddevelocity.off=true -pl iotdb-core/datanode -am test-compile -P with-zh-locale -DskipTestsgit diff --checkThe time slice is checked between WAL operations and cannot interrupt an individual file read. The original hour-long, wide-table workload has not been rerun, so its throughput and stall-duration improvement still need workload validation.