-
fix(cluster): self-heal the shared auth secret so metrics + sessions converge
Release / version (push) Canceled after 0sRelease / frontend (push) Canceled after 0sRelease / linux (amd64) (push) Canceled after 0sRelease / linux (arm64) (push) Canceled after 0sRelease / windows (push) Canceled after 0sRelease / macos (push) Canceled after 0sRelease / release (push) Canceled after 0sBuild and Push Docker Image / build-and-push (push) Canceled after 0sreleased this
2026-06-21 00:46:58 +03:00 | 124 commits to main since this releaseConfirmed root cause of cross-node metrics never syncing: the metric-stream
receiver returns 401 'bridge: signature mismatch' — the two nodes HMAC with
DIFFERENT keys. The metric HMAC key is the cluster-shared JWT secret, but the
boot/join paths can leave a node on its own env placeholder: cluster_config
not seeded (leader wasn't leader at the boot instant / never restarted) or not
adopted after a plain restart (BootstrapClusterSecrets runs once and the
earlier live-swap only fired on the join flow). The mismatch also means
cross-node sessions don't work (each node only validates its own logins),
which masked it.Add a cluster-secret reconciler loop (started once from SetAppContext, ~20s):
- the leader seeds an empty cluster_config from its env secret (idempotent —
only when unset), so the cluster always gets a shared key; - every node adopts the cluster_config secret into BOTH the metric-stream HMAC
(SetClusterHMACSecret) and the token service (SetSecrets) whenever it differs
from what it's using — the leader's own value adopts as a no-op.
cluster_config is Raft-replicated, so all nodes converge on the leader's key
within a couple of ticks with no manual secret copying. Keeps the boot-time
BootstrapClusterSecrets + join-time swap as fast paths.Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01U3LvJu9qZfspPr21TW9ptvDownloads
- the leader seeds an empty cluster_config from its env secret (idempotent —