RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2164871 - multipathd doesn't automatically make sure a device with a persistent reservation is registered on all paths
Summary: multipathd doesn't automatically make sure a device with a persistent reserva...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: device-mapper-multipath
Version: 8.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Lin Li
Apurva Bhide
URL:
Whiteboard:
Depends On: 2164869
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-26 19:02 UTC by Ben Marzinski
Modified: 2023-11-14 17:11 UTC (History)
9 users (show)

Fixed In Version: device-mapper-multipath-0.8.4-39.el8
Doc Type: Bug Fix
Doc Text:
.`multipathd` adds the persistent reservation registration key to all paths Previously, when the `multipathd` daemon started and it recognized a registration key for the persistent reservations on one path of an existing multipath device, not all paths of that device had the registration key. As a consequence, if new paths appeared to a multipath device with persistent reservations while `multipathd` was stopped, persistent reservations were not set up on those. This allowed IO processing on the paths, even if they were supposed to be forbidden by the reservation key. With this fix, if `multipathd` finds a persistent reservation registration key on any device path, it adds the key to all active paths. As a result, multipath devices now have persistent reservations set up correctly on all the paths, even if path devices first appear while `multipathd` is not running.
Clone Of: 2164869
Environment:
Last Closed: 2023-11-14 15:37:51 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-146605 0 None None None 2023-01-26 19:05:23 UTC
Red Hat Product Errata RHBA-2023:7076 0 None None None 2023-11-14 15:37:53 UTC

Description Ben Marzinski 2023-01-26 19:02:03 UTC
+++ This bug was initially created as a clone of Bug #2164869 +++

Description of problem:
If a multipath device has a SCSI PR registration on some paths, but not all, when multipathd first discovers the device, it doesn't always add registrations to all the paths.

Specifically, when multipathd starts up, if there is an existing device with a SCSI PR key registered on only some of the paths, it will not register the PR key to the other paths. This can happen if a new path to a multipath device with a SCSI PR registration appears while multipathd isn't running. 

Also, if no paths are active when multipathd creates the multipath device, multipathd will not realize that the device has a SCSI PR registration, and will not add registrations to the existing paths, if a new path appears, even if that path does have a SCSI PR key registered to it.


Version-Release number of selected component (if applicable):
All

How reproducible:
Always

Steps to Reproduce:
1. Add "reservation_key file" to /etc/multipath.conf to set up automatic reservation key tracking.
2. create a multipath device with multiple paths
3. stop multipathd
4. run "mpathpersist -oGS 1234 <multipath_device>" to register the key 1234 to all the multipath device paths, and track the key.
5. run "mpathpersist -ik <multipath_device>" to verify that you see multiple copies of the key "1234" registered.
6. run "sg_persist -oGK 1234 <path_device" to remove the key from one of the paths.
7. run "mpathpersist -ik <multipath_device>" to verify that there is one fewer copies of the key registered.
8. start multipathd
9. run "mpathpersist -ik <multipath_device>"

Actual results:
The number of copies of the key 1234 registered is one fewer than the number of paths.

Expected results:
The number of copies of the key 1234 registered is equal to the number of paths.

Additional info:

Comment 8 Lin Li 2023-04-24 14:55:52 UTC
Verified on device-mapper-multipath-0.8.4-39.el8
1. Add "reservation_key file" to /etc/multipath.conf to set up automatic reservation key tracking.
[root@storageqe-05 ~]# cat /etc/multipath.conf 
defaults {
	user_friendly_names yes
	find_multipaths yes
	enable_foreign "^$"
        reservation_key file
}
2. create a multipath device with multiple paths
[root@storageqe-05 ~]# multipath -ll 360a98000324669436c2b45666c567869
360a98000324669436c2b45666c567869 dm-5 NETAPP,LUN
size=2.0G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 1:0:0:2 sdl 8:176 active ready running
| `- 4:0:1:2 sdh 8:112 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
  |- 1:0:1:2 sdp 8:240 active ready running
  `- 4:0:0:2 sdd 8:48  active ready running
3.run "mpathpersist -oGS 1234 <multipath_device>" to register the key 1234 to all the multipath device paths, and track the key.
[root@storageqe-05 ~]# mpathpersist -oGS 1234 /dev/mapper/360a98000324669436c2b45666c567869
4.run "mpathpersist -ik <multipath_device>" to verify that you see multiple copies of the key "1234" registered.
[root@storageqe-05 ~]# mpathpersist -ik /dev/mapper/360a98000324669436c2b45666c567869
  PR generation=0x4, 	4 registered reservation keys follow:
    0x1234
    0x1234
    0x1234
    0x1234
5.stop mulitpathd
[root@storageqe-05 ~]# service multipathd stop
6.run "sg_persist -oGK 1234 <path_device" to remove the key from one of the paths.
[root@storageqe-05 ~]# sg_persist -oGK 1234 /dev/sdd
  NETAPP    LUN               820a
  Peripheral device type: disk
7.run "mpathpersist -ik <multipath_device>" to verify that there is one fewer copies of the key registered.
[root@storageqe-05 ~]# mpathpersist -ik /dev/mapper/360a98000324669436c2b45666c567869
  PR generation=0x6, 	3 registered reservation keys follow:
    0x1234
    0x1234
    0x1234
8.start multipathd
[root@storageqe-05 ~]# service multipathd restart
Redirecting to /bin/systemctl restart multipathd.service
9.run "mpathpersist -ik <multipath_device>"
[root@storageqe-05 ~]# mpathpersist -ik /dev/mapper/360a98000324669436c2b45666c567869
  PR generation=0xa, 	4 registered reservation keys follow:
    0x1234
    0x1234
    0x1234
    0x1234


Test result: The number of copies of the key 1234 registered is equal to the number of paths.

Redirecting to /bin/systemctl stop multipathd.service

Comment 16 errata-xmlrpc 2023-11-14 15:37:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (device-mapper-multipath bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:7076


Note You need to log in before you can comment on or make changes to this bug.