← Back to Pull requests

Say that a deploy's Volume deletions don't make room for its new Volumes (#2868) #3172

Closed
unknown closed this pull request without merging on Oct 23, 2026 03:08 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 02:12 UTC
Author

Fixes #2868.

Summary

A deploy deletes the Volumes it accepted losing only after it succeeds (store_runner: remove_volumes runs once the outcome is Success). So the space those Volumes hold can't make room for new Volumes in the same deploy. Storage admission was right to refuse. But the refusal told the user to "free disk space", which they were already doing in that very deploy.

Crediting the deletions instead would mean deleting before creating. That reorders a deploy and adds a new way to lose data when the creates then fail, which is too much for a low-severity fix. So the refusal now says what happens instead, as the issue's fallback asks:

 Unprepared
+  short_of_storage: Option<MachineId>   # from the typed PlanError::Storage (insufficient storage / Pool can't grow),
+                                        # set beside same_again, before the error becomes an RpcError
 StoreRunner::unprepared(unprepared, deletes)
-  Failure::from(error)
+  refused_before_deletes(unprepared, deletes)
+    short_of_storage is a Server this deploy deletes Volumes from
+      → reason += " Volumes this deploy deletes free their space only after it succeeds, so they don't
+                    make room for its new volumes."

Review round 1 shaped this:

  • Opus found that a deploy with a Build goes through preparation_error, which rewrites the refusal's details. So round 1's check of those details never fired there, and the decision now comes from the typed refusal, as Unprepared's doc asks.

  • Both reviewers found "Deploy the deletions before the new Volumes" unactionable: a deploy covers the whole environment. The refusal now explains, and the docs give the path: remove the new volumes, deploy, then add them again.

  • Not covered, as before: a daemon-side admission refusal during execution (storage that filled between planning and execution) is an operation failure, and it doesn't get the note.
  • The runner is shared by standalone and Ployz Cloud deploys. docs/user/services/volumes.md "Choose the storage limit" says the same.

    DESIGN.md bets

  • Bet 3 (bounded imperative commands): the deploy's order is unchanged.

  • Bet 4 (partial results are outcomes): the refusal now says why the deletions don't help.
  • Stable promise: additive only. The refusal's code and details are unchanged, and its message gains a sentence.

    Evidence

    sdk::store_runner::tests::a_storage_refusal_says_this_deploy_s_deletions_free_space_only_after_it: for a refusal planned directly and one planned after a Build, the note is added for a shortage on a Server whose Volumes the deploy deletes, and not when the deletions are on another Server or there are none.

    Incus, 1 Machine, standalone, 7 GiB committable. many holds Volumes m1–m3 of 2 GB each, deployed. Then I staged service rm many, volume rm m1..m3, and a new kk with k1–k3 of 2 GB each, and ran deploy --accept-volume-loss m1 m2 m3:

  • Before (main's CLI):

  •   error: Machine machine-1: Not enough disk space: about 2.75 GiB more free space is needed, including storage overhead and OS reserve. Free disk space, expand the disk, or reduce requested volume sizes.
      

  • After:

  •   error: Machine machine-1: Not enough disk space: about 2.75 GiB more free space is needed, including storage overhead and OS reserve. Free disk space, expand the disk, or reduce requested volume sizes. Volumes this deploy deletes free their space only after it succeeds, so they don't count here. Deploy the deletions before the new Volumes.
      

    (This is round 1's wording. The final sentence now reads "...so they don't make room for its new volumes.")

    The sdk:: and deploy:: tests (465) pass, and cargo clippy -p ployz --all-targets is clean.

    Merge Danger

    Door: two-way.

    Blast Radius: copy. Only this refusal's message, and only when the deploy also deletes Volumes on that Server.

    Diff: 491 lines (+368 / -123) across 6 files Reviewer: nick-potts Review duration: 56m
    All Vouch review confidence checks passed
    Residual risk 0.31 = Change Risk (0.71) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.71 · 491 lines diff across 6 files
    0.71
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.371
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.071
    Real PR Conversation Timeline
    1 comments
    "Review active on #3172"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 70.6% (HIGH) · Higher = larger blast radius
    70.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 30.5% · Safe to merge
    30.5%
    Repository