Repository navigation
pool: a resize is refused on a fenced node when its target pool replicates; a volume change that meets a resize answers 503 - #676
Merged
Conversation
…cates; a volume change that meets a resize answers 503 reshape refused a resize on a fenced node only for a claim that was already replicated. A claim of a pool that does not replicate, resized into one that does, was published Replicated on the fenced node: the resize answered 204 and every call to the claim then answered "lease lost" until the fence lifted, where a new claim of that pool is refused. fencedFor now also asks fencedReplicating for the key the claim's policy would have (PolicySource when set, else the target key). Resize asks it before the cocoon call, so the refusal changes nothing, and reshape asks it again at the swap. A volume PUT or PATCH begins its run on the record it looked up, then resolves its volumes. When a resize replaced the record meanwhile, checkVolumeRunLocked and beginVolumeRun answered ErrUnknownSandbox (404) for a claim that still exists. They now answer through heldErrLocked: ErrReplaced (503, retry) when another record holds the id. Tests: a resize into a replicating pool is refused when the lease is overdue at the start (cocoon is not called) and when it is lost while cocoon resizes the VM; a promoted template's clone, whose policy key does not replicate, is not refused. A volume run begun before a resize, and one begun on the replaced record, answer ErrReplaced.
… the volume 503 is for a call in flight
This was referenced Dec 1, 2026
CMGS
added a commit
that referenced
this pull request
Dec 1, 2026
…e refuses a resize into a replicating pool (#684) Docs for behaviour that PRs merged since v0.1.38 changed: egress.md states that an origin's early answer or the proxy's own 502 or 429, sent before the guest's request body was read to its end, carries Connection: close, arrives whole, and ends that guest connection (#681); cluster.md states the resize refusal on a node whose lease is overdue and that a claim resized into its policy pool is replicated from then on (#676), and that the hourly row settling leaves a claim a transition holds to the next pass (#674); CHECKLIST.md states the archive sweep worker's check before it marks a claim (#679); deploy.md states that a preview URL can show a truncated reply when the guest app answers before it read the whole request body.
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.
What
Two small fixes for
POST /v1/sandboxes/{id}/resize, both found while the pool was read end to end for the checklist in #675.lease lost; retryuntil the fence lifted. A new claim of that pool is refused in the same state. The check now also covers the pool the claim's policy would follow (itsPolicySourcewhen set, else the target key). It runs before the cocoon call, where a refusal changes nothing, and again at the swap.PUTorPATCHthat meets a resize answers 503, not 404. A volume change begins on the record it looked up and then resolves its volumes. When a resize replaced the record meanwhile, the change answered 404 for a claim that still exists. It now answers 503sandbox changed while the call waited; retry, as the other calls do; a released claim still answers 404.Reach
replicate_seconds, and a lease that is overdue during the call. It heals itself when the lease returns, and no peer can adopt the claim meanwhile, since it has no replica yet.Tests
TestAResizeIntoAReplicatingPoolIsRefusedWhileTheNodeIsFenced: the lease overdue at the start (cocoon is not called); the lease lost while cocoon resizes the VM; a promoted template's clone, whose policy key does not replicate, is not refused.TestAVolumeChangeThatMeetsAResizeAnswersTheRetry: a run begun before the resize, and one begun on the replaced record.-race.0 issues.for the five modules on darwin and linux, asl, fmt, comments +0 −0, darwin and linux race tests green.Hot path
None. The resize check is on an operator call; the volume checks swap one map compare for another under a mutex they already hold.
Merge order
Merge this before #675: the checklist there is updated to describe these two rows as handled.