Skip to content

Commit bccb189

Browse files
committed
docs: illustrate SDS identity and recovery decisions
1 parent 8857f25 commit bccb189

2 files changed

Lines changed: 84 additions & 25 deletions

File tree

‎docs/design_docs/asapplanner-integration.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,13 @@ A physical graph may be embedded or referenced within the bundle; either way,
9696
its operator vocabulary and computation remain Planner-owned. The backend does
9797
not copy it into a second set of Build/Merge/Estimate node variants.
9898

99+
Two concrete decisions govern these bindings:
100+
101+
| Design question | Decision and example |
102+
| --- | --- |
103+
| What identifies the source dataset? | Tenant A's and tenant B's `KLL(latency)` have different definitions. Moving tenant A's dataset to another endpoint preserves its definition. See [source identity examples](summary-catalog-sds-architecture.md#source-identity). |
104+
| Can a new plan version reuse old state immediately? | Version 43 populates its own state even if version 42 has the same definition. Same-version restart can recover eligible records. See [recovery examples](summary-catalog-sds-architecture.md#recovery-and-plan-version-changes). |
105+
99106
Bindings attach only to declared physical boundaries:
100107

101108
```text

‎docs/design_docs/summary-catalog-sds-architecture.md‎

Lines changed: 77 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,42 @@ must not force state migration. Unknown semantic versions fail validation.
116116
117117
### Source identity
118118
119-
Source semantics include a stable logical dataset identity, supplied by Backend
120-
to Planner before semantic definitions are exported. It distinguishes datasets
121-
and includes their semantic namespace where needed, such as tenant scope.
122-
`KLL(latency)` over tenant A's dataset and tenant B's dataset therefore has different
123-
definition IDs, even when field names and types match. An endpoint, replica or
124-
storage location is a deployment binding and does not change dataset identity.
125-
126-
The authority resolving a source must preserve that identity across relocation
127-
and assign a different identity when the logical dataset changes. Installation
128-
validates that the concrete binding realizes the identity in the definition.
129-
Definition equality never grants cross-tenant or cross-deployment authorization.
130-
Future discovery must match source identity as well as expression semantics.
119+
**Design question 1: What identifies the source data in a SummaryDefinition?**
120+
121+
Two deployments both compute `KLL(latency)`. One reads tenant A's dataset and
122+
one reads tenant B's. Should they have the same definition ID?
123+
124+
**Decision:** no. Backend supplies a stable logical dataset identity to Planner
125+
before semantic definitions are exported. Dataset identity is part of semantics;
126+
endpoint, replica and storage location are deployment bindings.
127+
128+
```text
129+
Same expression, different datasets:
130+
131+
tenant-A/requests → KLL(latency) → definition D_A
132+
tenant-B/requests → KLL(latency) → definition D_B
133+
134+
D_A ≠ D_B
135+
136+
Same dataset, different endpoints:
137+
138+
tenant-A/requests ── bound to endpoint east ── definition D_A
139+
tenant-A/requests ── bound to endpoint west ── definition D_A
140+
141+
Relocation preserves D_A when the logical dataset is unchanged.
142+
```
143+
144+
| Change | Definition identity | Binding requirement |
145+
| --- | --- | --- |
146+
| Tenant A's dataset → tenant B's dataset | Changes | Bind the newly identified dataset |
147+
| Endpoint east → endpoint west for the same dataset | Unchanged | Verify the endpoint realizes the same dataset |
148+
| `latency` → `log(latency)` in the same dataset | Changes | Preserve the new input expression |
149+
150+
The authority resolving a source preserves dataset identity across relocation and
151+
assigns a different identity when the logical dataset changes. Installation checks
152+
that the concrete source realizes the identity in the definition. Equal definitions
153+
do not grant cross-tenant or cross-deployment authorization. Future discovery must
154+
match dataset identity as well as expression semantics.
131155

132156
### Definition boundary
133157

@@ -328,19 +352,47 @@ completeness and source event-time completeness.
328352

329353
### Recovery and plan-version changes
330354

331-
The initial rollout recovers records only under the same authoritative installed
332-
plan version and compatible bindings. Persisting definitions and payloads does
333-
not itself make admission metadata durable or establish exactly-once processing
334-
across crashes. Recovery must re-establish required eligibility; missing proof
335-
cannot be treated as complete input.
336-
337-
A new plan version populates its own output namespace. Even a scheduling-only
338-
change with equal definition IDs does not automatically adopt the old version's
339-
records. Queries use the new version's installed fallback or unavailability policy
340-
until its state is ready. This entails rebuild work and a warm-up interval.
341-
In-flight runs retain their installed version, and cleanup respects active readers.
342-
Explicit cross-version state adoption is deferred to a separate compatibility and
343-
authorization design; it is not part of initial recovery or binary rollback.
355+
**Design question 2: Must the initial rollout reuse stored state across plan versions?**
356+
357+
Version 42 already stores `KLL(latency)`. Version 43 changes only the scheduling
358+
policy and keeps the same semantic definition. Can version 43 read version 42's
359+
records immediately?
360+
361+
**Decision:** no. Initial recovery supports the same installed plan version.
362+
Each new version populates its own output namespace. Cross-version state adoption
363+
is deferred, even when definitions match.
364+
365+
```text
366+
Existing deployment:
367+
version 42 → output latency-kll → definition D → ready records
368+
369+
Restart version 42:
370+
recover version-42 records
371+
→ validate bindings and required completeness proof
372+
→ serve eligible state
373+
374+
Install version 43 (same definition D, changed schedule):
375+
version 43 → output latency-kll → definition D → no ready records yet
376+
→ populate version-43 state
377+
→ fallback or unavailable while warming up
378+
→ serve version-43 state when eligible
379+
380+
Equal D does not authorize reading version-42 records from version 43.
381+
```
382+
383+
| Event | Initial-rollout behavior |
384+
| --- | --- |
385+
| Restart the same installed version | Recover compatible records and revalidate eligibility |
386+
| Install a new version with equal definitions | Populate new-version state; no automatic adoption |
387+
| Query before new-version state is ready | Apply the installed fallback or unavailability policy |
388+
| Old-version query already in flight | Keep its installed version; cleanup respects active readers |
389+
390+
This choice incurs rebuild work and a warm-up interval. Persisting definitions
391+
and payloads does not itself make admission metadata durable or establish
392+
exactly-once processing across crashes. Missing completeness proof cannot be
393+
interpreted as complete input after restart. Cross-version adoption requires a
394+
separate compatibility and authorization design; binary rollback does not itself
395+
authorize it.
344396

345397
## 7. Future: discovering SDS for an unregistered query
346398

0 commit comments

Comments
 (0)