From 0b827a3f81eb05f78a37cc1a8ee4cd0b6e385e2e Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 24 Nov 2026 14:59:39 -0500 Subject: [PATCH] =?UTF-8?q?docs(grpc-data):=20plan=20=C2=A75.1/=C2=A75.5?= =?UTF-8?q?=20=E2=80=94=20readiness=20is=20withheld=20snapshot=5Fcomplete;?= =?UTF-8?q?=20a=20deploy=20ends=20the=20condition=20stream;=20removal/begi?= =?UTF-8?q?n=20bypass=20the=20version=20gate;=20A3=20removes=20an=20over-t?= =?UTF-8?q?otal=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...pc-data-connections-history-alarms-plan.md | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md b/docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md index 9ec76646b..9c518385b 100644 --- a/docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md +++ b/docs/plans/2026-11-23-grpc-data-connections-history-alarms-plan.md @@ -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).