feat: node cordon/drain (#36)#39
Merged
Merged
Conversation
…ve claims Drain is a runtime override, deliberately not persisted and never written to pools.json: maintenance intent is not pool configuration. Admission reuses the ErrQuota gate, so a cluster redirects to warm peers before answering 429.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #36: an operator verb to take a node out of service cleanly.
Semantics (as designed in the issue):
POST /v1/drain(root only): new claims/forks/branches answer429 node drainingthrough the existingErrQuotagate — on a cluster the warm-peer redirect fires first, and gossip stops naming the node within a tick as its warm counts hit zero. Unclaimed warm VMs are destroyed via the existing trim path; live claims run to their leases. Answers the fresh info payload ("draining": true); pollclaimedto zero.DELETE /v1/drain: uncordons and kicks an immediate refill.refillOnekeep/chain guards,refillOncegate).GET /v1/infoand the SDKNodeInfogaindraining;/metricsgainssandboxd_draining; SDK gainsClient.Drain/Client.Uncordon(root helpers, per-node by nature).Hot-path cost: zero — one bool inside the existing
quotaErrcheck, already on the admission path.Evidence:
make go-testgreen (all modules,-race); dual-GOOS lint + fmt 0 issues; new tests cover drain-refuses-claims (warm + provision), warm-trim destruction, refill-suppression while draining, uncordon-refills-to-target, endpoint auth/round-trip (server), and POST/DELETE wire shape (SDK).Closes #36.