Merge #996: Deployment reads skip ArtifactBlob, narrow data-connections loader, coordinator ack writes off-thread, AdminOps I/O off mailbox, HistoryReadEvents page cap, reservations page bounded
This commit is contained in:
@@ -24,6 +24,14 @@ validator remains authoritative: consumers must belong to the owning cluster, ma
|
||||
must be a subset of the connection's consumers, local parents must be valid containers, and branch
|
||||
collisions, invalid self-routes and unsupported type expectations are rejected.
|
||||
|
||||
**Authoring reads are narrow (#996, review C-11 / A-5).** The `/clusters/{id}/data-connections` page and its save/delete use
|
||||
`DraftSnapshotFactory.FromConfigDbForDataConnectionsAsync`, not the whole-DB deploy snapshot: it skips Scripts, PollGroups,
|
||||
NodeAcls, ApiKeys and reservations (nothing in `DataConnectionValidator` reads them) and projects each Tag to id/device/group/name,
|
||||
selecting `TagConfig` only for rows that could carry an `alarm` intent (the alarm-bearing-export-root rule, #942). Never feed that
|
||||
snapshot to `DraftValidator` or the artifact composer. `LoadAppliedAsync` fetches and inflates each distinct applied artifact once
|
||||
(`DeploymentArtifact.ParseDataConnections(blob, nodeIds)`), however many nodes share it. Tag-level picker lists are capped at 500
|
||||
entries; type the root as `Kind|EntityId` for anything beyond.
|
||||
|
||||
New connections default to a 30-second call timeout. Existing explicitly configured shorter
|
||||
timeouts remain in force. This limit never extends a caller's original deadline; a write without
|
||||
enough remaining time for the driver budget is rejected before dispatch.
|
||||
|
||||
@@ -195,6 +195,11 @@ routes it to `Unsubscribe`, dropping a stale handle.)
|
||||
|
||||
Things to know before touching any of this:
|
||||
|
||||
- **Restart/Reconnect reply = the dispatch (#996, review H-3).** `AdminOperationsActor` handles `RestartDriver` /
|
||||
`ReconnectDriver` as synchronous receives: dispatch to the nodes, reply success, then write the `ConfigEdit` audit row on a pool
|
||||
thread. An audit-write failure is logged (with op, driver, user, correlation) and never changes the reply — it used to answer
|
||||
"failed" for a command already on its way (the operator retried ⇒ a second restart) and suspended the admin mailbox for a connect timeout.
|
||||
|
||||
- ⚠️ **The supervision route is the invisible one, and it was the worst.** There is **no**
|
||||
`SupervisorStrategy` anywhere under `src/Server`, so a child that throws gets Akka's default `Restart`.
|
||||
A restart recreates the actor object around the **same** `IDriver` — the Props closure captured it —
|
||||
|
||||
@@ -200,6 +200,7 @@ Processed read is `BadAggregateNotSupported` and no history aggregate functions
|
||||
| `HistoryReadBatchParallelism` | int | `4` | Max historized nodes served **concurrently** within one HistoryRead batch (arch-review 03/S3). The SDK's `HistoryRead*` override surface is synchronous, so each arm bridges once at its boundary; this turns per-node serving from sequential (`N × CallTimeout` worst case) into `⌈N / P⌉ × CallTimeout`. Also caps the gateway-load multiplication a single client can command. `≤ 1` serves sequentially. |
|
||||
| `MaxConcurrentHistoryReadBatches` | int | `16` | Process-wide limit on HistoryRead (and HistoryUpdate) batches served **concurrently** (arch-review 03/S3). A flood of history clients degrades to `BadTooManyOperations` rather than exhausting the SDK request-thread pool. With `HistoryReadBatchParallelism` this caps total in-flight gateway reads at `MaxConcurrentHistoryReadBatches × HistoryReadBatchParallelism` (default 16 × 4 = 64). A batch that cannot get a slot within `min(HistoryReadDeadline, 5 s)` fails every handle `BadTooManyOperations`. |
|
||||
| `MaxTimeWeightedRawRows` | int | `1000000` | `SqlServer` / `QuestDb` (#671), and the `Gateway` per-sample aggregates (#681 — every per-sample read there streams raw samples, so the cap applies to the window's raw rows; see [Aggregate set](#aggregate-set-and-badaggregatenotsupported-285)). The most raw in-window samples one [time-weighted aggregate](#time-weighted-aggregates-part-13-671) read (TimeAverage, TimeAverage2, **Total**, Total2, Interpolative, and — since #680 — **PercentGood/PercentBad**, since #820 **DurationGood/DurationBad**) may stream into the server-side evaluator — that family is **not** pushed down to SQL. The window query is capped at this + 1 rows; one row past the cap fails **that node** with `BadTooManyOperations` (not counted as a backend fault) instead of holding a pooled connection until `HistoryReadDeadline` and returning `BadTimeout`. Bound rows outside the window do not count; per-sample aggregates are not capped on the SQL backends (pushed down). 1 000 000 ≈ 11.5 days of a 1 Hz tag. Non-positive = unbounded (a `Validate()` warning). `Gateway` (#688): the row budget it asks the gateway for (`cap + 18`) is clamped at the gateway's default `MaxValuesCeiling` (1,000,000) while the cap is at or under it, so the default works against a gateway with `AllowStreamingBeyondCeiling=false`; against a gateway with a *lower* ceiling the refused budget is retried once at the ceiling the gateway names (#691.3), so no change is needed (`ceiling − 18` only saves that round-trip). |
|
||||
| `MaxEventsPerRead` | int | `10000` | Every backend (#996, review U-6): the most events one HistoryRead-Events page returns for a node and the most a backend is asked for in one read — the events twin of `MaxRawValuesPerRead`. `NumValuesPerNode = 0` ("all") or any larger N is served as pages of at most this many events, each with a continuation point; advertised as `HistoryServerCapabilities/MaxReturnEventValues`. Non-positive = unbounded (the pre-#996 behaviour; a `Validate` warning). |
|
||||
| `HistoryReadDeadline` | TimeSpan | `00:01:00` | Per-request wall-clock deadline for a HistoryRead (and HistoryUpdate) batch (arch-review 03/S3). A node still in flight at the deadline surfaces `BadTimeout`, so one request can never hold an SDK request thread longer than this regardless of node count. Non-positive = unbounded (a `Validate()` warning). |
|
||||
| `ProvisionTags` | string | `CreateOrUpdate` | What [tag auto-provisioning](#tag-auto-provisioning-ensuretags) may do (#899). `CreateOrUpdate` = the `EnsureTags` / `MERGE` upsert: create a missing tag, re-type and re-describe an existing one (the behaviour before #899). `CreateOnly` (**Gateway backend only** — any other backend fails host start) = look each tag up first (`GetTagMetadata`, a read) and send only the ones the historian reports **absent**; an existing tag is left exactly as it is (counted `skipped`), and a failed lookup is counted `failed` and **not** sent. `Off` = no provisioning at all; HistoryRead and continuous historization are unaffected. Case-insensitive; an unknown value fails host start. A tag's own `historianReadOnly: true` opts it out under every policy. |
|
||||
| `HistoryUpdateMaxFutureSkew` | TimeSpan | `1.00:00:00` | #674. How far past the server clock a HistoryUpdate (Insert / Replace / Update) item's `SourceTimestamp` may lie; an item beyond `now + skew` is refused **`BadOutOfRange`** by the node manager before any backend sees it (every backend). Guards against a far-future typo (a 2062 timestamp). The live recorder is not bounded. Non-positive disables the bound (no warning — a deliberate choice). See [HistoryUpdate](#historyupdate). |
|
||||
|
||||
@@ -809,6 +809,12 @@ deployment green fleet-wide. Now:
|
||||
`Degraded = false, DegradedReason = null` (an old node's DPS JSON decodes clean); `ApplyAckMessage` gained
|
||||
`bool degraded = 6; optional string degraded_reason = 7;` (an old node's gRPC ack decodes clean). The
|
||||
outcome stays `APPLIED` — a degraded node *did* apply the revision.
|
||||
- **Ack rows are written off the coordinator thread (#996, review H-6).** `ConfigPublishCoordinator` persists each node's ack on a pool
|
||||
thread (`AckPersisted` is piped back; one write per node at a time, a newer ack for the same node waits behind it) and decides
|
||||
count/seal on the actor thread. With the ConfigDb slow or unreachable (no EF retry strategy ⇒ a connect timeout per call) the
|
||||
timeouts now overlap instead of serialising N × timeout of unresponsive mailbox; the deadline kicks its whole unpersisted backlog off at
|
||||
once and decides as soon as the last write lands. The dispatch guard/seed and the terminal seal/fail/timeout writes are still
|
||||
synchronous single calls (see the follow-up issue).
|
||||
- **Central records it without a status-model change.** `ConfigPublishCoordinator.PersistNodeAck` keeps the
|
||||
node's `NodeDeploymentState.Status = Applied` and writes `FailureReason = "Applied degraded: <reason>"`
|
||||
(`ConfigPublishCoordinator.IsDegraded` = Applied **and** a reason). The deployment still **seals** —
|
||||
|
||||
@@ -133,10 +133,13 @@ permanent for the life of the asset.
|
||||
(`[Authorize]`) but is not restricted to a specific Admin UI role — any signed-in
|
||||
user can view it.
|
||||
|
||||
The page is a **read-only flat list** of all `ExternalIdReservation` rows,
|
||||
ordered by Kind then Value. It shows Kind, Value, owning `EquipmentUuid`, and
|
||||
Cluster. There is no Active/Released split, no Release action, and no Release
|
||||
dialog on this page.
|
||||
The page is a **read-only list** of `ExternalIdReservation` rows, ordered by Kind
|
||||
then Value. It shows Kind, Value, owning `EquipmentUuid`, and Cluster. Since
|
||||
#996 (review A-8) it lists **active** rows by default (a "Show released" toggle
|
||||
adds the released ones and a Released column), reads only the displayed columns
|
||||
(`ReservationListQuery`) and shows at most 200 rows with a "Showing N of M"
|
||||
header — released rows accumulate for the life of the database. There is no
|
||||
Release action and no Release dialog on this page.
|
||||
|
||||
You cannot *create* a reservation from this page — reservations only ever come
|
||||
into existence as a side-effect of publishing a generation. The release flow
|
||||
|
||||
Reference in New Issue
Block a user