Gateway AtTime: prior-sample search starts at the requested time, not min(T, now); strict-ceiling stopped-tag end-only reads costly #696
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-ups from the #692–#694 live AVEVA gate (2026-10-13, master
66a2b0c3). Low; results are correct, cost only.SysTimeSec(1 Hz) costs 24 reads, ~15k rows and 3.7 s.GatewayAtTimeReader's walk-back for the earlier sample starts at the requested time T rather than min(T, now). The empty future stretch makes it fall through to a whole-remainder read and a bisection over ~3 years. Start the search at min(T, now + small margin); the future-time rule (Uncertain hold) is unchanged.Evidence: scratchpad
livegate-aveva-692.md(F1, F3), logsg692/l693*.log,g692/l694*.log.Implemented item 1: a bounded future-interval probe preserves stored future samples, then starts prior-sample search near now when the interval is empty. Requested timestamps and Uncertain hold status remain intact. Tests cover dense live history (at most four raw reads), stored future samples and a full future probe.
Items 2 (stopped-tag strict-ceiling end-only cost) and 3 (per-sample aggregate ceiling re-probe) are not changed. Leaving issue open for those remaining performance items.
Pushed commit
97668d26; PR: #699.Full solution verified: 14,581 passed, 609 skipped, 0 failed across 62 suites (
dotnet test ZB.MOM.WW.OtOpcUa.slnx --verbosity quiet, exit 0). Independent final review found no important defects. New fixes have not been deployed or live-tested end to end through OPC UA.Remaining items fixed:
Strict-ceiling stopped-tag reverse discovery retains truncated remainder-probe rows/density and uses the available discovery budget for gaps, rather than throwing that evidence away. Only complete segments enter a page; order/ties/bounds/continuation hints remain exact. Regression: 7,200 stopped 1 Hz rows, ceiling 1,000, latest three requested one day later, baseline 17 calls; now at most 12 with exact values 7199/7198/7197. The Gateway suite covers existing paging/tie cases as well.
Per-sample aggregates reuse a recently refused ceiling for 30 seconds before re-probing an incomplete stream. A raised ceiling is noticed after expiry; a lowered ceiling is learned immediately. Oversized reads remain BadTooManyOperations during the cooldown, never truncated answers. Raw/AtTime immediate re-probes remain intact. Regression checks no second refusal in the cooldown and success after a raised limit at expiry.
Item 1 was fixed in
97668d26(bounded future probe and near-now prior search). All three items are now handled. Closing this issue.Pushed commit
58977640onfix/historian-653-followups, included in PR #699: #699 (awaiting merge).Full final-tree solution: 14,600 passed, 609 skipped, 0 failed across 62 suites (
dotnet test ZB.MOM.WW.OtOpcUa.slnx --verbosity quiet, exit 0). Final Gateway suite: 434 passed / 6 environment-gated skips. Independent final review found no important defects.Evidence:
docs/plans/2026-10-13-historian-653-696-results.md.Merged PR #699 into master as
618d98e822. The merged tree exactly matches tested58977640: full solution 14,600 passed, 609 skipped, zero failed across 62 suites. #653 and #695–#698 are closed; #694 remains open for historiangw#27.Pending findings are now tracked explicitly:
No deployment changes were made. All temporary test keys were independently verified revoked.