Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Nov 2022 10:50:53 +0100
From:      Alexander Leidinger <Alexander@leidinger.net>
To:        Warner Losh <imp@bsdimp.com>, marklmi@yahoo.com
Cc:        Li-Wen Hsu <lwhsu@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 72a1cb05cd23 - main - rc(8): Add a zpoolupgrade rc.d script
Message-ID:  <20221108105053.Horde.eqgFiBJe2ngGAj6BkXcv5-Z@webmail.leidinger.net>
In-Reply-To: <CANCZdfrdc%2BDbv6sDyDLcWNpXnWScEmpUsGu3q8%2BMbZRjDS8eig@mail.gmail.com>
References:  <202211070339.2A73dJlO027991@gitrepo.freebsd.org> <20221107121514.Horde.nulS9Wg1s3yzAsXXkuJRBa9@webmail.leidinger.net> <CANCZdfrdc%2BDbv6sDyDLcWNpXnWScEmpUsGu3q8%2BMbZRjDS8eig@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format and has been PGP signed.

--=_thrjPkoMLuD2j4Rj9EGBFwk
Content-Type: multipart/alternative; boundary="=_v_NuznhOh5dfXKA4Ei6J_Hb"

This message is in MIME format.

--=_v_NuznhOh5dfXKA4Ei6J_Hb
Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes
Content-Description: Textnachricht
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

  Quoting Warner Losh <imp@bsdimp.com> (from Mon, 7 Nov 2022 14:23:11 -0700=
):

> =C2=A0
>
>        On Mon, Nov 7, 2022 at 4:15 AM Alexander Leidinger=20=20
>=20<Alexander@leidinger.net> wrote:
>
>> Quoting Li-Wen Hsu <lwhsu@freebsd.org> (from Mon, 7 Nov 2022 03:39:19 GM=
T):
>>
>>> The branch main has been updated by lwhsu:
>>>
>>> URL:=C2=A0
>>> https://cgit.FreeBSD.org/src/commit/?id=3D72a1cb05cd230ce0d12a7180ae65d=
dbba2e0cb6d
>>>
>>> commit 72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d
>>> Author:=C2=A0 =C2=A0 =C2=A0Li-Wen Hsu <lwhsu@FreeBSD.org>
>>> AuthorDate: 2022-11-07 03:30:09 +0000
>>> Commit:=C2=A0 =C2=A0 =C2=A0Li-Wen Hsu <lwhsu@FreeBSD.org>
>>> CommitDate: 2022-11-07 03:30:09 +0000
>>>
>>> =C2=A0 =C2=A0 =C2=A0rc(8): Add a zpoolupgrade rc.d script
>>>
>>> =C2=A0 =C2=A0 =C2=A0If a zpool is created by makefs(8), its version is =
5000, i.e., all
>>> =C2=A0 =C2=A0 =C2=A0feature flags are off.=C2=A0 Introduce an rc script=
 to run `zpool upgrade`
>>> =C2=A0 =C2=A0 =C2=A0over the assigned zpools on the first boot.=C2=A0 T=
his is useful to the
>>> =C2=A0 =C2=A0 =C2=A0ZFS based VM images built from release(7).
>>
>>> diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
>>> index f9ceabc83120..43fa44a5f1cb 100644
>>> --- a/share/man/man5/rc.conf.5
>>> +++ b/share/man/man5/rc.conf.5
>>> @@ -24,7 +24,7 @@
>>> =C2=A0 .\"
>>> =C2=A0 .\" $FreeBSD$
>>> =C2=A0 .\"
>>> -.Dd August 28, 2022
>>> +.Dd November 7, 2022
>>> =C2=A0 .Dt RC.CONF 5
>>> =C2=A0 .Os
>>> =C2=A0 .Sh NAME
>>> @@ -2109,6 +2109,13 @@ A space-separated list of ZFS pool names for=C2=
=A0
>>> which new pool GUIDs should be
>>> =C2=A0 assigned upon first boot.
>>> =C2=A0 This is useful when using a ZFS pool copied from a template, suc=
h=C2=A0
>>> as a virtual
>>> =C2=A0 machine image.
>>> +.It Va zpool_upgrade
>>> +.Pq Vt str
>>> +A space-separated list of ZFS pool names for which version should=C2=
=A0
>>> be upgraded
>>> +upon first boot.
>>> +This is useful when using a ZFS pool generated by
>>> +.Xr makefs 8
>>> +utility.
>>
>> For someone who knows ZFS well, it is clear that only a zpool upgrade=C2=
=A0
>> is done. Not so experienced people may assume there is a combination=C2=
=A0
>> of zpool upgrade and zfs upgrade (more so for people which do not know=
=C2=A0
>> what the difference is). Maybe you want to add some explicit=C2=A0
>> documentation, that zfs upgrade + feature flags needs to be done by=C2=
=A0
>> hand.
>>
>> And this brings me to a second topic, we don't have an explicit list=C2=
=A0
>> of features which are supported by the bootloader (I had a look at the=
=C2=A0
>> zfs and the boot related man pages, if I overlooked a place, then the=C2=
=A0
>> other places should reference this important part with some text).
>
>     =C2=A0
>     There is a fixed list of features we support in the boot loader:
>     =C2=A0
>     /*
> =C2=A0* List of ZFS features supported for read
> =C2=A0*/
> static const char *features_for_read[] =3D {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.illumos:lz4_compress",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:hole_birth",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:extensible_dataset",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:embedded_data",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.open-zfs:large_blocks",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.illumos:sha512",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.illumos:skein",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.zfsonlinux:large_dnode",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.joyent:multi_vdev_crash_dump",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:spacemap_histogram",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:zpool_checkpoint",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:spacemap_v2",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.datto:encryption",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.datto:bookmark_v2",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.zfsonlinux:allocation_classes",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.datto:resilver_defer",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:device_removal",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:obsolete_counts",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.intel:allocation_classes",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.freebsd:zstd_compress",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:bookmark_written",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "com.delphix:head_errlog",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "org.openzfs:blake3",
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL
> };
>     =C2=A0
>     Any feature not on this list will cause the boot loader to=20=20
>=20reject the pool.
>     =C2=A0
>     Whether or not it should do that by default, always, or never is an o=
pen
>     question. I've thought there should be a 'shoot footing'=20=20
>=20override that isn't
>     there today.
>     =C2=A0

Thanks for the list. For those interested, it is in
=C2=A0 =C2=A0=C2=A0$SRC/stand/libsa/zfs/zfsimpl.c

Just to make my opinion expressed before explicit again, this should=20=20
be=20documented in a boot / bootloader related man-page, but isn't.

Should the above list be sorted in some way? Maybe in the same order=20=20
as=20the zpool-features lists them (sort by feature name after the=20=20
colon),=20or alphabetical?

As Mark already mentioned some flags, I checked the features marked as=20=
=20
read=20only (I checked in the zpool-features man page, including the=20=20
dependencies=20documented there) and here are those not listed in=20=20
zfsimpl.c.=20I would assume as they are read-only compatible, we should=20=
=20
add=20them:
=C2=A0 =C2=A0 com.delphix:async_destroy
=C2=A0 =C2=A0 com.delphix:bookmarks
=C2=A0 =C2=A0 org.openzfs:device_rebuild
=C2=A0 =C2=A0 com.delphix:empty_bpobj
=C2=A0 =C2=A0 com.delphix:enable_txg
=C2=A0 =C2=A0 com.joyent:filesystem_limits
=C2=A0 =C2=A0 com.delphix:livelist
=C2=A0 =C2=A0 com.delphix:log_spacemap
=C2=A0 =C2=A0 com.zfsonlinux:project_quota
=C2=A0 =C2=A0 com.zfsonlinux:userobj_accounting
=C2=A0 =C2=A0 com.openzfs:zilsaxattr

Bye,
Alexander.
--=20
http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    netchild@FreeBSD.org  : PGP 0x8F31830F9F2772BF

--=_v_NuznhOh5dfXKA4Ei6J_Hb
Content-Type: text/html; charset=utf-8
Content-Description: HTML-Nachricht
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">;
<html>
<head>
<meta http-equiv=3D"content-type" content=3D"text/html; charset=3Dutf-8">
<title></title>
</head>
<body style=3D"font-family:Arial;font-size:14px">
<p>Quoting Warner Losh &lt;<a href=3D"mailto:imp@bsdimp.com">imp@bsdimp.com=
</a>&gt; (from Mon, 7 Nov 2022 14:23:11 -0700):</p>
<blockquote style=3D"border-left:2px solid blue;margin-left:2px;padding-lef=
t:12px;" type=3D"cite">
<div dir=3D"ltr">
<div dir=3D"ltr">&nbsp;</div>
<br>
<div class=3D"gmail_quote">
<div class=3D"gmail_attr" dir=3D"ltr">On Mon, Nov 7, 2022 at 4:15 AM Alexan=
der Leidinger &lt;<a href=3D"mailto:Alexander@leidinger.net">Alexander@leid=
inger.net</a>&gt; wrote:</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex">
<p><br>
Quoting Li-Wen Hsu &lt;<a href=3D"mailto:lwhsu@freebsd.org" target=3D"_blan=
k">lwhsu@freebsd.org</a>&gt; (from Mon, 7 Nov 2022 03:39:19 GMT):<br>
<br>
&gt; The branch main has been updated by lwhsu:<br>
&gt;<br>
&gt; URL:&nbsp;<br>
&gt; <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D72a1cb05cd230ce0d=
12a7180ae65ddbba2e0cb6d" rel=3D"noreferrer" target=3D"_blank">https://cgit.=
FreeBSD.org/src/commit/?id=3D72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d</a><b=
r>
&gt;<br>
&gt; commit 72a1cb05cd230ce0d12a7180ae65ddbba2e0cb6d<br>
&gt; Author:&nbsp; &nbsp; &nbsp;Li-Wen Hsu &lt;lwhsu@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2022-11-07 03:30:09 +0000<br>
&gt; Commit:&nbsp; &nbsp; &nbsp;Li-Wen Hsu &lt;lwhsu@FreeBSD.org&gt;<br>
&gt; CommitDate: 2022-11-07 03:30:09 +0000<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp;rc(8): Add a zpoolupgrade rc.d script<br>
&gt;<br>
&gt;&nbsp; &nbsp; &nbsp;If a zpool is created by makefs(8), its version is =
5000, i.e., all<br>
&gt;&nbsp; &nbsp; &nbsp;feature flags are off.&nbsp; Introduce an rc script=
 to run `zpool upgrade`<br>
