Repository navigation
docs: document the diff-service sync_fs option - #14533
Marrrrrrrrry wants to merge 1 commit into
Conversation
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>
There was a problem hiding this comment.
🟡 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 = falseto 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. |
|
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. |

What
Documents the diff-service
sync_fsoption 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.