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

Use local properties when querying oxide values #6988

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

smklein
Copy link
Collaborator

@smklein smklein commented Nov 5, 2024

We use Oxide-specific ZFS properties to attach additional metadata to datasets, such as UUIDs.

Unfortunately, by default, when we query these properties, the information is inherited.

This means that, for example, if we try to set the "oxide:uuid" property on a transient zone filesystem root, say,

oxp_7b24095a-72df-45e3-984f-2b795e052ac7/crypt/zone

And we have a dataset within that existing dataset which does not have the "oxide:uuid" property set, at, say:

oxp_7b24095a-72df-45e3-984f-2b795e052ac7/crypt/zone/oxz_crucible_01f93020-7e7d-4185-93fb-6ca234056c82

Then when we query zfs get oxide:uuid on each of these datasets, we'll see the UUID of the transient root for both datasets.

By using the -s local argument to ZFS get, we prevent this from happening - now, these properties will only be accessible for the dataset where they are directly set.

@smklein smklein marked this pull request as ready for review November 5, 2024 02:47
Copy link
Contributor

@karencfv karencfv left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Tested manually on a single-sled installation by setting a new blueprint that added clickhouse_server and clickhouse_keeper zones, and enabling it. The results were as expected, all new zones came up.

Additionally, tested by checking that one of the datasets returned a local source for the UUID property:

$ zfs get oxide:uuid oxp_6d9de81c-7048-4b1c-be11-06325d7e9a82/crypt/zone/oxz_clickhouse_6f699c2b-c016-4b73-a413-1f04aea9727c
NAME                                                                                                     PROPERTY    VALUE                                 SOURCE
oxp_6d9de81c-7048-4b1c-be11-06325d7e9a82/crypt/zone/oxz_clickhouse_6f699c2b-c016-4b73-a413-1f04aea9727c  oxide:uuid  7b0ca154-ddce-42ff-b994-d2c70012d671  local

Previously, the same command returned an inherited source instead:

$ zfs get oxide:uuid oxp_6e2a9bd6-6a2a-4c98-abb9-53571b363366/crypt/zone/oxz_clickhouse_dbc2de9c-e658-4e53-8187-e25dd318031d
NAME                                                                                                     PROPERTY    VALUE                                 SOURCE
oxp_6e2a9bd6-6a2a-4c98-abb9-53571b363366/crypt/zone/oxz_clickhouse_dbc2de9c-e658-4e53-8187-e25dd318031d  oxide:uuid  b0c14f71-eeb1-4b89-96fe-1ea9d90c309d  inherited from oxp_6e2a9bd6-6a2a-4c98-abb9-53571b363366/crypt/zone

@smklein smklein merged commit 7ca80f1 into main Nov 5, 2024
16 checks passed
@smklein smklein deleted the local-props branch November 5, 2024 04:22
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.

2 participants