Skip to content

Retire failed hosts across the cluster - #498

Merged
cre4ture merged 19 commits into
mainfrom
feat/cluster-host-retirement
Dec 1, 2026
Merged

cre4ture merged 19 commits into
mainfrom
feat/cluster-host-retirement

Conversation

@cre4ture

@cre4ture cre4ture commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Permanently retiring a failed host on one surviving node now excludes that identity across the connected cluster. An append-only SQLite/Turso membership journal merges retirement records and durable receipts over authenticated peer exchange; reconnecting nodes catch up before distribution, and returned retired identities enter quarantine while retaining local data and admin recovery access.

The server-admin host list adds impact warnings, full-ID confirmation, retry-safe requests, and propagation history. The existing DELETE endpoint uses the same durable service. Offline unknown-version peers warn instead of deadlocking recovery; online unsupported peers block creation. Replication policy deficits and repair remain separate from propagation. Local client enrollment stays available while membership catch-up pauses cluster transfers. Health remains independent of admission: live pending peers cannot be retired, and the UI labels them as awaiting membership.

Startup admission requires an exchange with a known peer even when the local ledger is empty: a restored backup may predate the first retirement. Local client access, enrollment, priority and endpoint configuration, storage capacity updates, and rendezvous presence metadata remain available during this wait without admitting the node. Unknown decision schemas fail closed; capability-version claims remain replayable independently of the negotiated protocol.

Validation:

  • 1,262 server SDK tests passed with SQLite and Turso (RUST_MIN_STACK=16777216); one macOS path-overlap test excluded after reproducing its failure on unchanged main.
  • Four real server processes: connected propagation, offline survivor catch-up after origin loss, restart persistence, data recovery, and old-identity quarantine.
  • 42 server-admin smoke tests, focused removal/compatibility/retry flow, web typecheck and build.
  • 24 focused retirement regressions passed, including live pending-peer protection, capability-history replay, receipt-derived status, legacy DELETE compatibility, and stale-snapshot exclusion.
  • SDK Clippy with Turso/all targets, formatting, documentation links and context checks.
  • Native system tests passed for managed-rendezvous failover with relay-only clients and the four-node retirement scenario. The retirement test checks each stopped host’s actual offline status before removal, and waits for a durable survivor copy before stopping the origin, independently of membership acknowledgment.

Implements and supersedes the design-only proposal in #497.

GitHub CI on ab818292: all three protected gates passed (Required CI, Required system tests, Required coverage), including Linux/Windows system suites and iOS. All review threads are resolved. The optional Claude review job failed because its service hit the five-hour quota; it is not a required merge check.

Comment thread crates/server-node-sdk/src/lib.rs Resolved
@claude

claude Bot commented Dec 1, 2026

Copy link
Copy Markdown

Reviewed this PR for bugs, correctness, and security issues (membership protocol, cluster.rs retirement gating, storage persistence, CSRF/auth on the new retirement routes, and the admin UI).

No bugs found. Notes from the review:

  • Lock ordering (membership before cluster) is consistent everywhere it's nested, avoiding deadlocks.
  • Retirement exclusion via the shared Arc<RwLock<HashSet<NodeId>>> in PlacementSnapshot/ReplicationPlanSnapshot correctly applies live even though the node map itself is a point-in-time snapshot.
  • export_membership correctly restricts a retired caller to only their own retirement record, avoiding leaking other membership state post-retirement.
  • The new same-origin/sec-fetch-site CSRF check in authorize_admin_membership is a good addition; worth noting (out of scope for this PR) that it isn't applied to other session-cookie-authenticated admin mutation endpoints that go through authorize_admin_request elsewhere in lib.rs, so cookie-based CSRF protection is currently inconsistent across the admin API as a whole.
  • Storage layer (sqlite/turso) uses parameterized queries throughout for the new cluster_membership_records table.

Given the size and architectural significance (new cluster-wide membership ledger, consensus/replication gating, and new admin endpoints), this is a good candidate for a deeper second-pass review.

Comment thread crates/server-node-sdk/src/lib.rs Resolved
Comment thread crates/server-node-sdk/src/lib.rs Resolved
@cre4ture
cre4ture merged commit 288e418 into main Dec 1, 2026
43 of 44 checks passed
@cre4ture
cre4ture deleted the feat/cluster-host-retirement branch December 1, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant