zfsonfreebsd / ZoF

ZFS on FreeBSD - the official out of tree OpenZFS implementation for FreeBSD
https://freebsd.org
Other
100 stars 8 forks source link

Behaviour change vs legacy zfs kmod: imported pools are 'exported' if unavailable #157

Closed evilham closed 4 years ago

evilham commented 4 years ago

Previously observed behaviour with zfs kmod (from HEAD):

  1. A new zpool is made available (e.g. geli attach)
  2. The zpool is imported
  3. Something happens (e.g. system reboot) and the zpool is not available anymore but also not exported
  4. The zpool is made available again
  5. The zpool is still imported
  6. The zpool must be manually mounted

With the patches for OpenZFS, number 5 and 6 are instead:

  1. The data zpool is not imported
  2. The zpool must be manually re-imported

This is different but unsure if it's to be considered critical.

Creating here for archive as per: https://lists.freebsd.org/pipermail/freebsd-current/2020-July/076551.html

ghost commented 4 years ago

Would this have been a function of zfsd?

evilham commented 4 years ago

Hello, I don't know, but I will look into a couple 'legacy' ZFS issues over the weekend, do you have any pointers as to how I could determine if that was indeed the case?

ghost commented 4 years ago

I think you might be missing a necessary change to /etc/rc.d/zfs to import additional pools on boot (it should have been pushed to mattmacy/networking:projects/openzfs_vendor by now)

evilham commented 4 years ago

\o I just had the chance to try compiling and installing the updated repos and still observed this behaviour.

Because of your pointer I checked and indeed a change is not being installed:

> diff /etc/rc.d/zfs libexec/rc/rc.d/zfs
27a28,34
>   local cachefile
> 
>   for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do
>       if [ -r $cachefile ]; then
>           zpool import -c $cachefile -a
>       fi
>   done

Also vis /etc/zfs/zpool.cache does list my pool, so I really think you are right here, will manually install it and finish confirming tomorrow.

In my build flow I use WITH_META_MODE, could this be the reason why the change is not being installed? Could it be something else I can help debug?

ghost commented 4 years ago

Interesting, I don't know. 🤔

evilham commented 4 years ago

Huh! Just made a test, deleted /etc/rc.d/zfs and ran make install | tee install.log, afterwards /etc/rc.d/zfs is missing and cat install.log | grep rc.d/zfs stays empty.

Could anyone else check if the rc script is being installed properly on their system?

ghost commented 4 years ago

This is working in base now. The latest rc scripts should be installed by etcupdate.