mirror of
https://github.com/containerd/containerd.git
synced 2026-10-28 17:45:13 +08:00
The metadata store fsyncs itself on commit, but nothing fsyncs layer.erofs or the snapshot directory first. Lose power at the wrong moment and you end up with a committed snapshot pointing at a truncated blob, or at a directory that never made it to disk. Nothing recovers from that: the chain ID is already there, so the next pull is a no-op and the image simply fails to mount. Add an opt-in fsync_on_commit. When set, Commit fsyncs the snapshot directory and what's in it before recording the snapshot. Off by default: it costs a few fsyncs per layer, and not everyone needs it. Backport of #14334 and #14378. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Mykhaylo Sul <mykhaylo.sul@oss.qualcomm.com> (cherry picked from commitd0ed8ab2a) (cherry picked from commit8f3aafa29)