Advertise only the aggregates the configured historian backend serves (HistoryServerCapabilities/AggregateFunctions) #682
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?
Found during #679.
OtOpcUaSdkServernever overridesCreateAggregateManager, soServerCapabilities/AggregateFunctions(i=2997) andHistoryServerCapabilities/AggregateFunctions(i=11201) list the SDK's full default set (37 on the docker-dev rig) regardless of backend. Gateway serves 4 (TimeAverage/Minimum/Maximum/Total), SqlServer/QuestDB 17; the rest answerBadAggregateNotSupportedper node.Proposal:
IHistorianDataSource.SupportedAggregates(default = all) and prune the advertised AggregateFunctions nodes to match. Caveat:AggregateManageralso drives subscriptionAggregateFiltercalculators on live data — trim only the advertised nodes, not the calculator factories.Fixed — merged
113f1eaf(+ Gateway set from #681197246c3). Each backend declaresIHistorianDataSource.SupportedAggregates(SqlServer/QuestDB 17 fromAggregateFamilies.Served; Gateway 12; no historian = none; null from an out-of-tree source = all).HistoryServerCapabilities/AggregateFunctions(i=11201) now lists exactly that set, re-synced at boot and on every source assignment.ServerCapabilities/AggregateFunctions(i=2997) deliberately keeps the SDK's full 37 — Part 5 defines it as everything the server supports, and liveAggregateFiltersubscriptions still accept all 37 (calculator factories untouched). OneAggregateFunctionMaptable now drives both HistoryRead and advertising; processed reads refuse out-of-set aggregates up front.⚠️ Client-visible: with no historian configured a Processed HistoryRead returns
BadAggregateNotSupported(wasGoodNoData); Raw/AtTime/Events stillGoodNoData.Verification: 7 over-the-wire tests (both folders per backend, empty-from-boot, re-sync both directions, live AggregateFilter for unadvertised aggregates); live gate 9 G1 on both centrals: i=11201 = 17/17/12/0, i=2997 = 37 always, every advertised aggregate served and every other one refused. HistoryServerCapabilities booleans were not audited (noted in docs).