All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/22] multipath path classification
@ 2018-04-13 21:59 Martin Wilck
  2018-04-13 21:59 ` [PATCH v5 01/22] Revert "multipath: ignore -i if find_multipaths is set" Martin Wilck
                   ` (21 more replies)
  0 siblings, 22 replies; 50+ messages in thread
From: Martin Wilck @ 2018-04-13 21:59 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski; +Cc: dm-devel, Martin Wilck

Hello Christophe,

(this set is based on 1cb704b2 plus those recent patches that have been
positively reviewed, see
https://github.com/openSUSE/multipath-tools/commits/upstream-queue).

This patch set implements a new, improved path detection logic based
on the previous discussions in the dm-devel threads "Multipath path 
classification revisited" and "RFC: multipath path classification", as well
as Ben's review of v2 of this series. Up to 08/20, this series is the same
as v2. Patch 11/20ff are substantially changed from v2. I left out the log
level changes I'd included in the v2 series, they will be submitted as a
separate series later.

The ideas of this patch set are:

 1. Avoid boot failures due to "blocked" devices, in particular setting
   SYSTEMD_READY=0 for path devices while multipathd can't setup maps for
   some reason. To this end, a means to indicate mapping failure
   has been added in patch 9-10. This was not in the RFC series.
   In contrast the v2 series, failure is not considered permanent;
   multipath and multipathd retry to setup the map under normal operations.
   Only "multipath -u/-c" checks and honors the failed flag always.
 2. Try to be as consistent as possible between udev rule processing
   (multipath -u) and multipathd. Patch 1-4 contain the necessary logic
   fixes. That alone doesn't fully avoid inconsistencies because udev rule
   processing and multipathd processing occur at different points in time.
   Therefore, Logic to retrigger uevents if multipathd detects inconsistencies
   has been added in patch 5 and 6.
 3. Disallow combinations of options that are dangerous or inconsistent, and
    generally simplify configuration. This is done by merging
   "find_multipaths", "multipath -i", and "multipathd -n" into a multi-value
   "find_multipaths" option in patch 7. This was not in the RFC series.
 4. Try to a achieve "it just works" autodetection, I've called it "smart".
    This requires waiting for siblings, which necessarily inflicts a certain
    delay on initial set-up (boot). To meet the criticism raised on the RFC
    series, I've tried to minimize these delays, in particular for the common
    "local SATA root" case. This is implemented in patch 11-20, implementation
    details have changed wrt the RFC series.
 5. Don't break compatibility with default setups of major distros. The
   semantics of "find_multipaths yes" and "find_multipaths no" was preserved
   for backwards compatibility (see commit message of patch 7 for details).

A side effect of this patch set is that the user visible output of "multipath -u"
and "multipath -c" has been changed to udev-friendly KEY="value" format.
Also, with v5 of the set, the exit status of "multipath -u" is 0 even if the
path is not a multipath member, in order to make udev happy.

Changes v4->v5:

 - rebased on top of latest reviewed patches, see above
 - numbering v4->v5: 17->20, 18->18, 19->21, 20->22
 - whitespace and other style fixes in 05/22, 06/22, 07/22, 09/22, 15/22,
   16/22, 18/22 (checkpatch.pl; I took the freedom to keep Ben's reviewed-by tags).
 - 07/22: fixed error I made in v4 while rebasing to latest upstream
 - 15/22: fixed a compilation warning regarding "const"
 - 16/22: symbolic return code in find_multipaths_check_timeout (Ben)
 - 16/22: add udev rule to remove timeout marker on remove uevent (Ben)
 - 17/22: NEW, make "multipath -u" logic a bit simpler to read
 - 19/22: NEW, avoid returning "maybe" or "yes" after "no" (Ben)
 - 20/22: by virtue of 19/22, the O_EXCL test is never run after a device
   has been been released to systemd. This was Ben's main concern for v4.

Only 16, 17, 19, 20 are lacking Reviewed-by: tags now.

This series is also available here:
https://github.com/mwilck/multipath-tools/commits/path-detection-v5

A broken-out version showing the FIX patches v4->v5 is here:
https://github.com/mwilck/multipath-tools/commits/path-detection-v4_v5

Changes v3->v4:

 - Rebased onto latest upstream, commit 1cb704b
 - 07/20: changed macro names to ignore_wwids_on, ignore_new_devs_on to
   avoid ambiguity with variable names

Changes v2->v3:

Almost all of these are direct or indirect outcomes of Ben Marzinski's review
of the v2 series. Kudos to Ben for the excellent review!

 - 09/20: use symbolic return codes for the helper functions for map failure
 - 09/20: use pthread_once() for path initialization
 - 11/20: added one more common code path invocation I'd forgotten in v2. 
 - 13/20 "multipath -u: treat failed wwids as invalid" replaces v2 11/20
   "don't try to setup failed wwids again" (we do try now, just not in
   "multipath -u").
 - 16/20 and 19-20/20 change the way the udev rules communicate with multipath -u.
   In contrast to v2, we directly calculate the expiry time in "multipath -u" itself
   now, saving several callouts in the udev rules. Moreover, we remember the
   timeouts as timestamps under /dev/shm, allowing to pass this information
   across pivot-root.
 - 17/20 introduces a test if a path is busy, addressing Ben's valid concern that
   a file system mounted on a path device in the initrd might be unmounted
   because rules setting SYSTEMD_READY=0 on the device, permanently or
   temporarily. 
 - 18/20 is an new addition, a speed-up for some cases where multipath -u would
   otherwise need to scan all paths and dm maps.
 - In 20/20, added the code path to multipath.rules for
   cancelling a running systemd timer and thus avoiding a spurious "add" event.
 - dropped v2 18/20-20/20.

Patch 1-8 and 12, 14, 15, 19 are identical or only minimally modified wrt
their counterparts in v2 (numbering changed from 11 on, though).

Changes RFC->v2 not described above:

 - 03/17 "should_multipath: keep existing maps": don't check for empty
   pathvec; rather check if the mapping actually exists in device-mapper (Ben
   Marzinski)

Regards,
Martin

Benjamin Marzinski (1):
  libmultipath: trigger change uevent on new device creation

Martin Wilck (21):
  Revert "multipath: ignore -i if find_multipaths is set"
  Revert "multipathd: imply -n if find_multipaths is set"
  libmultipath: should_multipath: keep existing maps
  multipath -u -i: respect entries in WWIDs file
  libmultipath: trigger path uevent only when necessary
  libmultipath: change find_multipaths option to multi-value
  libmultipath: use const char* in open_file()
  libmultipath: functions to indicate mapping failure in /dev/shm
  libmultipath: indicate wwid failure in dm_addmap_create()
  multipath -u: common code path for result message
  multipath -u: change output to environment/key format
  multipath -u: treat failed wwids as invalid
  multipath -u: add DM_MULTIPATH_DEVICE_PATH=2 for "maybe"
  libmultipath: implement find_multipaths_timeout
  multipath -u : set FIND_MULTIPATHS_WAIT_UNTIL from /dev/shm
  multipath -u: cleanup logic
  multipath -u: quick check if path is multipathed
  multipath -u: don't grab devices already passed to system
  multipath -u: test if path is busy
  libmultipath: enable find_multipaths "smart"
  multipath.rules: find_multipaths "smart" logic

 libmultipath/config.h      |   3 +-
 libmultipath/configure.c   |  70 ++++++++++-
 libmultipath/configure.h   |   1 +
 libmultipath/defaults.h    |   5 +-
 libmultipath/devmapper.c   |   9 +-
 libmultipath/dict.c        |  55 ++++++++-
 libmultipath/file.c        |   8 +-
 libmultipath/file.h        |   3 +-
 libmultipath/propsel.c     |  25 ++++
 libmultipath/propsel.h     |   1 +
 libmultipath/structs.h     |  28 +++++
 libmultipath/sysfs.c       |  66 ++++++++++
 libmultipath/sysfs.h       |   2 +
 libmultipath/wwids.c       | 128 ++++++++++++++++++-
 libmultipath/wwids.h       |  13 +-
 multipath/main.c           | 297 ++++++++++++++++++++++++++++++++++++++++-----
 multipath/multipath.8      |   9 +-
 multipath/multipath.conf.5 |  79 ++++++++----
 multipath/multipath.rules  |  70 ++++++++++-
 multipathd/main.c          |  15 +--
 multipathd/multipathd.8    |   8 +-
 21 files changed, 802 insertions(+), 93 deletions(-)

-- 
2.16.1

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

end of thread, other threads:[~2018-04-16 23:15 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13 21:59 [PATCH v5 00/22] multipath path classification Martin Wilck
2018-04-13 21:59 ` [PATCH v5 01/22] Revert "multipath: ignore -i if find_multipaths is set" Martin Wilck
2018-04-16  6:07   ` Hannes Reinecke
2018-04-13 21:59 ` [PATCH v5 02/22] Revert "multipathd: imply -n " Martin Wilck
2018-04-16  6:07   ` Hannes Reinecke
2018-04-13 21:59 ` [PATCH v5 03/22] libmultipath: should_multipath: keep existing maps Martin Wilck
2018-04-16  6:08   ` Hannes Reinecke
2018-04-13 21:59 ` [PATCH v5 04/22] multipath -u -i: respect entries in WWIDs file Martin Wilck
2018-04-16  6:09   ` Hannes Reinecke
2018-04-13 21:59 ` [PATCH v5 05/22] libmultipath: trigger change uevent on new device creation Martin Wilck
2018-04-16  6:10   ` Hannes Reinecke
2018-04-13 21:59 ` [PATCH v5 06/22] libmultipath: trigger path uevent only when necessary Martin Wilck
2018-04-16  6:10   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 07/22] libmultipath: change find_multipaths option to multi-value Martin Wilck
2018-04-16  6:11   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 08/22] libmultipath: use const char* in open_file() Martin Wilck
2018-04-16  6:11   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 09/22] libmultipath: functions to indicate mapping failure in /dev/shm Martin Wilck
2018-04-16  6:12   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 10/22] libmultipath: indicate wwid failure in dm_addmap_create() Martin Wilck
2018-04-16  6:13   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 11/22] multipath -u: common code path for result message Martin Wilck
2018-04-16  6:14   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 12/22] multipath -u: change output to environment/key format Martin Wilck
2018-04-16  6:14   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 13/22] multipath -u: treat failed wwids as invalid Martin Wilck
2018-04-16  6:21   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 14/22] multipath -u: add DM_MULTIPATH_DEVICE_PATH=2 for "maybe" Martin Wilck
2018-04-16  6:23   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 15/22] libmultipath: implement find_multipaths_timeout Martin Wilck
2018-04-16  6:23   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 16/22] multipath -u : set FIND_MULTIPATHS_WAIT_UNTIL from /dev/shm Martin Wilck
2018-04-16  6:25   ` Hannes Reinecke
2018-04-16 19:40   ` Benjamin Marzinski
2018-04-13 22:00 ` [PATCH v5 17/22] multipath -u: cleanup logic Martin Wilck
2018-04-16  6:26   ` Hannes Reinecke
2018-04-16 20:52   ` Benjamin Marzinski
2018-04-13 22:00 ` [PATCH v5 18/22] multipath -u: quick check if path is multipathed Martin Wilck
2018-04-16  6:29   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 19/22] multipath -u: don't grab devices already passed to system Martin Wilck
2018-04-16  6:30   ` Hannes Reinecke
2018-04-16 21:29   ` Benjamin Marzinski
2018-04-13 22:00 ` [PATCH v5 20/22] multipath -u: test if path is busy Martin Wilck
2018-04-16  6:32   ` Hannes Reinecke
2018-04-16  8:00     ` Martin Wilck
2018-04-16 23:15   ` Benjamin Marzinski
2018-04-13 22:00 ` [PATCH v5 21/22] libmultipath: enable find_multipaths "smart" Martin Wilck
2018-04-16  6:40   ` Hannes Reinecke
2018-04-13 22:00 ` [PATCH v5 22/22] multipath.rules: find_multipaths "smart" logic Martin Wilck
2018-04-16  6:40   ` Hannes Reinecke

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.