This will produce a zero-sized file:
# ll /var/lib/mysql/ib_logfile1
-rw-r----- 1 mysql mysql 0 Apr 18 17:37 /var/lib/mysql/ib_logfile1
Attempting to start mysql now will fail with this error:
2022-04-18T17:41:30.181861Z 1 [ERROR] [MY-012963] [InnoDB] Log file ./ib_logfile1 is of different size 0 bytes than other log files 17809408 bytes!
I'm suspecting fallocate() on zfs.
To reproduce, one can follow these steps:
rm -rf /var/lib/mysql/*
mysqld --initialize
This will produce a zero-sized file: mysql/ib_ logfile1 mysql/ib_ logfile1
# ll /var/lib/
-rw-r----- 1 mysql mysql 0 Apr 18 17:37 /var/lib/
Attempting to start mysql now will fail with this error: 18T17:41: 30.181861Z 1 [ERROR] [MY-012963] [InnoDB] Log file ./ib_logfile1 is of different size 0 bytes than other log files 17809408 bytes!
2022-04-
On a working system, that file is not zero-sized.
straceing mysqld --initialize shows: O_CREAT| O_EXCL, 0640) = 3 FL_ZERO_ RANGE, 0, 50331648) = 0
2253 openat(AT_FDCWD, "./ib_logfile1", O_RDWR|
2253 fcntl(3, F_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) = 0
2253 fallocate(3, FALLOC_
2253 fsync(3) = 0
2253 close(3) = 0
There have been previous bugs with zfs and fallocate(): /bugs.launchpad .net/ubuntu/ +source/ libvirt/ +bug/1847105 /github. com/openzfs/ zfs/issues/ 326
https:/
https:/
I tried --innodb- extend- and-initialize and --skip- innodb- extend- and-initialize, from https:/ /dev.mysql. com/worklog/ task/?id= 13782, but both ended up using fallocate().
A quick attempt with using the dir backend for lxd worked. Further investigation needs to be done.