-
Notifications
You must be signed in to change notification settings - Fork 27
multipath: racing condition #154
Comments
So effectively what's going on here is the meaning (target) of One thing to verify: is
And from the man page it seems like OK from a quick glance at the multipathd code it does seem like it only signals readiness once it's processed the main loop and presumably switched the targets of the default udev symlinks. Hmm. That said, I feel like this is all still hacky; what we should probably do is use a kernel argument to signal that multipath is in use for the rootfs. It looks like dracut's multipath kernel module tries to probe the But it does seem to me that your changes to add |
In other words I think multipath falls into coreos/fedora-coreos-tracker#94 some at least - something like having coreos-installer write a kernel argument that we read. |
I think any of
Yeah that's the general idea. And this detection has to be done before ignition-user-setup service.
That |
Not just running I'd go with re-triggering the udev coldplug path, even though not very sure it's a good idea. |
A dummy |
The design for openshift/enhancements#211 puts a config file in cc @arithx |
Looks like having |
Can use:
instead. |
And to make sure I understand; we are using the existing dracut multipath module right? Is the |
@tuan-hoang1 So there's a few things going on here:
So there's a few problems going on here. |
The existing
The LUKS opener is triggered via:
So we need to change
|
OK I just looked at Which brings us to fedora-silverblue/issue-tracker#3 and https://lists.freedesktop.org/archives/systemd-devel/2019-November/043754.html So...I guess my 2¢ is for now to introduce But, there's more work here because coreos-installer needs to know about it - there's a PR here which needs some co-design work with whatever we do here.
Don't we just need to delay everything that is parsing the labels until after multipathd has taken ownership of them? In the end isn't the point of multipathd that there's a single virtual block device - we just need to ensure the multipath userspace takes ownership of the link. (I wonder if multipathd has any support today for detecting the case of labels on the devices it owns, or whether we need to re-run udev - and does udev know to ignore the "underlying" block devices of a mpath device?) |
Sadly, no. The only rules that apply are for
|
Should we just cargo-cult in anything in |
OK. Well, the labels I think are a sane default, but here we're not talking about the defaults. One path¹ then is to also have coreos-installer set
Seems reasonable to me - that said, the tradeoff is that I think the value though in avoiding people mutating our initramfs is going to be useful down the line, not just for signing but also allowing us to change how things work more easily. ¹ 😉 |
xref dracutdevs/dracut#792 for Dracut. Which was the implementation result of #154 (comment) |
We have another interesting problem -- we don't have device selection logic. And udev rules are not helpful. If you rely on And then we have the problem with finding the active path. I've started to work on the problem. I imagine though any fix will be controversial given the dislike for udev. |
My thoughts on rootfs discovery for multipath are the same for the (new) Ignition LUKS: coreos/ignition#960 (comment) |
I don't think anyone dislikes udev? I think we shouldn't have nontrivial logic in udev rules, but that's not "udev is bad". Or to restate this, let's use kernel arguments to find the root device in a predictable fashion - this is basically how everyone does it today. |
Filed coreos/fedora-coreos-tracker#465 which is related to this. |
The controversial part is that we'll need to use UDev and select based on device attributes. Consider:
And then
The default rules for labels excludes device mapper targets #154 (comment) and the device mapper rules do not create symlinks for labels. With dracutdevs/dracut@b8a92b7 booting with If we require users to do the Kargs game for device selection, we're recreating the painful user experience that we had with networking via edit: if you use Dracut upstream as an override and boot with |
OK it's good you mentioned user experience because we really need to be defining that - and then we can debate implementation details like udev rules etc. separately. One high level uncertainty I have is whether
And basically that ends up taking the From there, in the initramfs we know how to assemble the device before we go to look for the |
Will it work for us to target That seems like it would simplify a lot if true. But AIUI at least on s390x there is some sort of magic needed to "activate" a block device that will be used by a z/VM guest or so. See also coreos/coreos-installer#185 |
I did local tests with:
and was able to successfully install FCOS on |
We've solved this issue in FCOS. So I'm calling this done. @tuan-hoang1 thank you for your patience as we all worked this out. |
Ideally, on first boot, when
systemd-udevd.service
andmultipathd.service
are activated, finished,/dev/disk/by-label/boot
should be pointing to respective - for example/dev/mpatha1
, assuming friendly naming is used - rather than/dev/sda1
or/dev/sdb1
. So thatignition-setup-user.service
and other Ignition services should be able to pick up/dev/mpatha1
.But I have encountered that
ignition-setup-user.service
keeps picking/dev/sda1
, thus failing because a multipath link is already formed forsda
andsdb
to bempatha
.I have tried blindly adding (for the sake of testing)
to
dracut/30ignition/ignition-diskful.target
dracut/30ignition/ignition-disks.service
dracut/30ignition/[email protected]
dracut/30ignition/ignition-setup-user.service
dracut/30ignition/ignition-subsequent.target
but there seems to be a racing condition happening, that in rescue shell
/dev/mpatha
is formed butignition-setup-user.service
keeps looking for/dev/sdb
. Runningsystemctl restart initrd.target
allows a successful first boot.My understanding is that another trigger of
systemd-udev-trigger.service
should be enough for all/dev/disk/by-label/
links to be populated, after multipath paths are formed. Or we have to callinside
dracut/30ignition/ignition-setup-user.sh
before mounting/dev/disk/by-label/boot
Full log : https://tpaste.us/7KzB
The text was updated successfully, but these errors were encountered: