Feat v0.6.0 cluster registry + HA
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 21s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Successful in 2m58s
CI/CD / test-sqlite (pull_request) Successful in 3m2s
CI/CD / build-and-deploy (pull_request) Successful in 1m15s
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 21s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Successful in 2m58s
CI/CD / test-sqlite (pull_request) Successful in 3m2s
CI/CD / build-and-deploy (pull_request) Successful in 1m15s
PG-backed cluster registry for horizontal scaling — zero new infrastructure (no etcd/Consul/Redis). MVP convergence point. - node_registry UNLOGGED table (migration 013) - Self-registration, heartbeat tick (10s), stale sweep (30s), self-eviction (os.Exit on 0 rows → K8s restarts) - GET /api/v1/admin/cluster returns nodes with runtime stats - Health endpoints include node_id + cluster size/peers - cluster-dashboard admin surface with auto-refresh - 3-replica E2E test (docker-compose-e2e.yml + ci/e2e-cluster-test.sh) - chat + cluster-dashboard added to curated default bundle - 5 new tests (3 unit + 2 handler), all passing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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