Feat v0.6.0 cluster registry (#36)
All checks were successful
All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #36.
This commit is contained in:
38
CHANGELOG.md
38
CHANGELOG.md
@@ -2,6 +2,44 @@
|
||||
|
||||
All notable changes to Switchboard Core are documented here.
|
||||
|
||||
## v0.6.0 — Cluster Registry + HA
|
||||
|
||||
MVP convergence point. PG-backed cluster registry for horizontal scaling —
|
||||
zero new infrastructure (no etcd/Consul/Redis).
|
||||
|
||||
### Added
|
||||
|
||||
- **Cluster registry**: `node_registry` UNLOGGED table with self-registration
|
||||
on startup (`INSERT ... ON CONFLICT DO UPDATE`), heartbeat tick (default 10s),
|
||||
stale sweep (default 30s threshold), and self-eviction (`os.Exit(1)` when
|
||||
swept by a peer — K8s restarts the process).
|
||||
- **Cluster admin API**: `GET /api/v1/admin/cluster` returns all registered
|
||||
nodes with runtime stats (goroutines, heap, GC, uptime, ws_clients) in the
|
||||
standard `{data: [...]}` envelope.
|
||||
- **Health endpoint cluster info**: `GET /health` and `GET /api/v1/health`
|
||||
now include `node_id` and `cluster: {size, peers, heartbeat_age_ms}` when
|
||||
running on Postgres with the registry active.
|
||||
- **Cluster dashboard**: `cluster-dashboard` admin surface package renders one
|
||||
card per node with live runtime stats. Auto-refreshes every 10s. Stats are
|
||||
JSONB — new keys render automatically without schema migration.
|
||||
- **Cluster config**: `CLUSTER_NODE_ID` (default hostname-PID),
|
||||
`CLUSTER_HEARTBEAT_INTERVAL` (default 10s), `CLUSTER_STALE_THRESHOLD`
|
||||
(default 30s), `CLUSTER_ENDPOINT` (Phase 2 mesh, auto-detect).
|
||||
- **3-replica E2E test**: `docker-compose-e2e.yml` now runs 3 replicas.
|
||||
`ci/e2e-cluster-test.sh` verifies registration, stale sweep on stop, and
|
||||
re-registration on restart.
|
||||
- **5 new tests**: 3 cluster registry unit tests (stats collection, start/stop
|
||||
lifecycle, node ID) + 2 handler tests (list nodes, empty response).
|
||||
- **Curated bundle expanded**: `chat` and `cluster-dashboard` added to the
|
||||
default bundle (now 10 packages). Production deployments can override with
|
||||
`BUNDLED_PACKAGES=notes,chat,chat-core,cluster-dashboard` for a lean set.
|
||||
|
||||
### Changed
|
||||
|
||||
- SQLite deployments are unaffected — cluster store is nil, all cluster code
|
||||
is guarded behind `database.IsPostgres() && stores.Cluster != nil`.
|
||||
Cluster dashboard gracefully shows "0 nodes registered" on SQLite.
|
||||
|
||||
## v0.5.5 — Upgrade Testing
|
||||
|
||||
### Fixed
|
||||
|
||||
Reference in New Issue
Block a user