-
Notifications
You must be signed in to change notification settings - Fork 104
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
Shutdown nydusd if it serves no filesystem or snapshot #260
Shutdown nydusd if it serves no filesystem or snapshot #260
Conversation
7159216
to
18f3822
Compare
Codecov ReportBase: 35.93% // Head: 35.95% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #260 +/- ##
==========================================
+ Coverage 35.93% 35.95% +0.02%
==========================================
Files 28 28
Lines 2858 2859 +1
==========================================
+ Hits 1027 1028 +1
- Misses 1724 1725 +1
+ Partials 107 106 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
pkg/filesystem/fs/fs.go
Outdated
|
||
// Found shared daemon | ||
// Fscache userspace daemon has no host mountpoint. | ||
if d.HostMountpoint() == fs.rootMountpoint || fs.fsDriver == config.FsDriverFscache { |
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.
Maybe put it in a helper func.
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.
extracted a help function tryRetainSharedDaemon
pkg/filesystem/fs/fs.go
Outdated
|
||
for _, d := range liveDaemons { | ||
// Found shared daemon | ||
if d.HostMountpoint() == fs.rootMountpoint || fs.fsDriver == config.FsDriverFscache { |
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.
Ditto.
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.
Others LGTM!
So the modules can rely on this to decide if stop nydusd daemon. Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
As the snapshot and rafs intance is well managed now, we can easily umount a snapshot by its ID. Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
We can reliably judege the recoverd daemon is shared one when its host mount point equals to the root mount point. Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Stop the shared daemon when closing snapshotter if no snapshots is referenced to the shared daemon. Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Beyond nydusd 2.1, data blob cache has a suffix .blob.data Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
So we can know more about nydusd and snapshots via management API. Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Make the log lines more suggestive and clear. Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
No need to use has_daemon to check. Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
18f3822
to
cbe79da
Compare
In sharedDaemon mode, we should also shut down the shared nydusd if it is not needed by any snapshot.
In addition, we should retain the shared daemon object in fs layer when doing recovery during nydus-snapshotter startup.