mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 05:17:02 +00:00
Commit records a snapshot in the metadata store, which syncs its own file, while layer.erofs and the snapshot directory may still be in the page cache. A power loss shortly after a pull can then leave a committed snapshot whose blob is corrupt or whose directory is missing. A later pull does nothing because the chain ID exists, and running the image fails to mount the layer. With fsync_on_commit = true, Commit fsyncs everything in the snapshot directory, the directory itself and snapshots/ before the snapshot is recorded. Blobs served from a layer content cache are not synced. The option is off by default and lives in the snapshotter because the differ's SyncFs does not reach Commit, where the walking differ's blob is created. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Mykhaylo Sul <mykhaylo.sul@oss.qualcomm.com>