All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	device-mapper development <dm-devel@lists.linux.dev>,
	Martin Wilck <Martin.Wilck@suse.com>
Subject: Re: [PATCH 00/15] Improve mpathpersist's unavailable path handling
Date: Mon, 25 Aug 2025 15:56:06 -0400	[thread overview]
Message-ID: <aKy_1vEm47lEDEGa@redhat.com> (raw)
In-Reply-To: <592b5f59-cc88-4315-8a67-95421cdb3545@suse.de>

On Mon, Aug 25, 2025 at 08:38:38AM +0200, Hannes Reinecke wrote:
> On 7/10/25 20:10, Benjamin Marzinski wrote:
> > A problem that mpathpersist has with making SCSI Persistent Resevations
> > to a multipath device work like they do to individual SCSI devices is
> > that some of the paths to a multipath device might be down or missing
> > when the mpathpersist commands are run. Multipath handles registering a
> > new key pretty well. If paths are unavailable at the time of the
> > command, the key is registered when they later become available.  But if
> > the multipath device is also holding a reservation on one of its paths,
> > things get trickier.
> > 
> > If a persistent reservation is being held by an unsuable path of a
> > multipath device (the path can either be down or completely removed),
> > libmpathpersist can't change it just by forwarding the regular
> > persistent reservation commands. This can cause problems both for the
> > RELEASE command and the REGISTER and REGISTER AND IGNORE commands if
> > they are used to change from one key to another. If the path holding the
> > reservation is unavailable, the reservation won't be released or have
> > its key changed, as expected. I wish the problem of having a reservation
> > key changed while it is holding the reservation was simply a theoretical
> > one, but there are enterprise users of multipath that need this
> > capability.
> > 
> > This patchset deals with both of these problems. libmpathpersist always
> > had code to handle releasing a reservation held by an unavailable path,
> > but the existing method is broken. It relies on poorly supported
> > optional features of SCSI Persistent Reservations: the READ FULL STATUS
> > command and specifying Initiator Ports with the REGISTER command
> > (SIP_C). Also, fixing its current issues would additionally require
> > supporting the All Target Ports option (ATP_C). This existing workaround
> > has been redesigned to use the PREEMPT command instead. Key changes
> > where the path holding the reservation is unavailable were not
> > previously handled by libmpathpersist. This patchset also handles them
> > using the PREEMPT command.
> > 
> I wish we had a testcase for all of that. Persistent reservation
> handling is tricky at the best of times, but throwing in multipathing
> it really gets into the arcane knowledge area.
> Ben, do you have something which we could turn into some blktest
> scenarios?

It wouldn't be hard to use the LIO target to setup these scenarios, and
verify that mpathpersist is handling them. The bigger issue is that I'm
still occassionally running into new ones. I've got a couple more
patches to send to deal with them, but what this actually wants (and
what I plan to write after I think I've handled all the issues) is a
test that will write to the devices while randomly failing and restoring
paths and doing various PR commands, both to check that commands succeed
and fail when expected given the state of the devices when they were
run, and that we don't end up with active paths that either don't have
reservations when they should, or do have them when they shouldn't.

I can look at adding something like that to blktest.

-Ben

> 
> Cheers,
> 
> Hannes
> -- 
> Dr. Hannes Reinecke                  Kernel Storage Architect
> hare@suse.de                                +49 911 74053 688
> SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
> HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich


  reply	other threads:[~2025-08-25 19:56 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 18:10 [PATCH 00/15] Improve mpathpersist's unavailable path handling Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 01/15] multipathd: remove thread from mpath_pr_event_handle Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 02/15] libmpathpersist: remove uneeded wrapper function Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 03/15] libmpathpersist: reduce log level for persistent reservation checking Benjamin Marzinski
2025-08-24 12:57   ` Martin Wilck
2025-08-25 15:36     ` Martin Wilck
2025-07-10 18:10 ` [PATCH 04/15] libmpathpersist: remove pointless update_map_pr ret value code Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 05/15] multipathd: use update_map_pr in mpath_pr_event_handle Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 06/15] libmpathpersist: limit changing prflag in update_map_pr Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 07/15] multipathd: Don't call update_map_pr unnecessarily Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 08/15] libmpathpersist: remove useless function send_prout_activepath Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 09/15] limpathpersist: redesign failed release workaround Benjamin Marzinski
2025-08-24 15:26   ` Martin Wilck
2025-08-26  0:51     ` Benjamin Marzinski
2025-08-26  8:44       ` Martin Wilck
2025-08-26 10:06         ` Martin Wilck
2025-08-26 21:07           ` Benjamin Marzinski
2025-08-27  6:45             ` Martin Wilck
2025-08-26 19:36         ` Benjamin Marzinski
2025-08-26 20:53           ` Martin Wilck
2025-07-10 18:10 ` [PATCH 10/15] libmpathpersist: fail the release if all threads fail Benjamin Marzinski
2025-08-24 15:33   ` Martin Wilck
2025-08-29  3:23     ` Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 11/15] limpathpersist: Handle changing key corner case Benjamin Marzinski
2025-07-11 12:15   ` Martin Wilck
2025-07-11 14:11     ` Martin Wilck
2025-07-14 16:59       ` Benjamin Marzinski
2025-07-14 17:15         ` Martin Wilck
2025-07-10 18:10 ` [PATCH 12/15] libmapthpersist: Handle REGISTER AND IGNORE " Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 13/15] libmultipath: rename prflag_value enums Benjamin Marzinski
2025-07-10 18:10 ` [PATCH 14/15] libmpathpersist: use a switch statement for prout command finalizing Benjamin Marzinski
2025-07-10 18:11 ` [PATCH 15/15] libmpathpersist: Add safety check for preempting on key change Benjamin Marzinski
2025-08-24 21:00   ` Martin Wilck
2025-08-25 15:46     ` Martin Wilck
2025-08-24 21:21 ` [PATCH 00/15] Improve mpathpersist's unavailable path handling Martin Wilck
2025-08-25  6:38 ` Hannes Reinecke
2025-08-25 19:56   ` Benjamin Marzinski [this message]
2025-08-26  6:06     ` Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aKy_1vEm47lEDEGa@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=Martin.Wilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=hare@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.