On Thu, Nov 16, 2023 at 10:34:51AM -0600, David Teigland wrote: > On Wed, Nov 15, 2023 at 07:35:49AM +0000, Martin Wilck wrote: > > How would that addition of the multipath device come to pass? > > By someone explicitly calling "lvmdevices" on it? > > Yes, by running lvmdevices --adddev /dev/mapper/mpatha, or by running > lvmdevices --update, which replaces a componenet device with the multipath > device. > > > 1 - someone creates a PV on a normal single-path SCSI device > > 2 - on subsequent boot, a new path has been added (e.g. by a Fibre > > Channel zoning change) > > 3 - what happens before the user makes any change to system.devices? > > a) LVM attempts to add one of the SCSI (path) devices as PV > > (which might be grabbed by multipathd already) > > b) LVM attempts to add the multipath device automatically, > > somehow figuring out what happened > > c) neither is attempted, and the PV is missing > > If a scsi device suddenly becomes a multipath component, then C. The > component device is ignored, the PV is missing, and lvm prints: > > WARNING: devices file is missing /dev/mapper/mpatha (253:1) using multipath component /dev/sda. > See lvmdevices --update for devices file update. > > https://sourceware.org/git/?p=lvm2.git;a=blob;f=lib/filters/filter-mpath.c;h=854c26a7c7284c9e566dbd89ea899e554a1c8ed9;hb=HEAD#l37 > > Maybe there's something better we could do there. I'm assuming the reality might be different depending on the multipath's find_multipaths setting. The only values where multipath's behavior can change depending on the number of paths present are "yes" and "smart". If "smart" is set, then everything may turn out as you say, but the only user of find_multipaths "smart" that I know of is the Anaconda installer for RHEL and Fedora. If find_multipaths is set to "yes", then initially, multipath won't claim the device, and LVM may well end up trying to use it and racing with multipathd (possibility A from above). This is pretty unavoidable if you want multipath to automatically claim devices only once multiple paths have appeared. -Ben > Dave