&gt;&nbsp; &nbsp; &nbsp;over the assigned zpools on the first boot.&nbsp; T=
his is useful to the<br>
&gt;&nbsp; &nbsp; &nbsp;ZFS based VM images built from release(7).<br>
<br>
&gt; diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5<br>
&gt; index f9ceabc83120..43fa44a5f1cb 100644<br>
&gt; --- a/share/man/man5/rc.conf.5<br>
&gt; +++ b/share/man/man5/rc.conf.5<br>
&gt; @@ -24,7 +24,7 @@<br>
&gt;&nbsp; .\"<br>
&gt;&nbsp; .\" $FreeBSD$<br>
&gt;&nbsp; .\"<br>
&gt; -.Dd August 28, 2022<br>
&gt; +.Dd November 7, 2022<br>
&gt;&nbsp; .Dt RC.CONF 5<br>
&gt;&nbsp; .Os<br>
&gt;&nbsp; .Sh NAME<br>
&gt; @@ -2109,6 +2109,13 @@ A space-separated list of ZFS pool names for&nb=
sp;<br>
&gt; which new pool GUIDs should be<br>
&gt;&nbsp; assigned upon first boot.<br>
&gt;&nbsp; This is useful when using a ZFS pool copied from a template, suc=
h&nbsp;<br>
&gt; as a virtual<br>
&gt;&nbsp; machine image.<br>
&gt; +.It Va zpool_upgrade<br>
&gt; +.Pq Vt str<br>
&gt; +A space-separated list of ZFS pool names for which version should&nbs=
p;<br>
&gt; be upgraded<br>
&gt; +upon first boot.<br>
&gt; +This is useful when using a ZFS pool generated by<br>
&gt; +.Xr makefs 8<br>
&gt; +utility.<br>
<br>
For someone who knows ZFS well, it is clear that only a zpool upgrade&nbsp;=
<br>
is done. Not so experienced people may assume there is a combination&nbsp;<=
br>
of zpool upgrade and zfs upgrade (more so for people which do not know&nbsp=
;<br>
what the difference is). Maybe you want to add some explicit&nbsp;<br>
documentation, that zfs upgrade + feature flags needs to be done by&nbsp;<b=
r>
hand.<br>
<br>
And this brings me to a second topic, we don't have an explicit list&nbsp;<=
br>
of features which are supported by the bootloader (I had a look at the&nbsp=
;<br>
zfs and the boot related man pages, if I overlooked a place, then the&nbsp;=
<br>
other places should reference this important part with some text).</p>
</blockquote>
<div>&nbsp;</div>
<div>There is a fixed list of features we support in the boot loader:</div>
<div>&nbsp;</div>
<div>/*<br>
&nbsp;* List of ZFS features supported for read<br>
&nbsp;*/<br>
static const char *features_for_read[] =3D {<br>
&nbsp; &nbsp; &nbsp; &nbsp; "org.illumos:lz4_compress",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:hole_birth",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:extensible_dataset",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:embedded_data",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "org.open-zfs:large_blocks",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "org.illumos:sha512",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "org.illumos:skein",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "org.zfsonlinux:large_dnode",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.joyent:multi_vdev_crash_dump",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:spacemap_histogram",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:zpool_checkpoint",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:spacemap_v2",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.datto:encryption",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.datto:bookmark_v2",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "org.zfsonlinux:allocation_classes",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.datto:resilver_defer",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:device_removal",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:obsolete_counts",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.intel:allocation_classes",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "org.freebsd:zstd_compress",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:bookmark_written",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "com.delphix:head_errlog",<br>
&nbsp; &nbsp; &nbsp; &nbsp; "org.openzfs:blake3",<br>
&nbsp; &nbsp; &nbsp; &nbsp; NULL<br>
};</div>
<div>&nbsp;</div>
<div>Any feature not on this list will cause the boot loader to reject the =
pool.</div>
<div>&nbsp;</div>
<div>Whether or not it should do that by default, always, or never is an op=
en</div>
<div>question. I've thought there should be a 'shoot footing' override that=
 isn't</div>
