Repository navigation
Conversation
zzylol
force-pushed
the
feat/collector-views-file
branch
2 times, most recently
from
November 28, 2026 18:49
b8a6b34 to
38b3493
Compare
zzylol
force-pushed
the
feat/collector-state-ingest
branch
from
November 29, 2026 00:55
8c6f738 to
4d1070d
Compare
zzylol
force-pushed
the
feat/collector-views-file
branch
from
November 29, 2026 01:06
38b3493 to
9b1bb5a
Compare
zzylol
force-pushed
the
feat/collector-state-ingest
branch
from
November 29, 2026 18:01
4d1070d to
6d57168
Compare
zzylol
force-pushed
the
feat/collector-views-file
branch
from
November 29, 2026 18:04
9b1bb5a to
e7b33b7
Compare
zzylol
force-pushed
the
feat/collector-state-ingest
branch
from
November 30, 2026 02:33
6d57168 to
cd13693
Compare
zzylol
force-pushed
the
feat/collector-views-file
branch
2 times, most recently
from
November 30, 2026 03:54
c49bc44 to
5eeb272
Compare
zzylol
force-pushed
the
feat/collector-state-ingest
branch
from
November 30, 2026 06:21
8411b5b to
742e799
Compare
zzylol
force-pushed
the
feat/collector-views-file
branch
from
November 30, 2026 06:21
5eeb272 to
f6a3f5f
Compare
…ta plane --collector-views - control_plane::collector_views: the collector's capabilities (planner DeploymentCapabilities with collector summary entries, predicate ops, operator lines, placement, close delay) and the bottom-up rule (a)-(d) of docs/design/collector-sketch-ingest.md §1 that cuts the collector sub-DAG; outputs that are not views go back to the backend. - common::CollectorViewsFile: planner wire version, plan id, commit grace, backend_reads_raw, outputs, sub-DAG in the planner's serde. - control_plane --plan/--collector-capabilities/--emit-collector-views (+ export interval and clock skew allowance in the grace); prints why each other node is not on the collector. - data_plane --collector-views: the file's outputs are the precompute engine's collector views; installing another plan is refused.
…builds, locality per operator, limit checks at load - Rule (a): a reductions list limits a chain or SummaryAgg only; an Aggregate's grouping is left to rule (d). - Rule (d): only operators that keep each series' rows to it are local; a grouping (Aggregate, chain or SummaryAgg Reduce, SummaryMerge group_by) is local when each group is on one instance; every other operator is not. The grouped input is the operator's own child. - Capabilities: a limit on an operator it does not apply to, an unknown source or reduction name, or an operator listed twice is a load error. - Scalar roots count as roots; the plan's views and the written sub-DAG are validated (errors propagate); --plan needs --collector-capabilities and conflicts with the planning flags. - Docs: CommitGrace adds to the declared close delay; why the executor entry is deserialized by hand; README and common crate docs.
…ws file and CLI Collector windows now commit when their states arrive (#890), so the grace has no reader: CommitGrace, CollectorViewsFile::commit_grace_ms and --collector-export-interval-ms / --collector-clock-skew-allowance-ms go. The collector's window_close_delay_ms capability stays as it declares it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo8kYWd83zXwh2Nobf
…iling first) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo8kYWd83zXwh2Nobf
Rule (e): a node whose output holds a counter's or an instant rate's state is never placed on the collector, whatever its capabilities declare, so ASAPQuery-backend keeps its raw samples (backend_reads_raw) and computes its windows again from them when late samples come. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo8kYWd83zXwh2Nobf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo8kYWd83zXwh2Nobf
…close CollectorViewOptions gained idle_close_ms (#890); the collector-views file does not carry the collector's close delay (a new field would be refused by readers that deny unknown fields), so the options it gives take the default 6 s + 2 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo8kYWd83zXwh2Nobf
zzylol
force-pushed
the
feat/collector-state-ingest
branch
from
November 30, 2026 07:30
742e799 to
b7b9312
Compare
zzylol
force-pushed
the
feat/collector-views-file
branch
from
November 30, 2026 07:30
f6a3f5f to
40d0d0d
Compare
This was referenced Nov 30, 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.
Summary
docs/design/collector-sketch-ingest.md§1 and §2, plan step 4).control_plane::collector_views: the collector's declared capabilities (CollectorCapabilities, whatasap_sketches --print-capabilitiesprints: the planner'sDeploymentCapabilitieswith collector summary entries, predicate ops, operator lines, placement, close delay) and the generic bottom-up rule (a)–(d) of §1 that cuts the collector sub-DAG out of the installed plan (collector_sub_dag).common::CollectorViewsFile: the file both the collector and the data plane load (planner_wire_version,plan_id,backend_reads_raw,outputs,dagin the planner's serde).control_plane --plan <plan.json> --collector-capabilities <caps.json> --emit-collector-views <out.json>(or with--workload/--out); it prints why each other node is not on the collector.--collector-views <file>: the file's outputs become the precompute engine's collector views (it skips them and theScans only they read; views reading them are built from the committed states), and the install is refused when the file'splan_idis not the installed plan's.quantile_over_time(0.99, data[5m])and today's collector, the rule picks exactly the DDSketch chain, marksdataas no longer read raw, and the data plane started with the written file answers from the collector's states as it does from its own view. Without--collector-viewsnothing changes (parity dump byte-identical to the previous PR).Restack (2026-11-30, 2nd) onto #890 b7b9312, at 40d0d0d
Restack (2026-11-30) onto #890 742e799, at f6a3f5f
-D warningsand fmt clean. Passing: storage 52, precompute 12, otlp 18, data_plane collector_views 13, ingest_shards 17, ingest_protocols 6, planner_executor_parity 6.Restack on #890 8411b5b (2026-11-30), at 5eeb272
CollectorViewOptionsgainedidle_close_msin Collector view states: ingest OTLP states of the views a collector builds, staged and committed as the view's windows #890, andFrom<&CollectorViewsFile>takes the default (8 s).window_close_delay_ms: a new field would be refused by readers that deny unknown fields, like the collector's.control_planecollector_views 8;data_planecollector_views 13.Follow-up (2026-11-30, approved), at d324bda
rate,increase,irate) is never placed on the collector, whatever the capabilities declare (NotOnCollector::OrderSensitive, checked first). So its metric is read raw (backend_reads_raw: true), and feat(precompute): merge late samples into committed windows within retention #892 can recompute its windows from raw samples.control-plane/tests/collector_views.rs::an_order_sensitive_view_stays_in_the_backend. Before, the counter view's reason wasNotInCapabilities("summary ExactAggregate(Counter, Counter)"); it is nowOrderSensitive, with no collector output anddata_totalread raw.Review guide
feat/collector-state-ingest(Collector view states: ingest OTLP states of the views a collector builds, staged and committed as the view's windows #890), on feat(precompute): merge late samples into committed windows within retention #892 (late merge) → feat(precompute): close an idle stream's last windows by wall-clock time #889 (idle close) → chore: range step cap in the query engine, one plan test helper, QueryOutcome as Result #888. Stacked draft.--ontorebase.CollectorViewOptionslostcommit_grace_ms.-D warnings): clean;control_planecollector_views 7,data_planecollector_views 10;planner_executor_parity6 passed (1125 s), covering feat(precompute): merge late samples into committed windows within retention #892/Collector view states: ingest OTLP states of the views a collector builds, staged and committed as the view's windows #890's follow-ups too.drop the commit grace from the collector-views file and CLI. Collector windows commit on arrival (Collector view states: ingest OTLP states of the views a collector builds, staged and committed as the view's windows #890), soCommitGrace,CollectorViewsFile::commit_grace_msand the two grace flags are removed.window_close_delay_msstays in the capabilities, as the collector declares it.crates/control-plane/src/collector_views.rs:collector_sub_dag(assignment loop, the v1 "outputs must be views" pass, sub-DAG copy,backend_reads_raw), thenwithin_capabilitiesandlocal_to_partition.crates/precompute/src/engine.rsPrecomputeEngine::start(plan id check),crates/precompute/src/collector.rs(CollectorViewOptions::plan_id,From<&CollectorViewsFile>),crates/data-plane/src/main.rs(--collector-views),crates/control-plane/src/main.rs.common/src/collector_views_file.rs;control-planegainsasap-types(the IR the rule reads, whichasap-plannerdoes not re-export) andcommon;commongainsserde.Behavior: before → after
control_plane --plan p.json --collector-capabilities caps.json --emit-collector-views cv.json(q01 alone, today's collector){"planner_wire_version":16,"plan_id":"…","backend_reads_raw":{"data":false},"outputs":[1],"dag":{…Scan n0, chain n1…}}; prints each node above the chain with its first failing rule, hereNotInCapabilities("operator TimeRange"),…SummaryMerge,…SummaryEstimate,…Projectsum_over_time(data[5m])outputs = [q01's chain]; the exact chain isNotInCapabilities("summary ExactAggregate(…)");backend_reads_raw.data = truedata{job=~"a.*"}ScanisNotInCapabilities("predicate op Regex")(data{job="a"}keeps the chain)SummaryMergeWindows) at ingestionoperator SummaryMergeWindows); with{"kind": "SummaryMergeWindows"}added tooperators, it becomes a collector view too (the cut moves up)data_plane --plan p.json --collector-views cv.jsondatasamples are not stored--collector-viewsof another planthe collector views are of plan …, not of the plan installed (…)Design scope
Scansource and predicates,Filterpredicate, chain/SummaryAggreduction, filter, summary type, input kind and θ), the node's timing, and its reduction againstplacement. Predicates must be conjunctions of a column compared with aUtf8literal by a listed op. θ is checked against each declared range by name.Scanoutput that is not a materialized view is unassigned with every assigned node above it, until none is left (v1, §1). The sub-DAG holds the assigned non-Scannodes and theScans feeding one, with the edges between them,roots = outputs; it validates on its own (materialized_views()gives each output's installed key, tested).backend_reads_raw: a metric stays raw when one of itsScans runs at query time, is not assigned, is a root, or feeds a node off the collector.CollectorViewsFileis incommon(the design puts it incontrol-plane): the data plane reads it and depends oncommon, not on the control plane.CollectorViewOptions::plan_idis checked byPrecomputeEngine::start, so it holds on every install, not only at startup. (The installer installs the query engine first; at startup a refused install ends the data plane, so nothing serves the half-installed plan.)sourcesonly onScan,reductionsonly on a chain orSummaryAgg, names must be variants, no kind twice. AnAggregate's grouping is decided by rule (d) alone.Scan,Filter,Project,TimeRange/TimeShift/TimeRangeCover,SummaryEstimate,FinalizeExactAccumulator,SummaryMergeWindows,SummaryMergewithoutgroup_by) are local; a grouping is local only under{"labels": L}withL ⊆ G; anything else (joins, binary operators, sorting, limits, populations) is not.precompute'sDagIndexis in the engine crate, which the control plane must not depend on, and the planner's DAG has no traversal helpers.Deviations from the design document (to fold into #885)
collector_sub_dag(plan, capabilities) -> Result<…, InstallablePlanError>(the design: noResult): a plan whose views do not derive, or a cut that does not stand as a DAG, is an error instead of an empty file.CollectorExecutoris deserialized by hand, not with#[serde(flatten)], becauseDeploymentCapabilitiesdenies unknown fields; the rule reads only itssupported_summariesentries today (the planner'sDeploymentCapabilitiesbuilt from them is not needed yet, so no method builds it).control-planedepends onasap-types(the IR the rule reads, whichasap-plannerdoes not re-export) andcommon(the file), not "unchanged".--planreads a plan written before and only writes its collector views (it needs--collector-capabilitiesand conflicts with the planning flags).planner_wire_version(the collector checks it, §3; the plan id covers the data plane) norbackend_reads_raw(the collector's raw-forward filter uses it).Interfaces
crates/common/src/collector_views_file.rscrates/control-plane/src/collector_views.rscrates/precompute/src/collector.rspub struct CollectorViewOptions { + pub plan_id: Option<String>, pub views: BTreeSet<PhysicalASAPNodeId>, } +impl From<&CollectorViewsFile> for CollectorViewOptions;CLI: control plane
--plan,--collector-capabilities,--emit-collector-views(--workloadand--outnow optional together with--plan); data plane--collector-views.Usage
crates/data-plane/tests/collector_views.rs::the_collector_views_file_makes_the_chain_a_collector_view, run at this commit:Open questions
input: "label"accepts any label-item summary whatever its weight (count or per-key sum of the sample value). Today's collector's label sketches: do they weight by the sample value or count 1? Recommendation: let the collector's entry state it ("input": "label_count"/"label_value"), or require weight 1 until it does. No benchmark query has a label-input view, so it does not change any cut today.Tests
control-plane/tests/collector_views.rs(rule, with today's collector's capabilities as the design prints them,tests/data/collector-capabilities.json, and synthetic variants): a leaf sketch chain is the one collector view (sub-DAG,backend_reads_raw = false, a reason for every other node); an exact view over the same metric keeps it raw; a missing sketch, an out-of-range α and a regex matcher leave the chain in the backend; aReducechain is local only under{"labels": L}withLamong its keys; one operator line moves the cut up to the wider level; the file reads back and its views keep their installed keys; unknown capability versions, unknown fields, limits on the wrong operator, unknown limit names and an operator listed twice are refused.data-plane/tests/collector_views.rs: the file written by the rule wires the collector view end to end (equal answers, raw samples not stored); a file of another plan is refused at install.cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace(ulimit -n 65536): 265 passed, 0 failed, 3 ignored (the previous PR plus 9 new).forward_mode::bodies_wait_for_a_raw_store_that_is_down, a known load-dependent flake of the base stack (it passes alone, 3 of 3); fmt and clippy clean. Parity dump vs feat(precompute): close an idle stream's last windows by wall-clock time #889 at this head: byte-identical (70,736 B).decode_benchRemote Write 0.103–0.106 vs 0.103–0.104 µs/sample, OTLP 0.110–0.111 vs 0.111 µs/sample;ingest_bench 1000 120 viewswindows refreshed after 0.89 s vs 0.88–0.89 s (one slow outlier run on each tree, 4.10 s new and 1.32 s base). No regression.control_plane --workload … --deployment-capabilities '{"raw_data_retained": false, …}' --out p.json --collector-capabilities caps.json --emit-collector-views cv.jsonwroteoutputs [1],backend_reads_raw {"data": false}(and, before this restack, the grace, now removed);data_plane --plan p.json --collector-views cv.jsonserved/v1/metrics(200); with the plan id edited it refused to start.