Re: ZFS parallel mounting gone wrong?

2019-04-17 Thread Trond Endrestøl
On Mon, 15 Apr 2019 15:24+0200, Trond Endrestøl wrote:

> I upgraded a non-critical system running amd64 stable/12 to r346220.
> 
> During multiuser boot not all ZFS filesystems below zroot/usr/local 
> was mounted.

Some more explaining is in order:

This system has two 7 year old pools that complement each other.

/usr/local comes mostly from the zroot pool, but other children comes 
from a zdata pool. The intermediary filesystems have their canmount 
property set to off and mountpoints are specified at the top level 
only. The same goes for other parts of the filesystem hierarchy, such 
as /var/db and /var/spool.

I just upgraded to stable/12 global r346269, local r346268. During 
a routine "zfs mount -av" performed in single user mode, the kernel 
proceeded to mount a child filesystem (enterprise_zdata/var/db/mysql) 
without the parent filesystems being mounted first.

I rebooted back to r345628 from March 28th, and this kernel has no 
problems correctly mounting the ZFS filesystems in parallel. That BE 
used LLVM 7.0.1 from base as its system compiler.

Rebooting into r346220 (April 15th) or r346269 (April 17th) clearly 
shows problems mounting filesystems in the correct order. These BEs 
was compiled using LLVM 8.0.0 from base.

Maybe the system compiler is irrelevant.

The name of the pools might also be a factor, the zdata pool preceedes 
the zroot pool in alphanumerical order.

Maybe there is a bug in the code, or the code breaks when parts of the 
filesystem hierarchy is being built from multiple pools.

Here's an attempt at explaining how this fits together:

zfs list -ro name,canmount,mountpoint enterprise_zroot/usr enterprise_zdata/usr 
enterprise_zroot/var enterprise_zdata/var
[the list has been slightly edited, moving zdata below zroot and adding an 
empty line]

NAME   CANMOUNT  MOUNTPOINT
enterprise_zroot/usroff  /usr
enterprise_zroot/usr/compat  on  /usr/compat
enterprise_zroot/usr/local   on  /usr/local
enterprise_zroot/usr/local/certs on  
/usr/local/certs
enterprise_zroot/usr/local/etc   on  /usr/local/etc
enterprise_zroot/usr/local/etc/shellkonfig3  on  
/usr/local/etc/shellkonfig3
enterprise_zroot/usr/local/etc/shellkonfig3/head on  
/usr/local/etc/shellkonfig3/head
enterprise_zroot/usr/local/etc/shellkonfig3/stable-10on  
/usr/local/etc/shellkonfig3/stable-10
enterprise_zroot/usr/local/etc/shellkonfig3/stable-11on  
/usr/local/etc/shellkonfig3/stable-11
enterprise_zroot/usr/local/etc/shellkonfig3/stable-8 on  
/usr/local/etc/shellkonfig3/stable-8
enterprise_zroot/usr/local/etc/shellkonfig3/stable-9 on  
/usr/local/etc/shellkonfig3/stable-9
enterprise_zroot/usr/local/info  on  /usr/local/info
enterprise_zroot/usr/local/var   on  /usr/local/var
enterprise_zroot/usr/obj on  /usr/obj
enterprise_zroot/usr/ports   on  /usr/ports
enterprise_zroot/usr/ports/distfiles on  
/usr/ports/distfiles
enterprise_zroot/usr/ports/localoff  
/usr/ports/local
enterprise_zroot/usr/ports/packages  on  
/usr/ports/packages
enterprise_zroot/usr/ports/workdirs  on  
/usr/ports/workdirs
enterprise_zroot/usr/src on  /usr/src
enterprise_zdata/usroff  /usr
enterprise_zdata/usr/local  off  /usr/local
enterprise_zdata/usr/local/moodledataon  
/usr/local/moodledata
enterprise_zdata/usr/local/pgsql on  
/usr/local/pgsql
enterprise_zdata/usr/local/restaurering  on  
/usr/local/restaurering
enterprise_zdata/usr/local/www   on  /usr/local/www
enterprise_zdata/usr/local/www/moodleon  
/usr/local/www/moodle

enterprise_zroot/varoff  /var
enterprise_zroot/var/Named   on  /var/Named
enterprise_zroot/var/account on  /var/account
enterprise_zroot/var/audit   on  /var/audit
enterprise_zroot/var/cache  off  /var/cache
enterprise_zroot/var/cache/ccacheon  
/var/cache/ccache
enterprise_zroot/var/cache/synth on  
/var/cache/synth
enterprise_zroot/var/crash   on  /var/crash
enterprise_zroot/var/db  on  /var/db
enterprise_zroot/var/db/darkstat on  
/var/db/darkstat
enterprise_zroot/var/db/dkim   

ZFS parallel mounting gone wrong?

2019-04-15 Thread Trond Endrestøl
Hi,

I upgraded a non-critical system running amd64 stable/12 to r346220.

During multiuser boot not all ZFS filesystems below zroot/usr/local 
was mounted.

Out of these filesystems, only zroot/usr/local/etc/shellkonfig3 was 
mounted:

zroot/usr/local
zroot/usr/local/certs
zroot/usr/local/etc
zroot/usr/local/etc/shellkonfig3
zroot/usr/local/etc/shellkonfig3/head
zroot/usr/local/etc/shellkonfig3/stable-10
zroot/usr/local/etc/shellkonfig3/stable-11
zroot/usr/local/etc/shellkonfig3/stable-8
zroot/usr/local/etc/shellkonfig3/stable-9
zroot/usr/local/info
zroot/usr/local/var

It's not a one-off bug, it can be replicated simply by rebooting this 
system. There is no M appended to my revision number.

Booting into singleuser mode and correctly mount all filesystems 
manually before returning to multiuser mode is not something I want to 
repeat. I will create a shell script to ease the pain anyway.

-- 
Trond.
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"