Rolling swap can start the new replica before a migration finishes #94

Closed
opened 2026-10-10 05:28:27 +00:00 by ahmad · 0 comments
Owner

Context

With rolling-services, deploy-vps recreates the other services with --no-deps and then rolls the listed ones, also with --no-deps. up -d returns as soon as a one-shot service such as a migration has started. So the new replica can start before the migration finishes, and even after it has failed. Without rolling, compose's depends_on: condition: service_completed_successfully prevents that.

Found while adopting the swap in suhba/rihla#417, and tested on the VPS:

  • rolling without --no-deps waits correctly, but re-runs a migration that has already exited (twice per deploy);
  • up --wait reports the running one-shot as healthy and returns before it ends.

Scope

  • In: in rolling mode, before any swap, wait for each recreated container whose restart policy is no to exit, and fail the deploy (old replicas untouched) unless it exits 0. Document it.
  • Out: the non-rolling path, which keeps today's behaviour.

Acceptance criteria

  • Given a rolling deploy whose migration takes a while, when it runs, then the new replica starts only after the migration has exited 0, and the migration runs once.
  • Given a migration that fails, when deploying, then no new replica starts, the old one keeps serving, and the deploy fails with the migration's logs.
  • Given a consumer that does not set rolling-services, when it deploys, then nothing changes.
### Context With `rolling-services`, deploy-vps recreates the other services with `--no-deps` and then rolls the listed ones, also with `--no-deps`. `up -d` returns as soon as a one-shot service such as a migration has started. So the new replica can start before the migration finishes, and even after it has failed. Without rolling, compose's `depends_on: condition: service_completed_successfully` prevents that. Found while adopting the swap in suhba/rihla#417, and tested on the VPS: - rolling without `--no-deps` waits correctly, but re-runs a migration that has already exited (twice per deploy); - `up --wait` reports the running one-shot as healthy and returns before it ends. ### Scope - In: in rolling mode, before any swap, wait for each recreated container whose restart policy is `no` to exit, and fail the deploy (old replicas untouched) unless it exits 0. Document it. - Out: the non-rolling path, which keeps today's behaviour. ### Acceptance criteria - [ ] Given a rolling deploy whose migration takes a while, when it runs, then the new replica starts only after the migration has exited 0, and the migration runs once. - [ ] Given a migration that fails, when deploying, then no new replica starts, the old one keeps serving, and the deploy fails with the migration's logs. - [ ] Given a consumer that does not set `rolling-services`, when it deploys, then nothing changes.
ahmad self-assigned this 2026-10-10 05:28:27 +00:00
ahmad closed this issue 2026-10-10 05:43:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
amtronics/platform-actions#94
No description provided.