Bug 788325

Summary: "multipath -l" are showing incorrect priority value compare to "multipathd -k'show topo'"
Product: Red Hat Enterprise Linux 5 Reporter: Gris Ge <fge>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED NOTABUG QA Contact: Storage QE <storage-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.8CC: agk, bmarzins, bmr, dwysocha, heinzm, mbroz, prajnoha, prockai, zkabelac
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-09 17:01:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Gris Ge 2012-02-08 03:34:16 UTC
Description of problem:

As subject and please check these outputs:
======
[root@storageqe-06 ~]# multipath -l
mpath0 (360a98000572d574a4e6f63706772594b) dm-0 NETAPP,LUN
[size=50G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
 \_ 0:0:0:0 sda 8:0   [active][undef]
 \_ 0:0:1:0 sdc 8:32  [active][undef]
 \_ 1:0:0:0 sdi 8:128 [active][undef]
 \_ 1:0:1:0 sdk 8:160 [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 0:0:2:0 sde 8:64  [active][undef]
 \_ 0:0:3:0 sdg 8:96  [active][undef]
 \_ 1:0:2:0 sdm 8:192 [active][undef]
 \_ 1:0:3:0 sdo 8:224 [active][undef]
[root@storageqe-06 ~]# multipathd -k'show topo'
reload: mpath0 (360a98000572d574a4e6f63706772594b) dm-0 NETAPP,LUN
[size=50G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=16][active]
 \_ 0:0:0:0 sda 8:0   [active][ready]
 \_ 0:0:1:0 sdc 8:32  [active][ready]
 \_ 1:0:0:0 sdi 8:128 [active][ready]
 \_ 1:0:1:0 sdk 8:160 [active][ready]
\_ round-robin 0 [prio=4][enabled]
 \_ 0:0:2:0 sde 8:64  [active][ready]
 \_ 0:0:3:0 sdg 8:96  [active][ready]
 \_ 1:0:2:0 sdm 8:192 [active][ready]
 \_ 1:0:3:0 sdo 8:224 [active][ready]
[root@storageqe-06 ~]# /sbin/mpath_prio_netapp /dev/sde
1
=====

The last command confirmed "multipathd -k'show topo'" are providing correct info.

Version-Release number of selected component (if applicable):
device-mapper-multipath-0.4.7-48.el5

How reproducible:
100%


Steps to Reproduce:
1. Setup multipath on a LUN which have different priority paths.
2. Check the output of "multipath -l" 
  
Actual results:
"multipath -l" provide incorrect values of priority.

Expected results:
It should be correct.

Additional info:
RHEL 5.7 also have this issue, don't know whether this is known issue.

Comment 1 Ben Marzinski 2012-02-08 18:36:24 UTC
multipath -l doesn't check the priority. mutipath -ll does.  Please verify that this works.

multipath -l should probably not display the priority at all, or display undef, but since customers may be relying on the current output for scripting, and this has always been multipath's behaviour, I am reluctant to change it so late in the RHEL 5 release.

Comment 2 Gris Ge 2012-02-09 02:25:27 UTC
Yes. multipath -ll provide the same info with "multipathd -k'show topo'".

Ben,
Can you clarify why "/sbin/mpath_prio_netapp /dev/sde" got 1, but priority show it as 4?

Thanks.

Comment 3 Ben Marzinski 2012-02-09 17:01:59 UTC
In RHEL 6, the priority of the pathgroup is the average of its paths priority, which is probably what most people want and expect.  In RHEL5, multipath uses the sum. You can add

pg_prio_calc "avg"

to the defaults section of /etc/multipath.conf to use the average instead in RHEL5.