fix(grpc-data): size projected unary reservations from the node's shape (#960); per-item status for projected items refused at create (#961)
#960: a projected read reserves 16 KiB for a fixed-size scalar (16 KiB + 256 B/element for a fixed-length fixed-size array) instead of the whole MaxPendingBytes, so the default 1 MiB admits 64 concurrent scalar reads; String/Bytes/variable arrays keep the whole cap, and a waiting whole-cap read holds back smaller ones for 100 ms (anti-starvation). Writes reserve 16 KiB + identifiers + 3 x the value bound (what the origin's DataWriteExecutor admits the batch against). Monitored-item renewals reserve 256 KiB. Measured: 4 x 250 ms maxAge=0 reads 1016 ms / 1 in flight -> 285 ms / 4 in flight. #961: TryAcquireProjectedItem reports BadResourceUnavailable for a stream-capacity refusal; the node manager's CreateMonitoredItem override turns the item manager's ServiceResultException into that item's status (was a whole-request fault), and an authority race is re-classified outside Lock like the per-item probe.
This commit is contained in:
@@ -101,7 +101,7 @@ a write also needs this node's local write role). A caller without the grant is
|
||||
`GetMetadata` renewal as above, for the operation it is performing (its Read / HistoryRead / Write /
|
||||
Subscribe bit), 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,
|
||||
slots (an existing monitored item's renewal reserves 256 KiB of the unary budget since #960, not all of it): 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** awaits the renewal within the request (#938; the async Read, no `Lock`, at most
|
||||
@@ -116,7 +116,12 @@ reserve 256 KiB each, and have 3 s end to end, so a batch of N lapsed nodes rene
|
||||
most 4 s, async, no `Lock`) and then creates them. An item still not acquirable is answered PER
|
||||
ITEM — `BadResourceUnavailable` for a lapse the caller is granted, `BadUserAccessDenied` for a real
|
||||
refusal. (Before, a refused projected item was thrown from the item manager and faulted the whole
|
||||
CreateMonitoredItems request.)
|
||||
CreateMonitoredItems request.) **Since #961** the remainder refused at the create itself (under the SDK's
|
||||
`Lock`, after that per-item check) is per item too: the authority changing in between is re-classified
|
||||
the same way once the create returns (granted lapse, or admitted again by then ⇒ `BadResourceUnavailable`;
|
||||
real refusal ⇒ `BadUserAccessDenied`), and no origin stream able to take the item (the node's
|
||||
`MaxStreams` streams — one per connection, serving identity and publishing interval — all in use, or a
|
||||
closing one) is `BadResourceUnavailable`. The other items of the request are created normally.
|
||||
- **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
|
||||
|
||||
Reference in New Issue
Block a user