Skip to content
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

Ensure required subdirectories of /var/fm/fmd exist #4445

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Conversation

citrus-it
Copy link
Contributor

When a blank ZFS dataset is created to back /var/fm/fmd, the fault management daemon creates the files it needs but it does not create subdirectories that are required to store data. sled-agent needs to ensure these exist after mounting the dataset

Fixes #4444

When a blank ZFS dataset is created to back /var/fm/fmd, the fault
management daemon creates the files it needs but it does not create
subdirectories that are required to store data. sled-agent needs to
ensure these exist after mounting the dataset

Fixes #4444
@citrus-it citrus-it requested a review from papertigers November 6, 2023 16:08
@citrus-it citrus-it self-assigned this Nov 6, 2023
@citrus-it
Copy link
Contributor Author

I tested this on a bench gimlet with no pre-existing pools.

gimlet-sn06 # tail -F `svcs -L sled-agent` | looker -c 'r.component == "BackingFs"'
16:06:49.602Z INFO SledAgent (BackingFs): Processing fmd
    file = sled-agent/src/backing_fs.rs:126
16:06:49.602Z INFO SledAgent (BackingFs): Ensuring dataset oxi_a462a7f7-b628-40fe-80ff-4e4189e2d62b/backing/fmd
    file = sled-agent/src/backing_fs.rs:136
16:06:49.871Z INFO SledAgent (BackingFs): Stopping service svc:/system/fmd:default
    file = sled-agent/src/backing_fs.rs:170
16:06:51.042Z INFO SledAgent (BackingFs): Mounting oxi_a462a7f7-b628-40fe-80ff-4e4189e2d62b/backing/fmd on /var/fm/fmd
    file = sled-agent/src/backing_fs.rs:178
16:06:51.092Z INFO SledAgent (BackingFs): Ensuring directory /var/fm/fmd/rsrc
    file = sled-agent/src/backing_fs.rs:186
16:06:51.093Z INFO SledAgent (BackingFs): Ensuring directory /var/fm/fmd/ckpt
    file = sled-agent/src/backing_fs.rs:186
16:06:51.093Z INFO SledAgent (BackingFs): Ensuring directory /var/fm/fmd/xprt
    file = sled-agent/src/backing_fs.rs:186
16:06:51.093Z INFO SledAgent (BackingFs): Starting service svc:/system/fmd:default
    file = sled-agent/src/backing_fs.rs:192
gimlet-sn06 # ls -CF /var/fm/fmd
ckpt/           fltlog          infolog_hival   xprt/
errlog          infolog         rsrc/

@citrus-it citrus-it requested a review from jgallagher November 6, 2023 18:21
@@ -49,16 +53,19 @@ struct BackingFs {
compression: Option<&'static str>,
// Linked service
service: Option<&'static str>,
// Subdirectories to ensure
subdirs: Option<&'a [&'static str]>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is completely fine as-is, but I'll just note that you could do Option<&'static [&'static str]> here to avoid the <'a> bound on BackingFs. (Doing so would be less flexible than what you have, but since everything else in here has a 'static bound we could make this match.)

@citrus-it citrus-it merged commit fadecf7 into main Nov 7, 2023
20 checks passed
@citrus-it citrus-it deleted the andy/fmd branch November 7, 2023 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fmd backing store is missing some directories
2 participants