perf(worker): alarm watch-list update diffs the subtag standby instead of rebuilding it (MXA-010, #258)

UpdateAlarmWatchList rebuilt the standby: a second MXAccess registration, an
AddItem/Advise for every watched subtag, then an Unregister of the old source —
work proportional to the whole list for a one-alarm change (reproduced by the
previous commit's test). The subtag standby now takes the list as a diff:
added alarms' subtags are advised on the existing source, removed alarms'
subtags are unadvised, and unchanged alarms keep their advice and state.

The update stays all-or-nothing: the list is validated and the additions
advised before the swap, and an advise failure unadvises what it added and
keeps the previous list. A changed target starts fresh and is initialised from
the last delivered subtag values (acked/priority before active, MXA-007; bad
quality still ignored, MXA-005). LmxSubtagAlarmSource tracks an item from
AddItem so an Advise failure is retryable and removable.
This commit is contained in:
Joseph Doherty
2026-12-03 13:10:31 -05:00
parent d8553b1ff7
commit a38578d0e2
13 changed files with 653 additions and 42 deletions
+5 -4
View File
@@ -909,10 +909,11 @@ Galaxy's last deploy time (`GetLastDeployTimeAsync`), so an undeployed galaxy
costs one deploy-time query per refresh rather than the alarm-attribute query
and a rebuilt list; a failed discovery or an unknown deploy time is not cached.
The gateway compares a SHA-256 of a canonical fingerprint of all six target
fields and sends `UpdateAlarmWatchListCommand` only for a material change. The worker constructs,
subscribes, and attaches the replacement standby on its STA before swapping it
in; a setup failure leaves the previous standby and the current primary/subtag
mode unchanged. The gateway advances its acknowledged fingerprint only after an
fields and sends `UpdateAlarmWatchListCommand` only for a material change. The worker applies
the new list to its existing subtag standby as a diff on its STA — advising only
added alarms' subtags, unadvising only removed ones, and keeping the state of
unchanged alarms; a failure leaves the previous list in force and the current
primary/subtag mode unchanged. The gateway advances its acknowledged fingerprint only after an
OK reply, so a rejected update remains degraded and is retried.
`SubscribeAlarmsCommand.fallback_enabled` distinguishes an initially empty but