The queue event did two things: set the routing-changed flag, which the lifecycle
event of the same change already sets, and deliver the leader-change info log. It
cost an extra raft INSERT per connect/disconnect, two GetForLeaderElection reads per
lifecycle event used for nothing else, a payload kind, a compaction key and a
subscription-service method that only logged.
The leader is now logged where it is published: the address-list emission logs the
leader it just sent, and the routing rebuild logs one summary line with the leaders
it published. Modules without election stay silent, as before.
A future self-election needs a recompute trigger that also re-broadcasts the address
list; that event will be added when the requirement exists, not carried as a no-op.
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.
- 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)