Skip to content

feat(compose): sync layers and resume an interrupted install - #151

Merged
mike-sul merged 2 commits into
mainfrom
feat/containerd-install-resume
Oct 22, 2026
Merged

mike-sul merged 2 commits into
mainfrom
feat/containerd-install-resume

Conversation

@mike-sul

@mike-sul mike-sul commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

An overlayfs snapshot commit is not durable: containerd syncs its metadata but not the snapshot's files, so a power cut during the unpack left committed snapshots without their directory. The install could not tell an intact snapshot from a torn one, so it deleted every leftover lease and extracted the whole app again.

Every layer is now applied with the differ's sync_fs option, so a committed snapshot is on disk, and the install lease is labelled as synced when containerd is 1.7.14 or newer, the first version whose differ honours the option. The next install of the same app keeps such a lease, removes the snapshot the cut left active and continues from the first missing layer. Every other leftover lease is deleted as before.

Based on #150. Test: TestCtrdInstallResumesAfterInterruption in the e2e suite with CONTAINERD_SNAPSHOTTER=true.

@mike-sul
mike-sul force-pushed the feat/containerd-install-resume branch from 163ca53 to e49676b Compare October 22, 2026 10:06
@mike-sul
mike-sul force-pushed the feat/containerd-install-progress branch from 78125b5 to 4d1c0bf Compare October 22, 2026 10:33
@mike-sul
mike-sul force-pushed the feat/containerd-install-resume branch from e49676b to 30570c8 Compare October 22, 2026 10:33
@mike-sul
mike-sul force-pushed the feat/containerd-install-progress branch from 4d1c0bf to 374f898 Compare October 22, 2026 10:40
@mike-sul
mike-sul force-pushed the feat/containerd-install-resume branch from 30570c8 to 01825b5 Compare October 22, 2026 10:40
@mike-sul
mike-sul force-pushed the feat/containerd-install-progress branch from 374f898 to a6c83c0 Compare October 22, 2026 11:08
@mike-sul
mike-sul force-pushed the feat/containerd-install-resume branch from 01825b5 to 7a60d62 Compare October 22, 2026 11:08
@mike-sul
mike-sul force-pushed the feat/containerd-install-progress branch from a6c83c0 to 4a39f45 Compare October 22, 2026 11:09
@mike-sul
mike-sul force-pushed the feat/containerd-install-resume branch from 7a60d62 to 4be4d4a Compare October 22, 2026 11:09
@mike-sul
mike-sul force-pushed the feat/containerd-install-progress branch from 4a39f45 to 276ace3 Compare October 22, 2026 12:02
@mike-sul
mike-sul force-pushed the feat/containerd-install-resume branch from 4be4d4a to 3748977 Compare October 22, 2026 12:08
@mike-sul
mike-sul force-pushed the feat/containerd-install-progress branch from 276ace3 to 7a93f6d Compare October 22, 2026 12:08
@mike-sul
mike-sul force-pushed the feat/containerd-install-resume branch from 3748977 to 7234879 Compare October 22, 2026 12:33
@mike-sul
mike-sul force-pushed the feat/containerd-install-progress branch from 7a93f6d to 4c598b8 Compare October 22, 2026 12:33
Base automatically changed from feat/containerd-install-progress to main October 22, 2026 12:55
An overlayfs snapshot commit is not durable: containerd syncs its
metadata but not the snapshot's files, so a power cut during the
unpack left committed snapshots without their directory. The install
could not tell an intact snapshot from a torn one, so it deleted every
leftover lease and extracted the whole app again.

The unpack now applies every layer with the differ's sync_fs option:
the snapshot's filesystem is synced before the snapshot is committed,
so a committed snapshot is on disk. The install lease carries the
label composectl/install.synced when the containerd reports 1.7.14 or
later, the first version whose differ honours the option. The next
install of the same app keeps such a lease, removes the snapshot the
cut extraction left active, so that its space is free again, and goes
on under the lease: the scan skips the layers whose snapshots exist.
Every other install lease, including an unlabelled one of the same
app, is deleted as before. The records are still created only after
the final syncfs. The unpack watcher's poll interval is a variable so
that the rig test can cut the extraction of a small layer.

Assisted-by: Claude Code:claude-fable-5-1
Signed-off-by: Mike Sul <mike.sul@foundries.io>
The note said that every leftover install lease is deleted and no
snapshot of an interrupted install is reused, which is necessary only
while overlayfs snapshot commits are not durable.

Record the sync_fs apply option with its containerd floor and the
resume of the same app's labelled lease.

Assisted-by: Claude Code:claude-fable-5-1
Signed-off-by: Mike Sul <mike.sul@foundries.io>
@mike-sul
mike-sul force-pushed the feat/containerd-install-resume branch from 7234879 to d9900c9 Compare October 22, 2026 12:56
@mike-sul
mike-sul marked this pull request as ready for review October 22, 2026 12:59
@mike-sul
mike-sul merged commit 3d09910 into main Oct 22, 2026
7 checks passed
@mike-sul
mike-sul deleted the feat/containerd-install-resume branch October 22, 2026 13:19
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