23 Commits
Author SHA1 Message Date
komissarovyv 439e6f5ebf Drop the module leader recompute event
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.
2026-11-19 12:57:28 +03:00
komissarovyv 2bb06ffb8e Share module leader derivation by module 2026-11-18 21:49:35 +03:00
komissarovyv 6cd0b2c712 Add internal module leader recompute event
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.
2026-11-18 21:29:23 +03:00
komissarovyv 6cfa1955ea Derive module leader from connected instances 2026-11-18 20:00:09 +03:00
komissarovyv 9e24122e75 Cover module leader mode storage in acceptance tests 2026-11-18 19:31:14 +03:00
komissarovyv bd8a1b2de4 Add module_leader_mode column to connected instances 2026-11-18 19:31:10 +03:00
Hermes Agent c464393e93 Drop link self-healing paths, fix linter findings
- 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
2026-10-28 11:22:59 +03:00
Hermes Agent 7f4e3ef028 Fix variable links not persisted when variable is used multiple times in config
- 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)
2026-10-28 10:34:45 +03:00
Синельник Тимур Романович 428de36857 MSP-8394 Up deps & use isp-kit/errors 2026-09-25 13:45:02 +03:00
komissarovyv 2a846c67e4 MODULE_READY can be handled several times 2026-08-09 12:45:52 +03:00
Синельник Тимур Романович c295bda53b MSP-7042 Up deps & support http methods and transport 2026-02-11 16:13:03 +03:00
Kirill Ryabov 4c131093b1 MSP-5579 add handling MetricsAutodiscovery field from backend declaration 2025-06-09 14:52:49 +03:00
Кузнецов Иван Александрович 7a426b647b MSP-5223 sort imports 2025-04-11 13:36:48 +03:00
komissarovyv ecf2d06cfa MSP-5013 add full variable support 2025-03-05 18:10:07 +03:00
komissarovyv 7aa2805f4c Clean phantom backends 2024-11-01 18:41:17 +03:00
komissarovyv d4badbb8db Return prev module id 2024-10-28 22:17:10 +03:00
d1slike fb21d43425 Use idempotent module id 2024-05-24 16:26:00 +03:00
d1slike 2228e02770 Implement missing endpoint 2024-05-16 20:27:40 +03:00
d1slike 8275c01d21 Align to CI 2024-05-15 12:44:39 +03:00
d1slike 3b34468842 Improve logging 2024-05-14 14:34:13 +03:00
d1slike c6148a1c1c Implement api 2024-05-08 18:45:21 +03:00
d1slike b2e34c00a4 Implement api 2024-05-08 15:40:14 +03:00
d1slike 80a99c425b Implement event stream 2024-05-07 20:16:44 +03:00