linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Brian Bunker <brian@purestorage.com>
Cc: linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH 1/1]: scsi dm-mpath do not fail paths which are in ALUA state transitioning
Date: Wed, 14 Jul 2021 23:06:15 +0200	[thread overview]
Message-ID: <2733dbd6e8da6510c1b5f3407661717fa3f1d52c.camel@suse.com> (raw)
In-Reply-To: <CAHZQxy++GoK=XJv1UoO1zGvoUNfKK6RrASbctGeUA6zt80RuhA@mail.gmail.com>

On Mi, 2021-07-14 at 11:13 -0700, Brian Bunker wrote:
> On Wed, Jul 14, 2021 at 1:39 AM Martin Wilck <mwilck@suse.com> wrote:
> 
> > 
> > When a command fails with ALUA TRANSITIONING status, we must make
> > sure
> > that:
> > 
> >  1) The command itself is not retried on the path at hand, neither
> > on
> > the SCSI layer nor on the blk-mq layer. The former was the case
> > anyway,
> > the latter is guaranteed by 0d88232010d5 ("scsi: core: Return
> > BLK_STS_AGAIN for ALUA transitioning").
> > 
> >  2) No new commands are sent down this path until it reaches a
> > usable
> > final state. This is achieved on the SCSI layer by alua_prep_fn(),
> > with
> > 268940b80fa4 ("scsi: scsi_dh_alua: Return BLK_STS_AGAIN for ALUA
> > transitioning state").
> > 
> > These two items would still be true with your patch applied.
> > However,
> > the problem is that if the path isn't failed, dm-multipath would
> > continue sending I/O down this path. If the path isn't set to
> > failed
> > state, the path selector algorithm may or may not choose a
> > different
> > path next time. In the worst case, dm-multipath would busy-loop
> > retrying the I/O on the same path. Please consider the following:
> > 
> > diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
> > index 86518aec32b4..3f3a89fc2b3b 100644
> > --- a/drivers/md/dm-mpath.c
> > +++ b/drivers/md/dm-mpath.c
> > @@ -1654,12 +1654,12 @@ static int multipath_end_io(struct
> > dm_target *ti, struct request *clone,
> >         if (error && blk_path_error(error)) {
> >                 struct multipath *m = ti->private;
> > 
> > -               if (error == BLK_STS_RESOURCE)
> > +               if (error == BLK_STS_RESOURCE || error ==
> > BLK_STS_AGAIN)
> >                         r = DM_ENDIO_DELAY_REQUEUE;
> >                 else
> >                         r = DM_ENDIO_REQUEUE;
> > 
> > -               if (pgpath)
> > +               if (pgpath && (error != BLK_STS_AGAIN))
> >                         fail_path(pgpath);
> > 
> > This way we'd avoid busy-looping by delaying the retry. This would
> > cause I/O delay in the case where some healthy paths are still in
> > the
> > same dm-multipath priority group as the transitioning path. I
> > suppose
> > this is a minor problem, because in the default case for ALUA
> > (group_by_prio in multipathd), all paths in the PG would have
> > switched
> > to "transitioning" simultaneously.
> > 
> > Note that multipathd assigns priority 0 (the same prio as
> > "unavailable") if it happens to notice a "transitioning" path. This
> > is
> > something we may want to change eventually. In your specific case,
> > it
> > would cause the paths to be temporarily re-grouped, all paths being
> > moved to the same non-functional PG. The way you describe it, for
> > your
> > storage at least, "transitioning" should be assigned a higher
> > priority.
> > > 
> > 
> 
> Yes. I tried it with this change and it works. Should I re-submit
> this
> modified version or do you want to do it? 

Yes, please.

Regards,
Martin



      reply	other threads:[~2021-07-14 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 20:42 [PATCH 1/1]: scsi dm-mpath do not fail paths which are in ALUA state transitioning Brian Bunker
2021-07-12  9:19 ` Martin Wilck
2021-07-12 21:38   ` Brian Bunker
2021-07-13  9:13     ` Martin Wilck
2021-07-14  0:32       ` Brian Bunker
2021-07-14  0:37         ` Brian Bunker
2021-07-14  8:38           ` Martin Wilck
2021-07-14 18:13             ` Brian Bunker
2021-07-14 21:06               ` Martin Wilck [this message]

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=2733dbd6e8da6510c1b5f3407661717fa3f1d52c.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=brian@purestorage.com \
    --cc=hare@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).