Merge master into #937 (scenarios: keep A09 + F937)

This commit is contained in:
Joseph Doherty
2026-11-28 11:32:41 -05:00
82 changed files with 5349 additions and 210 deletions
+74 -6
View File
@@ -90,6 +90,40 @@ reply cannot lengthen it. Renewal grants no parent or sibling visibility, Browse
local Browse privilege. Missing capability, denied Metadata or an invalid lease leaves the item
unavailable until valid authority can be established.
**A lapsed lease is not an access denial (#922).** A projected node idle longer than its mapping's
`MetadataLeaseMilliseconds` keeps its retained proof; the lease is only *lapsed* when its time ran
out or its route was replaced while the local catalog authority, mapping binding and cache
generation are all still current and nothing revoked it. On a refused value Read / attribute Read /
HistoryRead of such a node, the consumer first authorizes the caller against the lapsed subject
(local grant + mapping bit, everything but the lease). A caller without the grant is still
`BadUserAccessDenied` and nothing is sent to the origin. A granted caller gets the same exact
`GetMetadata` renewal as above, for the operation it is performing (Read / HistoryRead bit, not
Subscribe), one per node and operation at a time, with a 250 ms back-off after a failure. On-demand
renewals never touch the unary budget (cold reads, writes) or the browse/subscription-renewal fetch
slots: they queue (at most 64) for their own pool of `max(1, maxConcurrentFetches / 2)` origin calls,
reserve 256 KiB each, and have 3 s end to end, so a batch of N lapsed nodes renews all N:
- **Value Read** answers `BadWaitingForInitialData` (as a cold read does) while the renewal runs off
the request thread; once it commits, a read is scheduled so the client's retry is served from the
fresh sample. `BadResourceUnavailable` while a renewal cannot be started (capacity, back-off).
A non-Value attribute of a lapsed node answers `BadResourceUnavailable` while it renews.
- **HistoryRead** renews within the request and is then served. The wait (one per batch, at most 4 s
and never past `HistoryReadDeadline`, no node-manager `Lock` held, the request's cancellation
honoured) takes one of the non-local history batch slots first. A batch that finds none free does
not wait. A renewal that cannot complete (origin unreachable or silent, no slot) answers
`BadResourceUnavailable`. A renewal that succeeded while the node manager's ACL veto still refuses
answers `BadUserAccessDenied`.
- **Browse:** a cached page past half its lease is served as is *and* refreshed in the background
(one refresh per page key), so a re-browse renews the leases of the nodes it lists.
An origin that stopped granting the operation fails the renewal; the consumer then keeps answering
the retryable status (it cannot tell that from an unreachable origin).
Not covered yet: a **Write** or **CreateMonitoredItems** on a lapsed node is still refused
`BadUserAccessDenied` (neither starts a renewal; a re-browse, a Read or a HistoryRead of the node
renews it, after which they succeed). A lease that was revoked (`Invalidate`), a removed mapping and a
retired node are refusals, not lapses, and are never renewed.
An authorized logical monitored-item request can survive a physical stream expiry and seek a new
pinned binding with bounded retries. The old binding and any queued sample evidence remain tied to
their original authority and serving generation. The same item needs a fresh, complete baseline
@@ -170,11 +204,35 @@ advertisement and a per-call request header, `x-otopcua-data-features`, whose va
- The new RPCs (`HistoryRead`, `CallConditionMethod`) answer `FailedPrecondition("feature not negotiated")`. A
history-only call is also refused `CallConditionMethod`.
- Header-less goldens (`*Goldens.cs`) and the recorded-v1-client gates (`GrpcDataV1CompatibilityTests`,
`GrpcDataV1RealOriginCompatibilityTests`) pin the v1 bytes. Every phase ran them with an empty goldens diff.
`GrpcDataV1RealOriginCompatibilityTests`) pin the v1 bytes. Every phase ran them with an empty goldens diff. The two
pre-deploy corrections below are the only deliberate differences. The real-origin gate applies them to the recorded
goldens in `GrpcDataV1RealOriginCorrections`; the goldens are never re-recorded.
Fix two v1 defects before any v1 deploy. #916: `stable_source_id` leaks the driver id and RawPath to UNS-only peers.
#917: v1 exports alarm-bearing raw tags as variables that never get a value. G0, the v1 deploy and soak (#915), is still
open; see the plan's §1.1.
### What an origin exports (v1 corrections #916, #917)
v1 was merged but not deployed (#915), so two defects were fixed in v1 itself. Header-less callers get the fix too.
Neither change alters the wire shape: one drops an optional field, the other drops a page item. Evidence: `docs/plans/evidence/grpc-data-ext/V1-916-917.md`.
- **No `Metadata.stable_source_id` (#916).** The origin never sends field 10. It used to carry the internal acquisition key,
which for a driver tag is `<len>:<driverInstanceId><RawPath>`. That disclosed driver ids and RawPaths to peers holding
only a UNS export.
- No consumer used the field except for byte accounting, so it was dropped rather than replaced by an opaque id. A
stable opaque id would only let a peer correlate Raw and UNS nodes.
- The field is `optional`. Old consumers decode its absence as null, so every version mix works.
- Conditions dedupe on the keyed `condition_key` instead.
- Internally the origin still keys acquisition on the unchanged `BackingSourceKey`.
- **Alarm-bearing raw tags are not exported as values (#917).** A tag with an alarm config never gets a value: the driver
host keeps it out of the value fan-out, and #896 gives it no UNS variable.
- The origin compiles it as an unsupported value node. GetMetadata, Read, Subscribe and HistoryRead on it answer
`Unsupported`, and writes are refused.
- **Browse does not list it**, and the same holds for any unsupported value node, such as a data type v1 cannot carry.
Every consumer build applies a browse page all or nothing and cannot materialise an `UnsupportedVariable`. Listing one
made the whole folder unbrowsable on the consumer (`BadNoCommunication`); the live gate found this.
- The node stays in the catalog, so an export rooted at it still compiles. Such a root grants nothing: the values are unsupported, and the condition sits under the tag's folder, not under the tag.
- The alarm itself is forwarded as a **condition** (A1–A4, see "Condition forwarding end to end"). Condition placements
do not depend on the value node.
G0, the v1 deploy and soak (#915), is still open; see the plan's §1.1.
## Remote history (runtime consumers)
@@ -200,6 +258,10 @@ the bit (see "Mixed versions" below); the AdminUI editor shows a reminder.
**Negotiation.** The capabilities probe always asks for `history`; an origin advertises it only when a historian backend
is configured. Other calls carry the header only toward an endpoint that advertised it. An origin without a historian, a
pre-H2 origin, or a call without the header answers unsupported — the v1 responses are unchanged.
Live-gated against a real pre-H2 origin (#921, `docs/plans/evidence/grpc-data-ext/H05-v1-origin.md`): a pre-H2 origin
ignores the probe's header (capabilities byte-identical with and without it), so the consumer's projected variables have
`Historizing` False, HistoryRead answers `BadHistoryOperationUnsupported` locally, and no HistoryRead or feature-headed data
call is sent. (Sent anyway, a HistoryRead is refused `PERMISSION_DENIED` by the old data listener's v1 method allowlist.)
**Limits.**
@@ -479,8 +541,14 @@ refresh, EventIds) is documented in [Alarm tracking § Imported conditions](Alar
is raised on the hub.
- `DataConnections:ConditionKnownSettle:OpcUaClient` (default 60 s) is the only backstop timer. It exists for upstreams
without ConditionRefresh.
- Open gaps: #924 (L4 latency for Galaxy, Heidenhain and real Logix ALMD), #925 (Galaxy deploy-added conditions stay
unknown) and #926 (an OpcUaClient RefreshEnd can signal known over lost events).
- Open gaps: #924 (L4 latency for Galaxy, Heidenhain and real Logix ALMD) and #925 (Galaxy deploy-added conditions stay
unknown).
- An OpcUaClient RefreshEnd signals only for a lossless refresh bracket (#926). Loss inside the bracket — queue
overflow, RefreshRequired, a skipped publish gap, or a missing RefreshStart — suppresses the signal and re-runs
ConditionRefresh, at most 3 times per episode. If every retry is lossy, the conditions stay unknown and the timeout
diagnostic reports them. A loss after the signal **withdraws** "known" for that subscription's conditions
(`AlarmInitialStateEventArgs.Withdrawn` ⇒ `MarkConditionsKnown(Known: false)`, F5 re-armed, no backstop) until a
clean refresh signals again. See `docs/drivers/OpcUaClient.md`.
### Condition key (`DataConnections:ConditionKeySecret`)