You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
snapshot: restore remote mounts on demand after restart
Add lazy_restore_on_restart to skip remote resolution and FUSE mount
restoration during snapshotter startup.
When an unregistered remote layer is first used, restore its mount from
the snapshot labels. Coalesce concurrent requests for the same
mountpoint and support both in-process and fuse-manager modes.
This allows the snapshotter to start while the registry is unavailable.
Signed-off-by: Wang Xingxing <wangxingxing@siliconflow.cn>
Copy file name to clipboardExpand all lines: docs/overview.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,8 @@ When you stop Stargz Sanpshotter on the node, it takes the following behaviour d
128
128
129
129
killing containerd-stargz-grpc will result in unmounting all snapshot mounts managed by Stargz Snapshotter.
130
130
When containerd-stargz-grpc is restarted, all those snapshots are mounted again by lazy pulling all layers.
131
+
If `lazy_restore_on_restart = true`, containerd-stargz-grpc restores the local snapshot directories but doesn't resolve remote blobs or create FUSE mounts at startup. The first `Prepare`, `View`, or `Mounts` request that uses a remote snapshot mounts it on demand. If the registry is still unavailable, that request fails with an unavailable error while the snapshotter keeps running; a later request retries the mount. Metadata-only operations such as `Stat`, `Usage`, and `Walk` don't trigger an on-demand mount.
132
+
131
133
If the snapshotter fails to mount one of the snapshots (e.g. because of lazy pulling failure) during this step, the behaviour differs depending on `allow_invalid_mounts_on_restart` flag in the config TOML.
132
134
133
135
-`allow_invalid_mounts_on_restart = true`: containerd-stargz-grpc leaves the failed snapshots as empty directories. The user needs to manually remove those snapshot via containerd (e.g. using `ctr snapshot rm` command). The name of those snapshots can be seen in the log with `failed to restore remote snapshot` message.
@@ -148,6 +150,8 @@ When stopping FUSE manager for upgrading the binary or restarting the node, you
148
150
4. Restart the containerd-stargz-grpc process. This restores all snapshot mounts by lazy pulling them. `allow_invalid_mounts_on_restart` (described in the above) can still be used for controlling the behaviour of the error cases.
149
151
5. Restart the containers.
150
152
153
+
If `lazy_restore_on_restart` is enabled, step 4 restores only the local snapshot directories. Remote FUSE mounts are deferred until the snapshots are first used.
154
+
151
155
### Unexpected restart handling
152
156
153
157
When Stargz Snapshotter is killed unexpectedly (e.g., by OOM killer or system crash), the process doesn't get a chance to perform graceful cleanup. In such cases, the snapshotter can successfully restart and restore remote snapshots, but this may lead to the temporary cache directories having duplicating cached data.
0 commit comments