docs(grpc-data): A4 review round 1 — findings table, red/green, S4 decision, gates, live a4r1-cond-1 PASS
This commit is contained in:
@@ -208,3 +208,47 @@ behaviour change, so OpcUaServer.Tests full and the live smoke were not re-run):
|
||||
|
||||
- File: production L5 count (blocked, above). #928 resolved above (test defect, tests fixed).
|
||||
- Not done here: A01–A08, reviewer approval, the ScadaBridge consumer-impact record, docs (other worktree).
|
||||
|
||||
## Review round 1
|
||||
|
||||
Review written at `3be51e3b` (approve-with-changes: 1 blocker, 4 should-fix, NITs). Fixed on `a4-code` after `b2fab8b07`.
|
||||
"Red" = the fix reverted alone (scratch copy, file restored afterwards), the named test re-run alone.
|
||||
|
||||
| Finding | Outcome | Test | Red when reverted |
|
||||
|---|---|---|---|
|
||||
| **B1** second capacity reset reused `"remove-{mapping}"` ⇒ transport refuses it, stream ends | Fixed: `"remove-{mapping}-{guid}"`. Every command id the runner builds was checked: `open` (once per stream), `retry-{mapping}-{guid}`, `remove-retry-{guid}`, and the new `remove-late-{guid}` (S2) are unique. The test fake (`FakeStream.SendAsync`) now **refuses any command id already used on the stream**, as `GrpcDataConnection` does (`_usedCommands`) — this is what hid the defect. | `N3_a_retry_still_over_capacity…` (+ asserts no new stream and two removes) | **red** (the strict fake alone, before the fix, and the fix reverted) |
|
||||
| **S1** retry timeout dropped buffer + claim, so a retry snapshot slower than the timeout never completed | Fixed: a retry deadline keeps the buffer and claim, like the initial barrier timeout; the late completion swaps in. The buffer (and its claim) are dropped only when the next retry removes the item and re-adds it. Comment, `RetryDueAsync` doc and `DataConnections.md` now say so. | `R1_S1_a_retry_snapshot_slower_than_the_timeout_still_completes_late…` | **red** |
|
||||
| **S2** a late ack after the retry was replaced left an orphaned origin item; re-adds refused `InvalidArgument` forever | Fixed both ways: (1) a command replaced before its ack is remembered (`Superseded`, ≤ 8 per mapping); a late Good ack of it sends `RemoveSubscriptionItems` for that handle at once; (2) backstop: 3 consecutive `InvalidArgument` refusals of a mapping's in-stream re-adds end the stream (`MaxInvalidArgumentRefusals`). | `R1_S2_a_late_ack_of_a_superseded_retry_removes_the_orphaned_origin_item…` (fake origin acks retry #1 after #2 was sent); `R1_S2_consecutive_InvalidArgument_refusals…backstop` | **red** / **red** |
|
||||
| **S3** N5 overlap allowance let another mapping's held stale keys count as overlap, exceeding the host caps | Fixed: an unknown mapping's claim is reduced only by the held-unlisted keys **it** listed when last known on this runner (`_lastListed`, kept only while it has no committed set; `HeldOverlap`). Charge = `max(Materialised, known + Unlisted + Σunknown − min(Unlisted, Σ min(claim, overlap)))`. `Unlisted` is now reset to everything held at each stream start (nothing contributes yet) — before, it carried the last barrier's value (0 after a complete one), which is how the review's counter-example got in on a new stream. Residual (documented in `DataConnections.md`): a mapping whose origin retired its old keys and lists new ones, while another mapping is unknown, can exceed by at most its own previous count until known; logged and on the AdminUI budget line. | `R1_S3_another_mappings_held_stale_keys_are_not_overlap…` (the review's counter-example at 3-condition scale); `N5_…` still green | **red** (old formula) |
|
||||
| **S4** SourceName depended on runtime mapping status | **Decision: keep SourceName stable.** `Merge` remembers per key the mapping that chose its SourceName; while that mapping is deployed, higher in the deployed order, and merely not contributing (refused / Unavailable / retrying / ConditionCapacity / Pending on a new stream), the held SourceName is kept. Placements and notifiers still follow the contributing mappings (visibility unchanged: SourceName is a display field, no access decision reads it); no removal or known-inactive decision involved (T2 unaffected). It moves when that mapping is known again and no longer lists the key, when it is no longer deployed (new runner ⇒ recomputed: the A3 "disabling the primary mapping moves SourceName" behaviour holds), or when a higher-priority mapping lists the key. Residual: a key first seen while the Raw mapping is unavailable starts with the UNS SourceName. `AlarmTracking.md` and `A4-docs.md` ScadaBridge item 1 updated (add both cases to ScadaBridge#147). | `R1_S4_SourceName_stays_on_the_deployed_primary…` (with a positive control: Raw known again without the key ⇒ moves) | **red** |
|
||||
| Docs: DataConnections step 5 / follow-ups / metrics `side` + `refresh_required` | Already fixed by `b2fab8b07`; verified. Line on retry timeout corrected (S1), S2/S3 behaviour and the resync definition added. | — | — |
|
||||
| Docs: AlarmTracking RefreshRequired "every incomplete barrier" | Fixed: only when the incomplete set changed (#930). | — | — |
|
||||
| Docs: ScriptedAlarms "accepted and routed" vs DataConnections "applied" | Code (`LocalDataServices.ConditionMethods.cs`): scripted ⇒ `DriverConfirmedSuccess` when the origin's handler applied it; native ⇒ `AcceptedUnconfirmed`. `ScriptedAlarms.md` now says "applied" (DataConnections.md table was already right). | — | — |
|
||||
| Docs: A4-docs.md stale `Runner.cs` citations | Updated to current lines (`:703`, `:521`, `:951`, `:955-962`, `:966-974`). | — | — |
|
||||
| Metric descriptions said "on this origin" | `OtOpcUaTelemetry.cs` descriptions for items / resyncs / capacity_rejections / condition_methods name both sides. | — | — |
|
||||
| NIT `resyncs{side=consumer}` over-count | Fixed: counted only for a stream that opened. | `R1_NIT_consumer_resyncs_count_streams_that_opened…` (+ positive control) | **red** |
|
||||
| NIT AdminUI null-safety | `ConditionsNeedAttention` uses `Mappings?.`; `MethodCounts` takes null ⇒ "unavailable". | AdminUI `A_partial_payload_without_mappings_or_methods_renders…` | **red** (HEAD file) |
|
||||
| NIT misplaced doc comments | `NearLimit` has one summary; `HasDrops` has its `#919` summary back. | — | — |
|
||||
| NIT in-loop `ResolveRootsAsync` stall (≤ 10 s) | **Not fixed — recorded, #934.** Moving it off the loop changes the loop's concurrency shape (a second wake source, results applied on the loop); frames are delayed, not lost. | — | — |
|
||||
| NIT unpruned `_consumer` map | Fixed: `RetainConsumers` on every mapping change drops connections no deployed mapping references. | `R1_NIT_consumer_counters_of_a_removed_connection_are_pruned` | **red** |
|
||||
| NIT permanent removal block | Filed as #933 (not fixed here, per brief). | — | — |
|
||||
| NIT L1 measured on macOS Debug | Accepted as recorded. | — | — |
|
||||
|
||||
Commits: `c93290d0` (runner fixes + tests), `0cac09ce` (AdminUI, metric descriptions, docs), this evidence commit. Follow-up filed:
|
||||
#934 (in-loop root re-resolve).
|
||||
|
||||
### Gates after review round 1
|
||||
|
||||
| Gate | Result |
|
||||
|---|---|
|
||||
| `dotnet build ZB.MOM.WW.OtOpcUa.slnx --no-incremental` | 0 warnings, 0 errors |
|
||||
| `run-unit-phase.py A4` / `A3` / `A2` / `A1` / `X0` | passed (`20261125T052352…`, `…052438…`, `…052546…`, `…052655…`, `…053025…`) |
|
||||
| Host.Tests `.DataConnections.` | 207 passed |
|
||||
| Runtime.Tests full (`Category!=E2E&Category!=LiveIntegration`) | 2076 passed, 3 skipped, 0 failed (#920 did not fire) |
|
||||
| OpcUaServer.Tests full | 1458 passed, 2 skipped |
|
||||
| AdminUI.Tests full | 2708 passed |
|
||||
| OI combined (`Feature=GrpcData` + ConditionMethodEvent / NativeAlarmEventIdentityFieldDelivery / FolderConditionRefresh / ConditionRefreshDeferral), once | 138 passed, 1 skipped (opt-in L2 harness) |
|
||||
| Live `conditions_a3_smoke.py`, run `a4r1-cond-1` | `passed: true` (all 7 checks; imported `ns=6;s=c1.…`, 32-char EventId; bogus EventId ⇒ BadEventIdUnknown; ack 597 ms; exactly one Active/Acknowledged on origin and consumer) |
|
||||
| AdminUI `/clusters/{CONSUMER,SOURCE}/data-connections` (curl, control-1 admin) | 200 both; consumer-1 "Imported conditions: stream live · … · resyncs 0 · … · methods succeeded 1 · … · mappings map-raw Complete 0/1000; map-uns Complete 1/1000"; source-1 "condition items open 2 · largest listing 1/1000 · … · methods served succeeded 1" |
|
||||
| `rig.py down` | 0 run containers / networks |
|
||||
| `git diff master -- '*Goldens.cs'` | empty |
|
||||
|
||||
Reference in New Issue
Block a user