fix(grpc-data): bound the unknown-mapping hold of imported conditions (#933)

A key no known mapping lists was kept stale for as long as ANY mapping of the
connection was unknown; a durably Denied/Unavailable mapping therefore kept
retired conditions forever. Scoping the hold to mappings that could list the
key is not provable on the consumer (placements are origin deploy-time config;
a dropped key may have moved into the unknown mapping's root), so the hold is
time-boxed per key: ProjectedConditionOptions.MaxUnknownHold (20 min) — past it
the key is removed (+ RefreshRequired at the sink), never known-inactive. The
since-time survives stream ends and hand-overs; the earliest expiry shares the
loop's retry timer. DataConnections.md: lifetime rule + troubleshooting row.
This commit is contained in:
Joseph Doherty
2026-11-25 10:56:23 -05:00
parent 179881f45c
commit 2eb31f62d2
4 changed files with 100 additions and 7 deletions
+7
View File
@@ -453,6 +453,12 @@ refresh, EventIds) is documented in [Alarm tracking § Imported conditions](Alar
- An in-stream re-snapshot is buffered. The live set and the nodes stay untouched until `snapshot_complete`.
- A condition is removed only when a **complete** snapshot no longer lists it (and no other mapping lists it), or when a
`removed` record arrives. An incomplete snapshot removes nothing. It marks the unlisted keys stale (`BadNoCommunication`).
- That hold is bounded per key (#933). A key no known mapping lists, kept stale because another mapping of the connection
is unknown (`Unavailable`, `Denied`, retrying), is removed after `ProjectedConditionOptions.MaxUnknownHold` (20 min,
fixed): a removal with `RefreshRequired`, never "known inactive". If the unknown mapping later lists it, it is re-created
(new EventIds). The hold cannot be narrowed to "mappings whose scope could list the key": an origin deploy can move a
condition's placements into the unknown mapping's root, so the consumer cannot prove it. 20 min outlasts the transient
retry cycle (snapshot timeout × 8) and the first two re-checks of a definitive refusal (`LongRetryDelay` 5 min, then 10).
7. **Known state (T2 invariant).** *The consumer never retires or clears an alarm that is active at the origin.*
- A record with `state_known = false` never changes the consumer's last state.
- A condition first seen unknown is materialised with `Quality = UncertainInitialValue` until a known record arrives.
@@ -631,6 +637,7 @@ status and diagnostic), and each snapshot barrier (per-mapping status, record co
| `ConditionCapacity` | The listing's `total` against the mapping's or export's `MaxConditions`, and the host caps. Narrow the remote root or raise the limits. |
| Conditions `Uncertain` | The origin has not established their state: a scripted alarm has not completed an evaluation; a native driver has not signalled (see `…conditions.unsignalled`). |
| Conditions `BadNoCommunication` | Stream down longer than `ConditionStaleTimeoutMilliseconds`, or the mapping was incomplete at the last barrier. |
| A retired condition stays `BadNoCommunication` while another mapping of the connection is `Unavailable` / `Denied` | Expected for up to `MaxUnknownHold` (20 min, #933): the unknown mapping might still list it, so it is held (T2). After that it is removed with `RefreshRequired` (logged Warning "held past MaxUnknownHold", naming the unknown mappings). Fix the unknown mapping (its refusal is on the AdminUI mappings line) to settle it sooner. |
| Ack answers `BadEventIdUnknown` | The client holds an old EventId (superseded occurrence, or an origin restart that re-announced a different time). ConditionRefresh and ack with the new EventId. |
| Ack answers "OutcomeUnknown" | Check the origin's audit log (`ZB.MOM.WW.OtOpcUa.DataConnections.Audit`) for the operation and watch the condition's events. Never replay blindly. |
| All `ConditionId`s changed | `ConditionKeySecret` was rotated or differs between the origin pair members, or the connection was re-created under a new id. |