<div>there today.</div>
<div>&nbsp;</div>
</div>
</div>
</blockquote>
<p><br>
Thanks for the list. For those interested, it is in<br>
&nbsp; &nbsp;&nbsp;$SRC/stand/libsa/zfs/zfsimpl.c<br>
<br>
Just to make my opinion expressed before explicit again, this should be doc=
umented in a boot / bootloader related man-page, but isn't.<br>
<br>
Should the above list be sorted in some way? Maybe in the same order as the=
 zpool-features lists them (sort by feature name after the colon), or alpha=
betical?<br>
<br>
As Mark already mentioned some flags, I checked the features marked as read=
 only (I checked in the zpool-features man page, including the dependencies=
 documented there) and here are those not listed in zfsimpl.c. I would assu=
me as they are read-only compatible, we should add them:<br>
&nbsp; &nbsp; com.delphix:async_destroy<br>
&nbsp; &nbsp; com.delphix:bookmarks<br>
&nbsp; &nbsp; org.openzfs:device_rebuild<br>
&nbsp; &nbsp; com.delphix:empty_bpobj<br>
&nbsp; &nbsp; com.delphix:enable_txg<br>
&nbsp; &nbsp; com.joyent:filesystem_limits<br>
&nbsp; &nbsp; com.delphix:livelist<br>
&nbsp; &nbsp; com.delphix:log_spacemap<br>
&nbsp; &nbsp; com.zfsonlinux:project_quota<br>
&nbsp; &nbsp; com.zfsonlinux:userobj_accounting<br>
&nbsp; &nbsp; com.openzfs:zilsaxattr<br>
<br>
Bye,<br>
Alexander.<br>
<br></p>
<div><a href=3D"http://www.Leidinger.net" target=3D"_blank">http://www.Leid=
inger.net</a> <a href=3D"mailto:Alexander@Leidinger.net">Alexander@Leidinge=
r.net</a>: PGP 0x8F31830F9F2772BF<br>
<a href=3D"http://www.FreeBSD.org" target=3D"_blank">http://www.FreeBSD.org=
</a>&nbsp; &nbsp; <a href=3D"mailto:netchild@FreeBSD.org">netchild@FreeBSD.=
org</a>&nbsp; : PGP 0x8F31830F9F2772BF</div>
</body>
</html>
--=_v_NuznhOh5dfXKA4Ei6J_Hb--

--=_thrjPkoMLuD2j4Rj9EGBFwk
Content-Type: application/pgp-signature
Content-Description: Digitale PGP-Signatur
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIzBAABCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmNqJn0ACgkQEg2wmwP4
2IYIbg//R/S8wiUlRnXlGrPhnHJ//rbUpETW6wtjH2zs3nMNPQIys4/dNlR7gtOf
F3EniivXAr0BxkDNGdjO+XA2l1l6A7JjQn3g4DTg861yv5rWMpSk8bOMHd8P07N1
jTQWxCEIHnWcuzzjdNfjK5VYKDddcTeLjBfFc9mTnA7KfCTYdc4f5hIypHHY6VQ/
6pcZ0jZTloih5AHePV/ZIdX4zD8d0MNjxmOW2DdO782qKgQVBVZloZa472j0Nm4X
rF+q61t2JzQi5y3OF1aEEKYR7tgUKtWzpgaS+eb0ySixACmev9e/WvI+LvOPNzRG
vzG7scWyGJ2/jl61MqNZ0d8y/OWDudP3qM32KgBo8cPY/ZQFOeiLP+Zers75ADW3
IOG3VunB0cZA55PPeWXvNYL+HwKDOkghPJEmikuVCcBb8xh7BCxNcU4rhvsSmTDx
WG2pk7TTl0MWsGjL7h+jb+Pb4tKEOTKuYX7Fyy6/9gpHU7RQEqdAG0X56Jv2ufmE
qTPParsoOY1dyYMWisLrD0ec4PEE0Co9KHjtp/yHE1mgx8IibqhQG+T4f63z8kpD
NSB0HVozb2cFyh3CI3yh4Ew4Ic8wBVGEcK8/0bstleGVdTXhbZDj8RZqA52cPxEa
9QLi6T1gZMukVRXxdr9v4bROyN1jni0BPfodLYvepcWYXe7m914=
=KayF
-----END PGP SIGNATURE-----

--=_thrjPkoMLuD2j4Rj9EGBFwk--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20221108105053.Horde.eqgFiBJe2ngGAj6BkXcv5-Z>