-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow manually remove invalid snapshots on restore #901
Conversation
depends on #902 to pass CI |
ad3f95c
to
a63d2c4
Compare
service/config.go
Outdated
|
||
// SnapshotterConfig is snapshotter-related config. | ||
type SnapshotterConfig struct { | ||
// NoRestoreInvalid doesn't restore invalid snapshots. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "restore" mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the patch not to use "restore" but use clearer expression.
a63d2c4
to
0efa323
Compare
service/config.go
Outdated
// AllowInvalidMountOnRestart allows that there are snapshot mounts that cannot access to the | ||
// data source when restarting the snapshotter. | ||
// NOTE: User needs to manually remove the snapshots from containerd's metadata store using | ||
// ctr (e.g. `ctr i rm`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean ctr snapshot rm
?
service/config.go
Outdated
// data source when restarting the snapshotter. | ||
// NOTE: User needs to manually remove the snapshots from containerd's metadata store using | ||
// ctr (e.g. `ctr i rm`). | ||
AllowInvalidMountOnRestart bool `toml:"allow_invalid_mount_on_restart"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AllowInvalidMountOnRestart bool `toml:"allow_invalid_mount_on_restart"` | |
AllowInvalidMountsOnRestart bool `toml:"allow_invalid_mounts_on_restart"` |
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
0efa323
to
908d837
Compare
Related: #901
On restart, containerd-stargz-grpc doesn't startup if one of the snapshots cannot restore.
This makes us impossible even to manually remove images and snapshots (e.g. by using ctr).
This commit allows to start containerd-stargz-grpc even if there are unusable snapshots.
This leaves unusable snapshots (i.e. their
mount.Mount
will fail with error) after restore so user needs to remove these snapshots (e.g. by usingctr
).The warning message shows image name and key of the unusable snapshot so use can use this info for manually removing the image.
Add the following config to config.toml:
In this case, containerd-stargz-grpc restarted but the image
registry2:5000/ubuntu:20.04-esgz
isn't usable as shown in the above warning message.When you run this image, you get the following error:
So you need to manually remove it using ctr.
In the future, we should have a better support for restoring/restarting.