Gateway historian: default MaxTimeWeightedRawRows + 18 exceeds the gateway default ceiling #688

Closed
opened 2026-10-12 14:20:50 -04:00 by dohertj2 · 1 comment
Owner

Low. Found by #681 review and confirmed by the live AVEVA gate (2026-10-12): OtOpcUa's per-sample raw read requests MaxTimeWeightedRawRows + 18 = 1,000,018 rows by default, above the gateway's default MaxValuesCeiling of 1,000,000. With AllowStreamingBeyondCeiling=false on the gateway every Gateway per-sample aggregate read is refused (BadTooManyOperations), even a 9-row window (live: rejection text "max_values exceeds the server ceiling" confirmed).

Fix: clamp the requested budget to the ceiling (e.g. derive the Gateway default as 1,000,000 − 18, or make the +18 margin come out of the cap), and document.

Low. Found by #681 review and confirmed by the live AVEVA gate (2026-10-12): OtOpcUa's per-sample raw read requests `MaxTimeWeightedRawRows + 18` = 1,000,018 rows by default, above the gateway's default `MaxValuesCeiling` of 1,000,000. With `AllowStreamingBeyondCeiling=false` on the gateway every Gateway per-sample aggregate read is refused (`BadTooManyOperations`), even a 9-row window (live: rejection text "max_values exceeds the server ceiling" confirmed). Fix: clamp the requested budget to the ceiling (e.g. derive the Gateway default as 1,000,000 − 18, or make the +18 margin come out of the cap), and document.
Author
Owner

Fixed on master 1f5d3100. The per-sample aggregate budget is clamped to the gateway default ceiling (1,000,000) when the caller's cap is at or under it; the raw path is deliberately not clamped (AVEVA always emits a boundary row, so clamping made page sizes 999,985–1,000,000 always fail).

Live AVEVA gate PASS: a default-budget per-sample aggregate requests exactly 1,000,000 rows and is served, including with the gateway set to AllowStreamingBeyondCeiling=false. Strict-ceiling uncapped raw reads tracked in #691.

Fixed on master `1f5d3100`. The per-sample aggregate budget is clamped to the gateway default ceiling (1,000,000) when the caller's cap is at or under it; the raw path is deliberately not clamped (AVEVA always emits a boundary row, so clamping made page sizes 999,985–1,000,000 always fail). **Live AVEVA gate PASS:** a default-budget per-sample aggregate requests exactly 1,000,000 rows and is served, including with the gateway set to `AllowStreamingBeyondCeiling=false`. Strict-ceiling uncapped raw reads tracked in #691.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#688