zfsonfreebsd/ZoF

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

evilham opened this issue · 7 comments

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:
5. The data zpool is not imported
6. 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

Would this have been a function of zfsd?

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?

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)

\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?

Interesting, I don't know. 🤔

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?

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