Repository navigation
Conversation
zzylol
force-pushed
the
feat/collector-views-file
branch
2 times, most recently
from
November 30, 2026 07:30
f6a3f5f to
40d0d0d
Compare
…eclared close delay (failing first) Tests for sequence numbers and delta transmission (docs/design/collector-sketch-ingest.md, section 8): the OTLP adapter decodes and checks each state's producer epoch, sequence, kind and base; two corrections with equal bytes both merge; open-window deltas answer and end at the at-close answer; a delta after a gap leaves its window unanswered; a restarted collector's full starts a new lineage and its delta without a full is never applied; the collector-views file carries the collector's window_close_delay_ms, which closes a stopped collector's windows. The existing tests' states carry a lineage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bo8kYWd83zXwh2Nobf
…he declared delay
Each collector state is a record of its (view, series, window) lineage:
the producer epoch is metric metadata (asap.producer_epoch), the
sequence, kind and base are point attributes (asap.sequence,
asap.state_kind, asap.base_sequence), decoded by the OTLP adapter into
CollectorViewStates::producer_epoch and ViewStateRecord::{sequence, kind}.
Staging replaces the envelope-hash set with per-series lineages
(epoch, last applied sequence): a full of a new epoch or a delta onto its
lineage's last record merges; an applied (epoch, sequence) is a
duplicate, so two corrections with equal bytes are two records; a delta
after a gap, with no lineage, or of a new epoch without its full is never
applied and marks its window incomplete. The committer marks the window,
and the windows of the groups reading it, in the view store
(ViewStore::mark_incomplete); a read of a range holding a marked window
fails as a missing window does (NotReady), and cached results reading it
are stale. Later records of an incomplete window are dropped and counted
(outcome incomplete). Marks go with retention.
The control plane copies the capabilities' window_close_delay_ms into the
collector-views file; CollectorViewOptions::from(file) closes idle
windows after it plus a 2 s skew allowance instead of a fixed 8 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-lineage
branch
from
November 30, 2026 08:37
e2fb68b to
9492be2
Compare
This was referenced Nov 30, 2026
Draft
Draft
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.
Review first
crates/precompute/src/collector.rs,ArrivedState::apply_toandStaging::stage): the envelope-hash set is replaced by per-(view, series, window)lineages(epoch, last applied sequence). Full of a new epoch, or a delta onto its lineage's last record → merged; applied(epoch, sequence)→ duplicate; delta after a gap / with no lineage / new epoch without its full → never applied, window marked incomplete.ViewStore::mark_incomplete,Precompute::mark_incomplete): the committer marks the collector view window and the covering windows of every group reading it;ViewStore::readfails a range holding a marked window as a missing window (→NotReady→ forwarded). Cached results reading it are stale (revision bump). Marks are pruned with retention. Later records of an incomplete window are dropped (outcome="incomplete").CollectorViewsFile.window_close_delay_ms(copied by the control plane from the collector's capabilities) + 2 s skew replaces the fixed 8 s.feat/collector-views-file(Collector views: control plane rule and collector-views file, data plane --collector-views #891) at 40d0d0d. Stack: feat(precompute): close an idle stream's last windows by wall-clock time #889 → feat(precompute): merge late samples into committed windows within retention #892 (5da5b6c) → Collector view states: ingest OTLP states of the views a collector builds, staged and committed as the view's windows #890 (b7b9312) → Collector views: control plane rule and collector-views file, data plane --collector-views #891 (40d0d0d) → this PR (9492be2). Rebased 2026-11-30 without conflicts: Collector view states: ingest OTLP states of the views a collector builds, staged and committed as the view's windows #890'sIngestion::newsplits order-sensitive groups first, then collector views; this PR's incomplete-window marking runs on the groups that split yields.Wire (ASAPCollector-public emits these)
asap.producer_epochasap.sequenceasap.state_kind"full"|"delta"asap.base_sequencesequence − 1A missing/inconsistent lineage attribute or epoch refuses the request (400,
OtlpError::ViewIdentity), as a missingsketch.envelopedoes. None of them becomes a label.Interfaces
// crates/common pub struct CollectorViewStates { pub plan_id: String, pub node_id: PhysicalASAPNodeId, pub key: ViewStateKey, + pub producer_epoch: u64, pub series: Vec<CollectorSeriesStates>, } pub struct ViewStateRecord { pub window_start_ms: i64, pub window_end_ms: i64, pub asapv1: Vec<u8>, pub sample_count: u64, + pub sequence: u64, + pub kind: StateKind, } +pub enum StateKind { Full, Delta { base_sequence: u64 } } pub struct CollectorViewsFile { ... pub backend_reads_raw: BTreeMap<String, bool>, + pub window_close_delay_ms: u64, pub outputs: Vec<PhysicalASAPNodeId>, ... } pub mod view_identity { + pub const PRODUCER_EPOCH: &str = "asap.producer_epoch"; + pub const SEQUENCE: &str = "asap.sequence"; + pub const STATE_KIND: &str = "asap.state_kind"; + pub const BASE_SEQUENCE: &str = "asap.base_sequence"; } // crates/precompute pub struct CollectorStateIngestReport { ... pub late_dropped: u64, + pub incomplete: u64, ... } +pub const CLOCK_SKEW_ALLOWANCE_MS: u64 = 2_000; -impl From<&CollectorViewsFile> for CollectorViewOptions // idle_close_ms = 8_000 +impl From<&CollectorViewsFile> for CollectorViewOptions // idle_close_ms = window_close_delay_ms + 2_000 // crates/storage +impl ViewStore { pub fn mark_incomplete(&mut self, view: PhysicalASAPNodeId, end_ms: i64) }Decisions (see the design doc §8)
Tests (run: affected only, on a remote runner; fmt + clippy
-D warningson otlp, common, storage, precompute, control_plane, data_plane)otlp: 51 passed, incl.lineage_attributes_are_decoded_and_checkedand a missing epoch ina_bad_view_identity_refuses_the_request.precomputecollector unit:corrections_with_equal_bytes_both_merge,a_broken_lineage_marks_its_window_incomplete,the_idle_close_is_the_files_close_delay_plus_skew, updatedwindows_close_through_the_newest_staged_and_later_states_merge— pass.storage:a_range_holding_an_incomplete_window_is_not_read— pass.control_plane::collector_views: 8 passed (file round-tripswindow_close_delay_ms).data_plane::collector_views: 18 passed, new:corrections_with_equal_bytes_both_merge,open_window_deltas_answer_and_end_at_the_close_answer,a_gap_leaves_the_window_unanswered,a_restarted_collector_resynchronizes_with_a_full,windows_of_a_stopped_collector_close_after_the_declared_delay.Open questions
None. Both earlier questions were answered on 2026-11-30 (design doc decisions 30–34) and are implemented in the draft PR #897, stacked on this one:
FORMAT_VERSION5 → 6; version 5 segments are still read).window_close_delay_mspasses with the base still missing.sketch.envelope(ASAPCollector-public#64). Delivery is at-least-once with no resync request. A KLL delta is a partial sketch, recorded as a departure from the reference protocol.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6bo8kYWd83zXwh2Nobf