fix(grpc-data): H3 review round 2 — no batch probe; budget stop; orphan tokens; lease-retired status

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.
This commit is contained in:
Joseph Doherty
2026-11-24 06:25:19 -05:00
parent 37cbeff480
commit 7aaa98751a
7 changed files with 221 additions and 49 deletions
+5 -5
View File
@@ -222,13 +222,13 @@ origin's `BadHistoryOperationUnsupported`. An origin-side denial, an unhistorize
**Mixed batches.** One HistoryRead may mix local and projected nodes: local nodes are served by the local historian exactly as
before, projected nodes remotely, every result in its own slot. The remote half runs under the same process-wide HistoryRead batch
limiter (`ServerHistorian:MaxConcurrentHistoryReadBatches`, N) and never holds the node-manager lock; projected reads hold at most
N − max(1, N/4) of the N slots (as remote peers do at an origin), so a slow origin cannot starve local HistoryRead/HistoryUpdate —
limiter (`ServerHistorian:MaxConcurrentHistoryReadBatches`, N) and never holds the node-manager lock; projected reads and remote peers
reading this node hold, TOGETHER (one shared semaphore), at most N − max(1, N/4) of the N slots, so a slow origin cannot starve local HistoryRead/HistoryUpdate —
past that the projected half is `BadTooManyOperations`, unsent. A fault or timeout of the remote call (including the connection's
capability probe) fails only the projected half, per node (`BadTimeout` when the deadline fired), and releases its continuation
points. Remote calls are runs of consecutive request positions that share a connection, details and (for resumes) the issuing
endpoint, read in request order and split into sub-batches of at most min(the connection's batch size, the origin's advertised
`MaxBatchItems`) — a large batch is never refused as a whole.
endpoint, read in request order and split into sub-batches at the connection's batch size; the gRPC connection splits again at the origin's advertised
`MaxBatchItems` from the capabilities each call negotiates (no extra probe) — a large batch is never refused as a whole.
**Continuation points.** A projected read's continuation point lives in the client's OPC UA session like a local one (a `Remote`
cursor; capped by `MaxHistoryContinuationPoints`, oldest evicted). It wraps the origin's token and binds the caller (principal, key,
@@ -251,7 +251,7 @@ details on resume gets what it first asked for, as locally). Rules:
| Limit | Effect |
|---|---|
| `RemoteNamespaceMapping.MaxHistoryAssemblyBytesPerRequest` (16 MiB) | One budget per request, shared across the batch (the tightest mapping in the batch). Nodes are charged in request order (calls run in request order, and at most one node per 256 B of the remaining budget is sent); once a node does not fit, it and every later projected node with data is `BadTooManyOperations` (never a partial answer; its origin cursor is released). |
| `ServerHistorian:HistoryReadDeadline` (consumer, 60 s) | The consumer request's remaining deadline, capped per call by `DataConnection.HistoryTimeoutMilliseconds` ⇒ `BadTimeout`. A cancelled request is never counted as an origin fault. |
| `ServerHistorian:HistoryReadDeadline` (consumer, 60 s) | ONE deadline per request, covering the local half too: the local nodes of a mixed batch are served first, so a slow local historian leaves the projected nodes less (or no) time — they answer `BadTimeout`. Each remote call is capped by the remaining deadline and `DataConnection.HistoryTimeoutMilliseconds` ⇒ `BadTimeout`. A cancelled request is never counted as an origin fault; a cancel that is neither the caller's nor the deadline (a connection redeployed mid-read) is `BadNoCommunication` / `BadContinuationPointInvalid`. |
| Aggregates | An aggregate the consumer cannot name is `BadAggregateNotSupported` unsent; one the origin's backend refuses (unknown to it, or not valid for the node's type — #897) comes back `BadAggregateNotSupported` from the origin. The consumer's `HistoryServerCapabilities/AggregateFunctions` does not describe remote backends. |
Modified-value reads (`IsReadModified`) and HistoryReadEvents on projected nodes are refused `BadHistoryOperationUnsupported`.