- The Bad connectivity edge (and a Good edge with no Bad edge since the last Good one, or from a new child
incarnation) sends MarkConditionsKnown(Known: false) for the driver's condition nodes, ahead of the quality
annotation, so an alarm raised during an outage never reads known-inactive, Good after the reconnect. Stopping a
child (a respawn) withdraws too.
- DriverInstanceActor stamps a connection epoch (bumped on every Connected entry) on the initial-state signal and
on ConnectivityChanged(Connected); a signal raised under an earlier connection is dropped by the child and the host.
- G3 never discards a deferred withdrawal.
- F5 'still unknown' follows the node manager: a native transition takes its ref out of Pending.
- Re-arm F5 at the alarm-ref reindex for refs a deploy adds while connected (defensive: today such a deploy
respawns the driver because its RawTags are folded into its config).
- Nits: signals/edges from a retired or non-current child never (re)create a tracker; the injected clock replaces
DateTime.UtcNow.
- Primary demote/re-promote: checked, not a stale-known window — drivers and their condition writes run ungated on
both pair members.
NoteInputsEstablishment raised 'established' before AreInputsReady, the evidence check and the predicate, so a
pushed-but-Bad input (driver down), a runner that was not up or a predicate timeout produced a known-inactive
record though no predicate had completed. The flip is now raised after the first predicate evaluation that
completes since the load or a revert; reverting an input to never-pushed still withdraws it.
WriteAlarmCondition set _conditionStateKnown for every projection. Scripted Active is not persisted, so the
post-restart re-assert of a restored unacked/shelved/disabled alarm (or the re-projection of an operator ack
before the inputs arrived) produced a known=true, Active=false record no predicate decided (T2 case i).
Only native transitions are established states now; scripted known-ness comes only from MarkConditionsKnown.
Round-trips NodeDiagnosticsSnapshot (OriginHistory, HistoryVariants and the other H4 members) through
the serializer Akka picks for the fleet-diagnostics reply, and decodes payloads stripped of the H4
members. The origin flag is renamed NoPeerTrafficYet (default false): Akka's JSON serializer fills a
missing constructor argument with the CLR default, so a payload without it must never claim it.
HistoryServed reads 'unavailable' when neither features nor variants were reported. Features()
and DroppedBits() render every set bit across all 32 (bit 31 included), named when known and hex
otherwise, so an unknown bit is never hidden beside a known one (#919).
The origin services are composed on the first peer call (they need the driver host actor), so
CaptureOrigin returned null until then and a fresh H4 origin read like a pre-H4 build. The DI
singleton now probes the same deferred history port for backend availability and reports zeros
with PeerServicesStarted=false; the page says 'no peer has called since start'.
The consumer reads counter was fed from the gateway's outcomes, so limiter refusals, a spent
deadline, a count mismatch and refusals before the gateway were never counted, and a serve-time
fault after the gateway returned counted Good. The node manager now reports each projected node
once with the status the client sees (IProjectedHistoryAccess.RecordAnswered); a fault that
escapes to the SDK counts every projected node of the request Bad. Variant gains 'modified'.
Consumer and origin history evidence for data connections (plan §6):
- DataConnectionHistoryDiagnostics: otopcua.dataconn.history.reads{variant,status_class,side} and
otopcua.dataconn.history.continuations.active{side} on the exported OtOpcUa meter (the H2 origin
counter sat on a private meter the host never exported); the plan's unknown-bits counter is the
existing X0 otopcua.dataconnection.unknown_operations_dropped, reused
- per-connection projected answers by status class and open consumer continuations (settled on
resume claim or release); origin sessions, open continuations and answers by status class
- negotiated features and advertised history variants/aggregates per connection
- AdminUI data-connections page renders them plus the dropped unknown-operation bits (#919)
- H4 unit-phase manifest key
- b: ProjectedHistoryAccess releases the prior origin cursor on any Bad answer
to a resumed node (and on a mismatched answer) — an unsent refusal left it
open at the origin; idempotent.
- c: DataConnectionDeploymentLease, when its scope moves while a history
answer is in flight, releases the dropped answer's new continuations (best
effort); resumed items are BadContinuationPointInvalid, fresh ones
BadNoCommunication.
- d: ProjectedHistoryRead: a throw while serving outcome i (FromClr on an
unconvertible value, a store fault) releases outcome i's cursor unless the
store already owns it, and every later outcome's.
Each red on revert (mutation).
GrpcDataConnection.ServeAsync mapped RpcException(Cancelled) without a caller
cancel to BadTimeout even when the linked channel-retired / scope / shutdown
token fired. That case is now BadNoCommunication (resumed:
BadContinuationPointInvalid), releases held chunk tokens and stops a split
request sending further sub-batches. ProjectedHistoryAccess's outer catch no
longer reads any escaped OperationCanceledException as a timeout: only the
caller's cancel or the deadline is BadTimeout, otherwise classified as
FailCancelled does. Red on revert (client test: scope moved mid-call); the
outer-catch change has no dedicated test (nothing reachable throws past
ReadGroupAsync's own catch).
GrpcDataConnection.ServeSplitAsync / ServeAsync:
- S2: each sub-batch carries at most one item per 256 B of the budget left
(the origin's count <= MaxBytes/256 admission rule); the rest is
BadTooManyOperations marked ConsumerBudgetRefused, unsent, and an unsent
resumed item's origin token is released. Was: an RpcException, a recorded
endpoint failure and BadNoCommunication.
- S3: a budget refusal inside a sub-batch's own assembly latches the budget
spent; nothing more is sent.
- S1: anything escaping a later sub-batch (a caller cancel, a fault) disposes
the collected answers and releases their new continuations.
- S6: an escape from the assembly (Verify failure, item mismatch) releases
finished nodes' continuations, held chunk tokens and the rejected
response's tokens; a later sub-batch's endpoint fault is RecordFailure'd,
never swallowed.
- Nit a: after a sub-batch endpoint failure nothing more is sent to that
endpoint; the rest is BadNoCommunication / BadContinuationPointInvalid.
Each test is red on revert of its fix (mutation).
ProjectedHistoryAccess stopped the request on any BadTooManyOperations whose
diagnostic contained "budget", which also matched the ORIGIN's "remainder
budget is full" refusal and then refused later nodes, including Good ones.
DataHistoryReadResult gains an internal ConsumerBudgetRefused flag (never on
the wire) set only by the gRPC connection's own assembly refusal. Red on
revert: the origin refusal of A refused B.
1: the separate capability probe is gone (through the unary path a cancelled
probe recorded an endpoint failure and put the connection into discovery
backoff). Projected calls split at the deployed connection's batch size;
GrpcDataConnection splits again at the origin's advertised MaxBatchItems from
the capabilities the history call already negotiated, sharing the assembly
budget across sub-batches. 3: once the connection reports the assembly budget
spent, no further origin call is made. 4: an answer that never became an
outcome (mismatch, exception mid-answer) releases its new origin token. 5: a
cancel that is neither the caller's nor the deadline (a lease retired by a
redeploy) is BadNoCommunication / BadContinuationPointInvalid, not BadTimeout.
Flush delay on the access's clock. Docs: the request deadline covers the local
half too; shared non-local slots; split. Red/green for each by mutation.
Remote peers reading this node (OriginHistoryPort) and this node's projected
reads now draw on ONE N - max(1, N/4) semaphore, created together with the
N-slot batch limiter from the same N, so both together can never take the
last (local) slot (two independent first-use sizings could also disagree —
which made OriginHistoryLimiterTests order-dependent and hang the earlier
run). The projected claim loop releases every claimed cursor if anything
throws while the batch is assembled. Red/green: the shared-slot assertion
fails with a per-port semaphore.
The page API is a required member of IOpcUaClientService / ISessionAdapter (the
fakes implement it). DataConnections.md: projected slot sub-limit, per-node
fault handling, request-order runs and sub-batches. Client.CLI.md: --aggregate
now asks for the server's default aggregate configuration.
D1: a caller cancel (the projected deadline) during the connection's capability
probe escaped as RpcException(Cancelled) and faulted the whole HistoryRead; it
is now OperationCanceledException, the probe is capped by HistoryTimeout, and
ProjectedHistoryAccess fails any escaping fault per node (BadTimeout when the
deadline fired) and releases every cursor it owns. D4: calls are sub-batched at
min(the deployed connection's batch, the origin's advertised MaxBatchItems) and
at most one item per 256 B of the remaining assembly budget; a shortfall is
BadTooManyOperations per node, never an endpoint failure. D6: the release flush
is re-armed from a flag under its gate (no lost wake-up) and the stop source is
never disposed under a running flush. D7: calls are runs of consecutive request
positions read in request order, then the budget is charged in request order.
Float32 node over a Double-returning backend reads Good Singles end to end (no
KindMatches defect). Red/green for D1/D4/D7 by mutation; D6's race did not
reproduce red.
D2: Release() after TryClaimForResume() was a no-op, so a claimed cursor leaked
its origin continuation on every exit that never sent it (no gateway/identity,
deadline spent after the local half, limiter rejection, a gateway fault). New
ReleaseEvenIfClaimed() (at most once) on every post-claim exit; any exception
from the gateway now fails the projected half per node instead of escaping.
D3: projected reads hold at most N - max(1, N/4) of the N shared history batch
slots (OriginHistoryPort.RemoteSlots), Wait(0) => BadTooManyOperations for the
projected half, so a slow origin cannot starve local HistoryRead/HistoryUpdate.
D5: a Remote cursor presented to a local node (raw/modified/events take paths)
is released when it is taken. Red/green: each test fails with its fix reverted.
Found by the H3 live gate (H02): a Double Average of a UInt16 node was decoded
against the node's catalog kind and came back null + BadTypeMismatch per
interval (the result status stayed Good, which is why the wire test missed
it). Raw/AtTime values are still checked against the catalog kind; Processed
values accept any scalar kind. The wire test now asserts the interval's value.
Gate: re-browse the projected leaves after every deploy (a deploy retires cold
projected nodes; the same opaque ids come back).
Found by the H3 live gate (H02): Client.Shared sent the SDK's default
AggregateConfiguration (all false / 0), which the server refuses as a
non-default configuration (BadAggregateConfigurationRejected, #677) on local
and projected nodes alike, so CLI/UI --aggregate reads never worked against
it. Set UseServerCapabilitiesDefaults = true. OI regression test (red without
the fix) also covers HistoryReadPageAsync.
Hand-paged raw reads in one session print each page's status and continuation
(a refused resume is printed, not thrown), can hold the session across a
failover (resume when a file appears, then one fresh read), abandon a point
to the session close or release it explicitly. --at-time reads AtTime and
prints value types. Backed by IOpcUaClientService.HistoryReadPageAsync
(default-throwing interface member so existing fakes compile). Used by the
gRPC data H3 live gate on projected nodes.
A real consumer OPC UA session HistoryReads a projected variable whose
projected half is forwarded to a real origin node manager's history port:
mixed batch keeps slots, page-through to completion, single use, session
close returns the origin store count to 0, mapped grant with ACLs on and off.
Manifest key H3 (OpcUaServer.Tests + Runtime.Tests; OI runs separately — the
runner accepts unit projects only).
Resolves, authorizes (HistoryRead demand: mapping bit + local grant on the
mapping scope, ACLs on or off) and pins each projected node, groups the batch
per connection / details / issuing endpoint and forwards through
IDataHistoryService. Remote cursors bind caller, mapping id+revision,
connection route, projection generation, origin view and serving identity, and
resend the ORIGINAL details; any change => BadContinuationPointInvalid with the
origin token released. Shared per-request assembly budget (min mapping
MaxHistoryAssemblyBytesPerRequest) => BadTooManyOperations for the remaining
nodes. Releases coalesce per connection. Replaces the H2 refusal pin with the
intended behaviour (granted => served, no grant => BadUserAccessDenied).
Projected variables advertise Historizing + the HistoryRead access bit (never
HistoryWrite) only when the definition says so. The Raw/Processed/AtTime
overrides split authorized handles: local ones go to the H1 port unchanged,
projected ones to IProjectedHistoryAccess, each written back to its own slot;
nothing waits under Lock. HistoryCursorKind.Remote stores the projection's
cursor in the SDK session store; disposing the point (session close, eviction,
releaseContinuationPoints, faulted request) releases it at the origin. Mapped
HistoryRead is opened deliberately in DataPlaneAuthorizer; other mapped
operations outside the allowlist stay closed.
A caller cancel during a history call surfaced as RpcException(Cancelled); it now throws OperationCanceledException.
When an assembly is abandoned (timeout, communication failure, unsupported, cancel) after a follow-up, the origin chunk
tokens it carried are released best effort.
The history field still marks that the origin has a historian (negotiation rule unchanged), but a principal with no
HistoryRead export sees no aggregate names and resolution 0 (undisclosed).
Each node's Raw page is clamped from a per-value byte estimate of its catalog type (wide strings/arrays get small
pages plus a continuation) and sub-batches are sized by estimated bytes, so the in-flight read respects
MaxHistoryResponseBytes; AtTime/Processed whose values x estimate exceed the budget are refused per node with a
diagnostic. One deadline per request: nodes not started when it passes are deferred (transport) or BadTimeout
(direct). Every refusal releases the page cursor it was just given; releasing, invalidating or expiring a chunk
releases the page cursor behind it; results are disposed on the exception path. Chunk bindings use per-node details.
OpcUaServer IVT for Runtime.Tests/Host.Tests so tests can hold real page cursors.
A pre-cancelled token throws before taking a slot, and the port delegate is dispatched with Task.Run(None) so its
finally always releases (a Task.Run on a cancelled token never runs the delegate).
In-process loopback h2c host: IConnectionLifetimeFeature.ConnectionClosed is exposed on the HTTP/2 stream context,
two requests on one connection share one session, and disposing the client connection clears it.
With the mapping HistoryRead bit and a local HistoryRead grant, a real SDK HistoryRead on a projected variable is
refused (no HistoryRead access-level bit on projected nodes) with no data and no continuation.
Remote reads hold at most N - max(1, N/4) of the node manager's N process-wide history batch slots
(MaxConcurrentHistoryReadBatches); past that a remote request is BadTooManyOperations unsent, so local OPC UA clients
always keep at least one slot.
Metadata no longer rebuilds the history view per node x operation (and checks the ACL before the tagname, the
ingress order); OriginHistoryPort caches its served-aggregate set per historian source instance.
Origin advertises history whenever it has a historian, so a not-ready/demoted endpoint answers HistoryRead
Unavailable (ungranted: PermissionDenied) and the consumer fails over like v1 Read instead of 'unsupported'.
Client: malformed/undecodable answers are endpoint failures (fresh read moves on); a resumed item is
ContinuationPointInvalid while a fresh item of the same batch is BadNoCommunication; a fresh read tries the next
endpoint when one lacks history; discovery backoff honoured; origin Cancelled without a caller cancel is BadTimeout
(no RecordFailure); caller cancel throws. The deployment lease maps inner/scope faults to BadNoCommunication.
The UnaryTimeout cap is documented next to the AdminUI field and in DataConnections.md.
Nodes are read in sub-batches sized to the response budget and no sub-batch starts once it is spent: the rest are
DEFERRED chunk tokens (transport; read on resume from their original continuation) or BadTooManyOperations (direct
consumer). Processed intervals and AtTime times above MaxHistoryValuesPerPage are refused unsent. Remainder bytes are
charged to a per-principal budget across sessions (concurrent reads x max(response budget, one page)); sizes come
from the encoded CalculateSize; a single value above the response budget is a per-item BadTooManyOperations.
Sessions are capped per principal (own LRU evicted first) and globally (the heaviest principal pays); a release never
creates a session; channel-close registrations are unregistered on clear.
DataConnectionScopeRevision covers consumer/connection/secret scope only; limits (TimeoutMilliseconds and now
HistoryTimeoutMilliseconds) reach DB-less nodes and the LocalDb cache in the artifact's entity JSON. Dropping the field
also avoids a one-time scope-version bump on upgrade. Plan 6 corrected.
Connection/export/mapping editors offer HistoryRead (DataOperationAuthoring, never ahead of the validator) and the
HistoryTimeoutMilliseconds / MaxConcurrentHistoryReads / MaxHistoryValuesPerPage / MaxHistoryResponseBytes /
MaxHistoryAssemblyBytesPerRequest fields; an informational banner shows while a post-v1 bit is ticked (plan 4.3).