The event handler maps the leader recompute onto the routing map rebuild with
the ready and disconnected events of the batch, so a leader change reaches the
routing map of every config service node.
The address list is not re-broadcast from it: the ready and disconnected event
of the same change already broadcasts it, and an extra snapshot per connect
broke the acceptance test on the exact number of host lists a module receives.
An info is written when the leader address in the payload differs from the
address before the change, naming the module, both addresses and the reason.
An event that changed nothing is silent, so the log stays readable.
The queue gets a payload kind of its own to recompute a module leader, with the
compaction key module_leader_<moduleId> so the collapse of ready and
disconnected into one module_lifecycle_<moduleId> event cannot swallow it.
The event is inserted next to the events of the same change: on a connect, on a
disconnect by WebSocket close, and on the phantom cleanup of the own node.
Graceful shutdown by DeleteOwnBackends keeps inserting no events. The payload
carries the leader address before and after the change, derived from the module
instances that are already loaded, so the event worker reads nothing from the
database. No new columns, no new tables, no new migrations.
- Remove link resync on module reconnect, link resave on no-op config
update, and link backfill on variable create/upsert: links are
formed only on config save
- Disable exhaustruct_v5 and goconst linters
- Fix golangci-lint findings: noinlineerr, slices.Backward,
wrapcheck for ConfigValidationError (errors.As in controller keeps
working via %w), funlen nolint on acceptance test
- Dedupe extracted variable names (duplicate INSERTs aborted the
config_has_variable transaction on PK conflict)
- Check per-statement rqlite errors in ExecTransaction: a failed
statement silently returned success before
- Make link upserts idempotent (insert or ignore) and add link
backfill on variable create/upsert from existing configs
- Validate config variables before insert (no orphaned configs)
- Resync active config links on module reconnect and on no-op
config update (self-healing)