-
fix(cluster): sync metric-stream HMAC key to the cluster secret on joined nodes
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-20 23:53:19 +03:00 | 126 commits to main since this releaseCross-node metrics silently never synced after a node joined: the off-Raft
metric stream signs/verifies same-cluster posts with an HMAC keyed on the
JWT secret, but the sender/receiver captured the container's BOOT ENV secret
at activation. On a joined node that env value is a placeholder
('joining-cluster-placeholder') — the real cluster-shared key arrives later
via cluster_config (snapshot replay). BootstrapClusterSecrets discovered it
but only rebuilt the token service ('restart required for full effect'), so
the metric stream kept HMACing with the placeholder and every peer rejected
its posts in BOTH directions. Raft replication (no HMAC) and per-node auth
kept working, which masked it.- metricstream Sender/Receiver: add SetIntraSecret (mu-guarded) to swap the
cluster HMAC key live; guard the intraSecret reads under the same lock. - Container.SetClusterHMACSecret: update c.jwtSecret + the live sender/receiver.
- server.go: call it right after BootstrapClusterSecrets so every boot a joined
node retunes the metric stream to the discovered cluster key. - setup join: WithMetricSecretSetter wires the same hook into
pollClusterSecretsAndSwap so a fresh runtime join starts syncing metrics
without waiting for a restart.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01U3LvJu9qZfspPr21TW9ptvDownloads
- metricstream Sender/Receiver: add SetIntraSecret (mu-guarded) to swap the