[dm-devel] why command of multipath send reinstate message to all dm's paths
Martin Wilck
mwilck at suse.com
Wed Jun 27 13:58:28 UTC 2018
Jiaojianbing,
On Wed, 2018-06-27 at 07:58 +0000, Jiaojianbing wrote:
> Dear Christophe,
> when dm-105 is in one state of below, paths of dm-105 will change to
> active if we run command of multipath.
Could you be more specific please? What multipath command did you run?
Which version of multipath-tools are you running?
> I check code of multipath, it sends messge "reinstate_path pathname"
> to kernel in routine reinstate_paths when status of pathgroup =
> "PGSTATE_ENABLED/PGSTATE_UNDEF" and path's state = "PSTATE_FAILED".
> why command of multipath do above action to all dm devices? actually,
> parts of these paths are already offline or failed which can't be
> recovered. Maybe we can check these devices's status by sending io to
> these sd device at first. according to return of io, multipath send
> reinstate to running devices and do nothing to failed devices?
I see this code in reinstate_paths():
vector_foreach_slot (pgp->paths, pp, j) {
if (pp->state != PATH_UP &&
(pgp->status == PGSTATE_DISABLED ||
pgp->status == PGSTATE_ACTIVE))
continue;
if (pp->dmstate == PSTATE_FAILED) {
if (dm_reinstate_path(mpp->alias, pp->dev_t))
condlog(0, "%s: error reinstating",
pp->dev);
}
}
The reinstate command is only sent for paths which are either in
PATH_UP state, or belong to an PGSTATE_ENABLED path group. I admit I'm
unsure why all we try to reinstate paths that we know are down. This is
13-year-old code.
Interstingly, the state of your paths changes from "faulty offline" to
"ready running". So it appears that these paths are actually _not_ down
Just the reinstate seems has failed on them.
multipathd -v3 logs and possibly kernel logs would be helpful to
understand what was going on in that situation.
Regards
Martin
--
Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
More information about the dm-devel
mailing list