docs: sid lifecycle design + distributed asapquery-backend extension sketch - #193
Merged
Merged
Conversation
Companion to PR #190 + #192. Captures the registry-allocated sid model that landed there: identity contract, end-to-end architecture diagram, wire-case table, failure-recovery sequence diagrams (cold start, stale sender sid, restart with/without persistence), durability semantics, and a multi-shard extension sketch. The distributed section is forward-looking (none of it implemented today); it proposes ID-space partitioning via the top 8 bits of the u64 sid as `shard_id` so backends can mint independently while sids stay globally unique by construction. Covers query fan-out, HA options within a shard, and a single → sharded migration path that needs no proto change and no collector update. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Adds
docs/design-sid-lifecycle.md— a design doc capturing the registry-allocated sid model that landed in PR #190 + PR #192, plus a forward-looking extension to distributed asapquery-backend.Contents
sid = registry-allocated u64 for (metric, attrs_fingerprint, agg_kind_canonical). Uniqueness by construction (AtomicU64::fetch_add), not by hash probability.SeriesIdResolver,SketchStore, ingest paths, query path).hash(tenant, metric); a single metric's series stay on one shard so warm-tier merges stay local.shard_id, bottom 56 bits = local counter → no mint coordination, global uniqueness by construction, O(1) sid-to-shard routing.shard_idfrom sids and routes per-shard reducer RPCs.ResolveSeriesIDsRPC fate, WAL compaction, per-tenant sid subspace, collector-side routing colocation, cross-shard PromQL semantics.What this doc does NOT do
docs/design-controller-into-backend.md— that's still the canonical reference for the broader controller-into-backend refactor; this doc cross-references its §5.4.Test plan
data_plane/src/drivers/ingest/otel.rsand confirm the wire cases match.(tenant, metric)the right sharding key, or should it be something else (per-tenant, per-resource_attrs)?🤖 Generated with Claude Code