Repository navigation
Bound subscription memory borrowing and report admission failures - #18812
Merged
Merged
Conversation
Caideyipi
force-pushed
the
fix/subscription-fair-share-admission
branch
from
October 9, 2026 08:55
57a1f84 to
2bfe91b
Compare
Caideyipi
force-pushed
the
fix/subscription-fair-share-admission
branch
from
October 9, 2026 09:01
2bfe91b to
1dc912f
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18812 +/- ##
============================================
- Coverage 45.59% 45.55% -0.04%
Complexity 712 712
============================================
Files 5496 5497 +1
Lines 396800 397113 +313
Branches 51621 51648 +27
============================================
- Hits 180929 180921 -8
- Misses 215871 216192 +321 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jt2594838
approved these changes
Oct 10, 2026
Comment on lines
+153
to
+156
| if (!handle.active || handle.closed || !handles.containsKey(handle.id)) { | ||
| return AllocationResult.rejected( | ||
| AllocationRejectionReason.MEMORY_LIMIT, getTotalMemorySizeInBytes(), 0L); | ||
| } |
Contributor
There was a problem hiding this comment.
Why is this called MEMORY_LIMIT?
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
In a mixed large-field and numeric subscription workload, one queue retained most of a DataNode's subscription materialization budget while other queues also rejected real-time entries. The old warning called every rejection "queue full", even when capacity remained. The reported run (case 1392, result 27524) consumed 18,919,210 of 24,693,910 written rows before its consumer timed out. The source counts matched the writes. This PR bounds how much materialized-tablet memory one queue can retain and makes admission failures observable; it does not claim that this allocation change alone explains or resolves the entire observed delivery stall.
Admission and recovery
SUBSCRIPTION_OVERSIZED_ENTRYonly when one materialized WAL entry exceeds the maximum a queue can hold under the current protected floors. A larger-than-equal-share entry can use idle borrowable capacity. Do not advance an oversized entry's WAL or commit progress. This is an intentional behavior change from the empty-budget oversized-entry exception; operators must increase the materialization budget, reduce concurrent queues, or narrow the topic to consume such an entry.Diagnostics and configuration
reasonCodefor real-time admission rejection, distinguishing subscription quota/limit, consensus request memory, writer backlog, queue capacity, and lifecycle states. Add queue-level memory used/equal share/maximum and total plus per-reason rejection counters to metrics. Rate-limit WARN counts separately by reason, and include the latest reason in each queue core report. Capture offer rejection reasons per writer thread so concurrent offers cannot mislabel one another. A transient real-time rejection is still eligible for WAL replay and does not become a consumer error for every rejected offer.subscription_cache_memory_usage_percentage=0.2in the distributed config template, including large-field and large-batch workloads. This controls serialized poll-response caching, not the materialized-tablet budget. Size the ninthchunk_timeseriesmeta_free_memory_proportionshare from the largest materialized entry, active queue count, and desired buffering depth.Validation and limits
testbuild and Chinese reactortest-compile -DskipTests -P with-zh-localepassed on the final changes. Spotless andgit diff --checkpassed.Related PR
#18808 adds delivery-stall and node-memory diagnostics and retains the previous single oversized-entry exception. These PRs overlap in
ConsensusPrefetchingQueue, metrics, memory manager, and localized messages. Their metric and oversized-entry semantics need reconciliation before merging both.This PR has:
Key changed classes
SubscriptionMemoryManager,ConsensusPrefetchingQueue,SubscriptionQueueRegistry, andConsensusSubscriptionPrefetchingQueueMetrics.