Repository navigation
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.
Description
When several DataRegions share a subscription memory budget, fixed-depth read-ahead can exhaust that budget and reject realtime requests even when the pending queue has room. A prefetch round also removes its entire pending batch before processing, so memory pressure or delivery capacity can discard the unprocessed suffix and force it through WAL replay.
Keep unprocessed requests in the bounded pending queue, including their consensus memory reservations, and remove them only after successful materialization or deduplication. Subscription memory pressure now pauses materialization while realtime admission remains governed by pending capacity, consensus request memory, and existing lifecycle/writer-backlog checks. ACK releases memory and wakes prefetch to resume ordered delivery.
Bound speculative read-ahead by half of each active queue's current memory quota as well as the configured event capacity. Account for queued and in-flight Tablet memory, allow an empty delivery queue to make progress with a larger entry, and retain the shared memory manager's hard allocation limits. Count the current delivery batch toward event capacity and publish reserved batches when prefetch pauses. Already materialized writer buffers are drained before converting more requests.
Validation
test-compile -DskipTestspasses for both English and-P with-zh-locale(53 modules each, captured exit codes 0).The original throughput workload and its 400 ms P99 target still need to be rerun in the benchmark environment.
WAL latency scope
This change avoids unnecessary WAL fallback after transient materialization pressure. It does not remove all possible slow WAL operations: an iterator can read an entire file's metadata or scan multiple physical entries before returning a request, damaged metadata can trigger prefix recovery, and an exhausted subscription reader can synchronously wait for WAL rotation. The
waiting ...ms for WAL gaplog reports cumulative gap recovery time, rather than the latency of one physical read.This PR has: