Skip to content

fix(packages): offer no way back after a Docker major jump - #19

Merged
inkly merged 2 commits into
mainfrom
fix/docker-major-no-rollback
Oct 10, 2026
Merged

inkly merged 2 commits into
mainfrom
fix/docker-major-no-rollback

Conversation

@inkly

@inkly inkly commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

The first real run of the Docker update proof (Debian 11, the owner's case, docker-ce 28.0.4 to 29.8.0, containerd.io 1.7.29 to 2.3.4, nftables brought in as a new package) showed that the update works, and that the rollback command the core prints after a failed run does not bring the containers back after a major jump: the packages go back, Docker 28 starts, the images are there, but every container stays exited (restart policies always and unless-stopped included).

So the core must not offer that command after a major jump.

  • The log of a run now records its plan: the core writes CASAOS_DOCKER_UPDATE_PLAN <nonce> <from> <to> <0|1> on line 2, right after the QUEUED line, in the same write. The unit script never prints this kind of line. ParseRun reads it with the same discipline as the other markers (the nonce of line 1, exact shape, the first valid one wins, anything else ignored).
  • The status carries major_jump (always present), and from / to come from the plan as soon as the run is queued. rollback_command is empty whenever major_jump is true. A log without the line (an older core's run, a forged one) reads as not a major jump, as before.
  • Tests: the marker (valid and hostile: wrong nonce, second line, malformed fields, inside apt output, before QUEUED, after 20 MiB of noise), the status of a failed major run and of a failed minor run (which keeps its command), exact JSON, and that the unit script never writes the line.

Not verified: a real systemd/apt/Docker run of this change; that is what the proof workflow is for, against the v0.5.22 pre-release.

inkly added 2 commits October 10, 2026 20:16
… it is a major jump

The core writes a PLAN line right after the QUEUED line: the engine versions the plan goes
from and to, and the plan's own major_jump. ParseRun reads it with the same discipline as the
other markers: the first valid one wins, a malformed one or one with another nonce is ignored.
A first real proof showed that after Docker 28 to 29 the packages go back and Docker starts,
and the containers stay stopped. The rollback command the status printed is then no way back.

The start writes the QUEUED and PLAN lines in one write; the status carries major_jump, and
from/to from the PLAN line until the unit's own markers say better (the snapshot of what was
installed for from, the daemon at success for to). rollback_command is empty whenever
major_jump is true, in the failed and the no_result states alike. A log with no PLAN line (an
older core's run) reads as no major jump and keeps today's behaviour.
@inkly
inkly merged commit 743ba9f into main Oct 10, 2026
1 check passed
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