-
Notifications
You must be signed in to change notification settings - Fork 929
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
Storage: Fix redundant settings of zfs properties #13218
Storage: Fix redundant settings of zfs properties #13218
Conversation
b7ee6ae
to
573a8fb
Compare
573a8fb
to
65094ba
Compare
d54e8aa
to
f9bd384
Compare
f9bd384
to
97da373
Compare
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.
I am leaving #13218 (comment) up to you.
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.
The existing implementation of ensureInitialDatasets
is going a call to d.datasetExists
already and altering its call to a setDatasetProperties
rather than createDataset
call.
The reason for this is so that the dataset policies are enforced when the pool is mounted.
I don't quite see what this PR is aiming to achieve?
@tomponline this implementation avoids creating duplicate events on zfs by setting dataset properties multiple times unnecessarily. I am still discussing with @roosterfish to agree on the best way to implement this. |
Yes, but it does this by removing the mount time data set policy application, which is undesirable. |
Yes, I agree. This is why I haven't opened this PR for review yet. I will try to find a better solution as soon as possible. |
58c673c
to
01aebdf
Compare
@tomponline @roosterfish What do you think of this approach? |
01aebdf
to
9ade999
Compare
7dbc233
to
4685896
Compare
dcad5e5
to
0a213e0
Compare
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.
Looking good, just one more comment from my side :)
8bfcd93
to
d5cb5b2
Compare
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.
LGTM!
@tomponline this one seems ready.
lxd/storage/drivers/driver_zfs.go
Outdated
@@ -34,7 +34,7 @@ var zfsDefaultSettings = map[string]string{ | |||
"setuid": "on", | |||
"exec": "on", | |||
"devices": "on", | |||
"acltype": "posixacl", | |||
"acltype": "posix", // acltype "posix" is equivalent to "posixacl". Set as "posix" to avoid setting it multiple times on ensureInitialDatasets. |
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.
Is posix
newer than posixacl
and if so, when did it get introduced?
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.
posixacl
is older but was kept as an alias when posix
was added in September 16th, 2020
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.
which version was it added in?
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.
Can you check this doesn't break LXD 5.21/stable with this binary sideloaded on a ZFS 0.8 system (bionic with hwe kernel) please.
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.
Unfortunately it breaks. As can be seen here, support for posix
wasn't added until later. I am pushing a new version that solves this problem.
@hamistao please can you update the PR description to explain what this PR changes. |
@tomponline Done! |
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.
We need to ensure the initial datasets are created at pool creation time and fail pool creation if not.
d5cb5b2
to
92fdb3d
Compare
611bda3
to
590eec0
Compare
@hamistao is this ready for review (please do ping me each time you are ready for another review). |
03c0358
to
d4cfecd
Compare
@tomponline yes, it is. I will ping you from now on, sorry for the confusion. |
Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
…tasets` Signed-off-by: hamistao <pedro.ribeiro@canonical.com>
d4cfecd
to
1f506b0
Compare
Fixes #12278 by making It possible for LXD to get ZFS dataset properties before setting them and avoid resetting those that already have the desired value. Performs this operation on
ensureInitialDatasets
.