docs(grpc-data): plan §5.1/§5.5 — readiness is withheld snapshot_complete; a deploy ends the condition stream; removal/begin bypass the version gate; A3 removes an over-total item

This commit is contained in:
Joseph Doherty
2026-11-24 14:59:39 -05:00
parent c709fbc1c4
commit 0b827a3f81
@@ -536,7 +536,10 @@ conditions re-report (`NM:5639-5651`). Some state changes never produce an event
- On a Warm standby native drivers do not run, so native conditions stay unknown until promotion. The standby's scripted
engine is warm, so its scripted conditions are already known. The stream is Primary-only by default.
`snapshot_complete` is withheld until the origin's current address-space apply has completed (`CompleteAddressSpaceApply`
ran for the active generation) and the serving node holds its Primary verdict. Until then the stream sends a Control `NotReady`.
ran for the active generation) and the serving node holds its Primary verdict. **Readiness is expressed by withholding
`snapshot_complete`** (A2 review: there is no `Control NotReady` kind — a new control kind would be a new v1-decoder shape):
until the origin is ready the item's snapshot ends without `snapshot_complete`, and the item retakes the snapshot (≥ 1 s
apart) once the hub reports apply-complete and Primary. A consumer treats "no `snapshot_complete` yet" as not ready.
- **Readiness is cut with the snapshot (A1 review S3).** Each slice records the apply generation and the complete flag
under its own hold. A2 sends `snapshot_complete` only when `ConditionStateHub.IsSnapshotCompleteFor(slices)` holds: every
hold saw a completed apply of one generation, and the node is Primary. Otherwise it retakes the snapshot.
@@ -719,7 +722,17 @@ discovery and no recursive Browse:
- records carry `condition_key`, placement views in the export's realm, `ConditionInfo` (on first appearance in an epoch and
in every snapshot), state, `state_known` and a `removed` flag;
- `snapshot_complete` ends the snapshot.
- Conditions added or removed by a later origin deploy are ordinary delta records, so "complete" is well defined.
- **Lifetime rule (A2 review S1).** An origin deploy **ends the condition stream**: every deploy begins a catalog attempt
(`LocalCatalogCoordinator.BeginAttempt`), which unpublishes the catalog and changes the serving identity, and a condition
item cannot outlive the serving identity it was admitted under. Conditions a deploy adds or removes therefore never arrive
as delta records; the consumer reconnects and takes a **complete snapshot** of the new catalog, so "complete" is well
defined. A3's consumer must treat the stream's end as "re-snapshot", never as "conditions removed". (A `removed` record can
still arrive within one serving identity — a hub removal record, or a listing change without a catalog attempt — and the
version rule below covers it.)
- **Version rule (A2 review N2).** Versions are the origin hub's global versions, strictly increasing per key for state
records. Two records bypass the consumer's per-key version gate: a **`removed`** record (a synthesised removal carries the
hub watermark, which can equal a version already sent for the key) and a **snapshot begin** (it resets every key; the
snapshot's records carry their slice watermarks). A3 applies a removal unconditionally and forgets the key's version.
- It counts as one monitored item against v1 limits and as `total` against the condition budgets.
**Demand (Q1, settled).**
@@ -767,7 +780,9 @@ Defaults (conditions get their **own** budget; worst case is 49 nodes):
stays for folders and variables; placement folders charge it as ordinary projected folders.
- **Admission before materialising:**
- `total > MaxConditions` ⇒ that mapping is `Unavailable(ConditionCapacity)` at snapshot begin, with the observed count in
diagnostics;
diagnostics; **A3 removes the item** whose begin `total` exceeds its mapping limit (the origin parks an over-limit item
with `total` reported and nothing else, but a consumer must not hold it open — it costs an item slot and the origin's
re-listing on every deploy);
- when the connection's new conditions would exceed either host cap, the mappings that would cross it are rejected the same
way, in deployed order.
- It stays all-or-nothing per mapping, because a partial set makes ConditionRefresh lie. The cliff is moved to an explained,
@@ -1278,7 +1293,8 @@ Expected: identical rows/status/timestamps to the origin; continuation followed
- transport drop ⇒ `OutcomeUnknown`, no retry;
- audit text sanitised, in the audit log only, `AlarmCommand` untouched;
- R: stream priority, overflow ⇒ reset, revocation mid-snapshot, header-less stream never receives arm 9; an origin deploy
adding and removing conditions arrives as delta records; `total` above the limit is reported before any record;
ends the stream (the consumer re-snapshots, §5.5 lifetime rule — corrected by the A2 review; the earlier "deploy add/remove
arrives as delta records" was unreachable in production); `total` above the limit is reported before any record;
- F/P/U as in H2.
- Exit gate: A2 manifest; **recorded-v1-client compatibility gate**; security/mutation review (owner accepted the §5.5
service-principal model; the review checks its implementation).