All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-devel] [PATCH 0/7] multipathd: remove udev settle dependency
@ 2021-10-20 19:15 Benjamin Marzinski
  2021-10-20 19:15 ` [dm-devel] [PATCH 1/7] multipathd: remove missing paths on startup Benjamin Marzinski
                   ` (7 more replies)
  0 siblings, 8 replies; 25+ messages in thread
From: Benjamin Marzinski @ 2021-10-20 19:15 UTC (permalink / raw)
  To: Christophe Varoqui; +Cc: device-mapper development, Martin Wilck

So, it turns out that commit 4ef67017 "libmultipath: add
update_pathvec_from_dm()" already does most of the hard work of making
multipath handle the uninitialized paths that exist during boot, after
the switch root, but before the all the coldplug uevents have been
processed. The only problem is that this code leaves the paths in a
partially initialized state, which doesn't completely get corrected until
a reconfigure happens. 

This patchset makes multipath track these partially initailized paths,
and makes sure that they get fully initialized, or removed, as
necessary.

The first patch is a tangentially related bug I found when trying
(unsuccessfully) to recreate multipathd's problem with dropping
uninitialized paths. Multipathd was not removing completely missing
paths from maps that it found while starting up. The solution I chose
was just to make sure that a full reload will happen on these maps, even
if a weak reconfigure was requested. However, this means that multipath
still completely ignores these missing paths. A side effect of this is
that "multipath -l" does not show these paths, even though they exist as
part of the multipath table. The full reloads are necessary, to take
care of issues that update_pathvec_from_dm() can run into, but we might
also want to think about marking these missing paths as INIT_REMOVED,
instead of not adding them at all. This would make "multipath -l" still
show them, until they actually get removed from the table.

Patch 0005 makes sure to fully initialize the paths when their coldplug
event occurs, but if the path is already fully initialized in udev, but
multipathd finds out about it from update_pathvec_from_dm(), multipath
doesn't do anything to finish initializing the path and moving it to
INIT_OK, besides waiting for a uevent or a reconfigure. This is probably
fine, since the only way I can see for a path to be in this state is for
someone to manually remove the path from multipathd monitoring. But if
I'm missing some other way that paths could end up in this state, we
could try proactively finishing the initalization of INIT_PARTIAL paths
that have all their udev information.

I'm also kind of on the fence about patch 0006. There is no reason why
we have to remove INIT_PARTIAL paths if the multipath device goes away.
But if a path is in INIT_PARTIAL for long enough that the multipath
device gets removed, then it's likely not a path we want to be
monitoring, and if a uevent occurs, we'll add it back, anyway. Also,
knowing that INIT_PARTIAL paths are always part of multipath devices
does make the code simpler.

I've tested these patches both by rebooting with necessary and
unnecessary multipath devices in the initramfs and multipathd.service
set to make multipathd start up at various points after the switch root,
and by manually sending remove uevents to unintialize some paths, and
then starting multipathd to test specific combinations of path states.
But more testing is always welcome.

Benjamin Marzinski (7):
  multipathd: remove missing paths on startup
  libmultipath: skip unneeded steps to get path name
  libmultipath: don't use fallback wwid in update_pathvec_from_dm
  libmultipath: always set INIT_REMOVED in set_path_removed
  multipathd: fully initialize paths added by update_pathvec_from_dm
  multipathd: remove INIT_PARTIAL paths that aren't in a multipath
    device
  multipathd: Remove dependency on systemd-udev-settle.service

 libmultipath/configure.c      |  2 ++
 libmultipath/devmapper.c      |  2 ++
 libmultipath/discovery.c      |  7 ++---
 libmultipath/discovery.h      |  2 ++
 libmultipath/structs.h        |  7 +++++
 libmultipath/structs_vec.c    | 40 ++++++++++++++++-------------
 multipathd/cli_handlers.c     |  4 +++
 multipathd/main.c             | 48 ++++++++++++++++++++++++++++++++---
 multipathd/main.h             |  1 +
 multipathd/multipathd.service |  3 +--
 10 files changed, 90 insertions(+), 26 deletions(-)

-- 
2.17.2

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2021-11-08 19:12 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 19:15 [dm-devel] [PATCH 0/7] multipathd: remove udev settle dependency Benjamin Marzinski
2021-10-20 19:15 ` [dm-devel] [PATCH 1/7] multipathd: remove missing paths on startup Benjamin Marzinski
2021-11-04 22:12   ` Martin Wilck
2021-10-20 19:15 ` [dm-devel] [PATCH 2/7] libmultipath: skip unneeded steps to get path name Benjamin Marzinski
2021-11-04 21:20   ` Martin Wilck
2021-10-20 19:15 ` [dm-devel] [PATCH 3/7] libmultipath: don't use fallback wwid in update_pathvec_from_dm Benjamin Marzinski
2021-11-04 21:27   ` Martin Wilck
2021-10-20 19:15 ` [dm-devel] [PATCH 4/7] libmultipath: always set INIT_REMOVED in set_path_removed Benjamin Marzinski
2021-11-04 21:28   ` Martin Wilck
2021-10-20 19:15 ` [dm-devel] [PATCH 5/7] multipathd: fully initialize paths added by update_pathvec_from_dm Benjamin Marzinski
2021-11-04 22:10   ` Martin Wilck
2021-11-05 10:55     ` Martin Wilck
2021-11-05 21:49       ` Benjamin Marzinski
2021-11-05 23:20         ` Martin Wilck
2021-11-08 16:29           ` Benjamin Marzinski
2021-11-08 16:55             ` Martin Wilck
2021-11-08 17:30               ` Benjamin Marzinski
2021-11-08 19:11                 ` Martin Wilck
2021-11-05 21:03     ` Benjamin Marzinski
2021-10-20 19:15 ` [dm-devel] [PATCH 6/7] multipathd: remove INIT_PARTIAL paths that aren't in a multipath device Benjamin Marzinski
2021-11-04 22:01   ` Martin Wilck
2021-10-20 19:15 ` [dm-devel] [PATCH 7/7] multipathd: Remove dependency on systemd-udev-settle.service Benjamin Marzinski
2021-11-04 22:17   ` Martin Wilck
2021-11-04 22:00 ` [dm-devel] [PATCH 0/7] multipathd: remove udev settle dependency Martin Wilck
2021-11-05 20:49   ` Benjamin Marzinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.