[MDEV-27818] Disk plugin does not show zpool mounted devices Created: 2022-02-11  Updated: 2022-09-27  Resolved: 2022-08-31

Status: Closed
Project: MariaDB Server
Component/s: Plugins
Affects Version/s: 10.8.4
Fix Version/s: 10.3.37, 10.4.27, 10.5.18, 10.6.10, 10.7.6, 10.8.5, 10.9.3, 10.10.2

Type: Bug Priority: Major
Reporter: VAROQUI Stephane Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: beginner-friendly


 Description   

The plugin code wrongly filter devices not starting with a /. A much better solution would be filtering the mount point to enable pool devices to be reported /proc /dev /sys /run /etc can be removed as a monitoring solution should focus only on data & log & tmp directories that would not be mounted in such POSIX listed directory



 Comments   
Comment by Daniel Black [ 2022-02-11 ]

zulip example

data/db1.bench.vol.cloud18 /docker-entrypoint-initdb.d zfs rw,relatime,xattr,noacl 0 0
data/db1.bench.vol.cloud18 /etc/mysql zfs rw,relatime,xattr,noacl 0 0
data/db1.bench.vol.cloud18 /run/mysqld zfs rw,relatime,xattr,noacl 0 0
/dev/md127 /usr/share/zoneinfo/Etc/UTC ext4 ro,relatime 0 0
/dev/zd0 /etc/resolv.conf ext4 rw,relatime,stripe=2 0 0
/dev/zd0 /etc/hostname ext4 rw,relatime,stripe=2 0 0
/dev/zd0 /etc/hosts ext4 rw,relatime,stripe=2 0 0
data/db1.bench.vol.cloud18/data /var/lib/mysql zfs rw,relatime,xattr,noacl 0 0
data/db1.bench.vol.cloud18/tmp /var/lib/mysql/.system/tmp zfs rw,relatime,xattr,noacl 0 0
data/db1.bench.vol.cloud18/binlog /var/lib/mysql/.system/repl zfs rw,relatime,xattr,noacl 0 0
data/db1.bench.vol.cloud18/redo /var/lib/mysql/.system/innodb/redo zfs rw,relatime,xattr,noacl 0 0

$ podman run --rm mariadb mount
fuse-overlayfs on / type fuse.fuse-overlayfs (rw,noatime,user_id=0,group_id=0,default_permissions,allow_other)
sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime,seclabel)
tmpfs on /dev type tmpfs (rw,nosuid,context="system_u:object_r:container_file_t:s0:c336,c955",size=65536k,mode=755,uid=1000,gid=1000,inode64)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /etc/hostname type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=1608208k,nr_inodes=402052,mode=700,uid=1000,gid=1000,inode64)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime,seclabel)
shm on /dev/shm type tmpfs (rw,relatime,context="system_u:object_r:container_file_t:s0:c336,c955",size=64000k,uid=1000,gid=1000,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,context="system_u:object_r:container_file_t:s0:c336,c955",gid=100004,mode=620,ptmxmode=666)
tmpfs on /run/.containerenv type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=1608208k,nr_inodes=402052,mode=700,uid=1000,gid=1000,inode64)
tmpfs on /run/secrets type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=1608208k,nr_inodes=402052,mode=700,uid=1000,gid=1000,inode64)
tmpfs on /etc/resolv.conf type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=1608208k,nr_inodes=402052,mode=700,uid=1000,gid=1000,inode64)
tmpfs on /etc/hosts type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=1608208k,nr_inodes=402052,mode=700,uid=1000,gid=1000,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (ro,nosuid,nodev,noexec,relatime,seclabel,nsdelegate,memory_recursiveprot)
/dev/mapper/fedora_localhost--live-home on /var/lib/mysql type ext4 (rw,nosuid,nodev,relatime,seclabel)
devtmpfs on /dev/null type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
devtmpfs on /dev/zero type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
devtmpfs on /dev/full type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
devtmpfs on /dev/tty type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
devtmpfs on /dev/random type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
devtmpfs on /dev/urandom type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
tmpfs on /proc/acpi type tmpfs (ro,relatime,context="system_u:object_r:container_file_t:s0:c336,c955",size=0k,uid=1000,gid=1000,inode64)
devtmpfs on /proc/kcore type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
devtmpfs on /proc/keys type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
devtmpfs on /proc/latency_stats type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
devtmpfs on /proc/timer_list type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=131072,mode=755,inode64)
tmpfs on /proc/scsi type tmpfs (ro,relatime,context="system_u:object_r:container_file_t:s0:c336,c955",size=0k,uid=1000,gid=1000,inode64)
tmpfs on /sys/firmware type tmpfs (ro,relatime,context="system_u:object_r:container_file_t:s0:c336,c955",size=0k,uid=1000,gid=1000,inode64)
tmpfs on /sys/fs/selinux type tmpfs (ro,relatime,context="system_u:object_r:container_file_t:s0:c336,c955",size=0k,uid=1000,gid=1000,inode64)
tmpfs on /sys/dev/block type tmpfs (ro,relatime,context="system_u:object_r:container_file_t:s0:c336,c955",size=0k,uid=1000,gid=1000,inode64)
proc on /proc/asound type proc (ro,relatime)
proc on /proc/bus type proc (ro,relatime)
proc on /proc/fs type proc (ro,relatime)
proc on /proc/irq type proc (ro,relatime)
proc on /proc/sys type proc (ro,relatime)
proc on /proc/sysrq-trigger type proc (ro,relatime)

The df mechanism ref, df's filtering mechanism seems a little too elaborate.

So if instead of ^/ inclusive filtering, if start by excluding:

  • ro mounts
  • mount points that aren't a directory (i.e. files and devices)
  • /proc and /sys

Anything else?

Comment by VAROQUI Stephane [ 2022-02-12 ]

Looks great, a comment of interest from the df code is that they classify remote FS that could never respond if down so that a timeout need to be implemented if remote FS . List of FS found in https://github.com/coreutils/coreutils/blob/00ea4bacf6063ccc125209d5186f8f2382c6f0d4/src/stat.c

Comment by Daniel Black [ 2022-07-31 ]

stephane@skysql.com, thanks for the idea. I haven't done handling NFS timeouts. Looking for feedback if its important enough.

The getmntinfo bsd based implementations can pass a wait/nowait flag that probably handles NFS timeouts. Its unclear what else of the attributes this is caching or not. No such luck for linux getmntent interface in exposting something similar. I also don't know how killing threads would work here. If it just EINTR the syscall then that can return an error on retreival.

Can I get a review on PR 2216 please.

Generated at Thu Feb 08 09:55:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.