Repository navigation
Conversation
Design and test plan for computing ingestion-time views on every ingest shard: refresh groups compiled into push pipelines split at pipeline breakers, one instance per (shard, window), partial outputs combined at window close by a rule derived from the plan (concatenate per-series states, merge mergeable states, single partition otherwise), commits in window order. Implementation follows after the test plan is approved.
…st plan Records each decision with options, precedents (push and streaming engines), corpus evidence (what the Planner puts at ingestion time over 3,731 public queries) and conclusion, with result slots for E1-E5. Rebased on the sharded ingestion: seal travels with the coordinator's flush, combine runs on the window-task pool, views of a source run inline on the shard thread, non-mergeable breakers are a list awaiting ordered-merge. Test plan revised to T1-T19 and B1-B2.
zzylol
force-pushed
the
feat/parallel-precompute
branch
from
November 21, 2026 00:11
38a73a7 to
27ae132
Compare
…ng until implemented)
Tests from the approved test plan of docs/design/parallel-precompute.md,
written before the implementation:
- T1, T2 in planner_executor_parity.rs: push answers and stored view rows
against the reference and the window path, K = 1, 2, 4, 8.
- T3-T19 in push_precompute.rs. Each runs its fixture in window mode
first, then in push mode.
- B1/B2: ingest_bench takes PRECOMPUTE_MODE=push and, when paced,
reports the newest window's commit lag.
Interface only, no push logic: EngineOptions.precompute_mode
(--precompute-mode, refused at install when push),
precompute_memory_budget_bytes, the test hooks slow_refreshes (the same
shape as the precompute task pool's) and panic_in_combine_of_window_end_ms,
pipelines::{CombineRule, BreakerRule, combine_rule, combine_rules}
(returning "not implemented"), and Snapshot::view_rows for comparing stored
views.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9
Takes the precompute task pool, series-split windows and SlowRefresh hooks; the test hook slow_refreshes is the pool's, the duplicate field from the test commit is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9
…w pipeline instances
--precompute-mode push (docs/design/parallel-precompute.md, D1-D9):
- Push groups. A refresh group whose run splits by series, carries no
state across windows and reads no view is built by push, once an
install probe shows that its Scans read exactly the window. Other
groups keep the window path on the precompute task pool.
- Instances. Each ingest shard (series hash, D3) keeps one instance of
the group's compiled ingestion run per open window. The instance runs
over a PushStore whose raw-data slots are streams fed inline on the
shard thread. One morsel is converted once per slot and reaches every
view of its source with no queue and no raw buffer (D2). The run's
non-Send future lives in the shard's LocalPool.
- Seal and commit. After the flush that closes a window, the
coordinator sends Seal to every shard. Each shard ends its streams
and sends its partial (idle shards an empty one). The committer
combines the partials with the series-split merge of the task pool
(Concatenate) and commits them through the same reorder buffer,
barriers and persistence.
- Raw data. Metrics read only by push groups keep no raw data, and push
groups no longer hold raw-data cutoffs back.
- Memory budget (--precompute-memory-budget-bytes). Open state is the
instances' run memory. A window fails only when it is the only one
open on every shard and still over the budget. While an older window
is open anywhere, the state is allowed over the budget until the
seal frees it.
- Hooks. slow_refreshes delays a pushed window's combine, and
panic_in_combine_of_window_end_ms makes it panic. The panic is caught
and fails that window only.
- Metrics:
- asap_phase_* {phase="precompute_push|precompute_seal", group,
shard}, precompute_combine {group} and precompute_commit;
- asap_precompute_state_bytes, asap_precompute_open_instances and
asap_window_commit_lag_seconds;
- asap_samples_total{outcome="late_for_views"}, counted at routing in
either mode.
- pipelines::combine_rule(s) implement the rule table. Every node is
checked before the groups are read, so an unknown breaker is named.
Test fixes, keeping each test's stated intent:
- T5 regroups by the series' first label column when a scan has no
`job` column.
- T7 collects the rules seen, rather than keying them by a payload prefix.
- T13 seals the window behind a barrier before sending the late sample,
and expects 4 late samples per metric that an ingestion-time view
reads.
- T14 runs one precompute thread, because the task pool's slots would
otherwise hold more windows than the test writes.
- T1 takes PARITY_PUSH_SHARDS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9
…schema Every Scan of every open window that reads a metric in one schema now shares one conversion of the morsel, as the window path shares a chunk's conversion through RawReads. The executor re-applies each slot's time range and predicates. Measured at 10k series × 2 metrics, 10 samples/s, 4 shards, unpaced: push folding fell from about 1.75× the window path's precompute CPU to the same (122 s against 123 s for 60M samples). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9
…fore folding Each fold runs every view of the group, so a 10 Hz scrape's share of a shard (a few thousand rows) costs more per sample than a large morsel. A shard now buffers its routed samples and folds them once --push-batch-samples are pending (default 32,768) or the oldest is --push-batch-max-ms old (default 1,000). A seal folds what is pending first, so batching never delays a window's commit. A fold gives each window's instance a morsel of its own samples only, so a large window does not cost a small window's run its memory. T15 folds every request as it comes (MorselBatching 0), because it measures open state request by request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9
…ite load generator examples/remote_write_load.rs sends Remote Write from another host: - per-series protobuf prefixes are encoded once; - each thread keeps one keep-alive connection; - the sender is paced to the wall clock or stamps samples in the past; - 503s get an exponential backoff. The design doc's B section records the sweep over K = 4–56 CPUs (28 physical cores plus SMT points), window-ready latency, request-size checks and where each mode stops scaling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9
zzylol
added a commit
that referenced
this pull request
Nov 22, 2026
…requests In window mode the single ingest coordinator was the bottleneck under many small Remote Write requests: the #854 sweep measured 0.1-0.5M samples/s, falling as shards were added, with the coordinator thread busy. Every request reached every shard; each shard reported each batch with a clone of its raw data, each report started a coordinator pass with a flush of every shard, each eviction message produced another report (another pass), and because the coordinator's snapshot shared the shards' raw data, every append copied the shard's pane lists. - A shard drains every batch already queued to it and sends one report (sample times, counts, first samples): one report, and at most one pass, per drained queue instead of per request. - Reports no longer carry raw data. A shard sends its raw data only with its answer to a flush (Command::Flushed(shard, raw_data)), which is what the windows closing behind that flush read. - Eviction (Maintain) sends no report, so it starts no pass. - When no query reads raw samples (no query-time Scan), the coordinator publishes no raw data and lets each pass's snapshot go once its closed windows are queued: a shard's next append owns its raw data again instead of copying its pane lists (only queued refreshes hold them until they run). Ingestion::queries_read_raw_data says which. Measured on two 40-vCPU hosts (engine pinned to 40 cores with 32 ingest and 32 precompute threads; 12 sender processes x 4 threads on the other host; the 10 Hz dashboard plan, 2 x 100,000 series): - as fast as accepted: 0.16M samples/s before (coordinator 1.00 core) -> 8.02M after (coordinator 0.45 core, engine 39.7 cores); - paced at the wall clock, 3M and 4M samples/s offered (2 x 150,000 and 2 x 200,000 series): every sample accepted, none late; engine 24.9 and 26.3 cores, coordinator 0.86 and 0.83. Parity: 384/384 queries and 324/324 range steps at 1, 4 and 8 shards; ingest_shards, window_levels, view_tiering and the other suites pass. precompute_pool's byte-identity test at 12 threads fails intermittently under load with and without this change (1 of 3 runs on 8368fcf).
zzylol
added a commit
that referenced
this pull request
Nov 23, 2026
Push precompute now commits into tiered view storage and keeps the demo branch's behaviour: windows from the stream start, the drained shard queues and flush-carried raw data of the coordinator, multi-level window chains (groups reading other groups stay on the window path), allowed lateness and backpressure. - engine.rs: both option sets; a shard drains its queue, appends, and folds each batch into its push instances in the same pass; Seal is handled in order with samples. - store.rs: ViewStore::rows reads each window through its slot (pending, cached or decoded from its fragment). - planner_executor_parity.rs: data_plane_over takes the view mode; T1 for push runs with every view read cold from the view files.
Contributor
Author
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.
Design: docs/design/parallel-precompute.md.
This PR has the design, the approved tests T1–T19 and B1–B2, and the push precompute implementation (
--precompute-mode push). It is stacked on #852, whose head (1a0c64cb: task pool, series-split windows) is merged in. The window path stays the default.For reviewers
data_plane/src/push.rs: shard instances, thePushStore, the install probe, seal, and the memory budget.engine.rs:PrecomputeJob::Push,PoolEvent::PartialandWindowTasks::push_windowreuse the pool's reorder buffer, merge and barriers.jobcolumn.PARITY_PUSH_SHARDS.Reducechain does not compile.What push does
Scans read exactly the window (checked by a probe at install) is built by push. Other groups stay on the window path.--precompute-memory-budget-bytesis checked against the instances' run memory. While an older window is open anywhere, state may go over the budget until its seal frees it. A lone window over the budget fails alone.precompute_push,precompute_seal(by group and shard),precompute_combineandprecompute_commit.asap_precompute_state_bytes,asap_precompute_open_instancesandasap_window_commit_lag_seconds.asap_samples_total{outcome="late_for_views"}.pipelines::combine_rule(s)implement the rule table.Results
The design doc records E1/E2 in D1, D2, D8 and D9, and has a B1/B2 section.
B1/B2 (typical 60 s / 10 Hz dashboard, 12 views, raw data not kept, K ingest shards = K precompute threads, paced at 10 Hz). Push coalesces each shard's samples into morsels of up to 32,768 samples or 1 s before folding (
--push-batch-samples,--push-batch-max-ms); a seal folds what is pending first.Core scaling
Setup.
0..K: physical cores first, then SMT siblings.Push.
Window path (with
--precompute-threads K).The full tables are in the design doc's B section.
Verification
cargo test -p data_plane: every test passes.push_precompute: 15 passed, 3 ignored (T9 and T16 are out of scope for this PR).precompute_pool,ingest_shards,planner_executor_parity(T1, T2) and the rest: all pass.PARITY_PUSH_SHARDS).🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6bo6sg4cEjJJhktNtL9