Visitar URL original
docs: document the diff-service sync_fs option by Marrrrrrrrry · Pull Request #14533 · containerd/containerd · GitHub
Skip to content

docs: document the diff-service sync_fs option - #14533

Open
Marrrrrrrrry wants to merge 1 commit into
containerd:mainfrom
Marrrrrrrrry:docs/sync-fs-manpage
Open

Marrrrrrrrry wants to merge 1 commit into
containerd:mainfrom
Marrrrrrrrry:docs/sync-fs-manpage

Conversation

@Marrrrrrrrry

Copy link
Copy Markdown

What

Documents the diff-service sync_fs option in the man page: what it does, its default, and when to enable it. The option is currently absent from the documentation.

Why

The option exists for the failure mode documented in #14503: on storage that may lose acknowledged-but-unflushed writes across a power failure (consumer SD/eMMC flash on ARM devices), the unpacker writes layer files into the snapshot without syncing them to disk, while the snapshot metadata is committed durably right after. A power loss inside that write-back window leaves committed snapshots with valid metadata but 0-byte file contents — and the exists-skip unpack behavior never re-applies the layer, so re-pulling does not repair them.

Enabling this option closes that window for deployments that opt in.

Scope

Defaults to false, matching current behavior. The syncfs flushes the whole filesystem containing the snapshot (on busy systems it may also flush unrelated dirty data), and it applies to the unpack paths driven by core/unpack. See also #14504 and #14506 for the incident discussion and the unpacker-level default proposal.

The diff-service plugin accepts a sync_fs option that runs syncfs on the filesystem containing the snapshot after each layer apply during image unpack.

It is currently absent from the man page, which makes it hard to discover for anyone hitting the durability window: the snapshot metadata is committed durably while the unpacked file contents are still in the page cache.

On storage that may lose acknowledged-but-unflushed writes across a power failure (consumer SD/eMMC flash, in particular on ARM devices), enabling this option prevents committed snapshots from ending up with valid metadata but 0-byte file contents.

Defaults to false, matching the current behavior. See containerd#14503, containerd#14504 and containerd#14506 for the incident analysis and discussion.

Signed-off-by: Marrrrrrrrry <34876935+Marrrrrrrrry@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 00:20
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Nov 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The durability guidance needs qualification because transfer-service unpacking bypasses the setting, and the walking applier honors it only on Linux direct-overlay and single-bind paths.

1 open issue
What changed in this PR

Documents the existing diff-service sync_fs option for operators concerned about unpacked layer durability after power loss. This is a documentation-only change; runtime behavior and defaults remain unchanged.

Changes:

  • Describes the option’s default, intended use, and filesystem-wide flush cost.
  • Adds sync_fs = false to the example configuration.
File Description
docs/​man/​containerd-config.toml.5.md Documents sync_fs and includes its default in the configuration example.

Review effort: Balanced

- **[plugins."io.containerd.service.v1.diff-service"]** has one option __default__, a list by default set to **["walking"]**
- **[plugins."io.containerd.service.v1.diff-service"]** has two options:
- __default__, a list by default set to **["walking"]**
- __sync_fs__ (Default: **false**) syncs the underlying filesystem to stable storage after applying each layer during image unpack. Enable it when the storage may lose acknowledged-but-unflushed writes across a power failure (common on consumer SD/eMMC flash). Note that syncfs flushes the entire filesystem containing the snapshot directory, which on busy systems may also flush unrelated dirty data.
@Marrrrrrrrry

Copy link
Copy Markdown
Author

CI note: the Linux Integration (io.containerd.runc.v2-rs, runc, ubuntu-24.04, systemd) job failed here, but the failing step is cri-tools critest, which seems to be flaky regardless of the change — this PR only touches a man page markdown file. The same step failed on #14504 earlier, while it passed on #14506, on three dependabot PRs, and on recent main commits in the same window. The critest step runs the full suite once with --parallel=8 and no retries, so one flaky case fails the whole job. Could you re-run the failed job? Happy to help pin down the flaky case if it keeps showing up.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants