Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
With no change to the multipath device, pvresize command report repeated successful resizes.
Version-Release number of selected component (if applicable):
lvm2-2.02.143-12.el6.x86_64
device-mapper-multipath-0.4.9-100.el6.x86_64
How reproducible:
mpatha (wwid_omitted) dm-2 NETAPP,LUN
size=24G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 2:0:0:0 sdb 8:16 active ready running
| |- 3:0:0:0 sdh 8:112 active ready running
| |- 5:0:0:0 sdn 8:208 active ready running
| `- 4:0:1:0 sdt 65:48 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 3:0:1:0 sdk 8:160 active ready running
|- 2:0:1:0 sde 8:64 active ready running
|- 4:0:0:0 sdo 8:224 active ready running
`- 5:0:1:0 sdu 65:64 active ready running
[root@host]# pvresize /dev/mapper/mpatha
Physical volume "/dev/mapper/mpatha" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@host]# pvresize /dev/mapper/mpatha
Physical volume "/dev/mapper/mpatha" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@host]# pvresize /dev/mapper/mpatha
Physical volume "/dev/mapper/mpatha" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@host]# pvresize /dev/mapper/mpatha
Physical volume "/dev/mapper/mpatha" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
Actual results:
pvresize reports device change
Expected results:
0 physical volume(s) resized
Comment 5Jonathan Earl Brassow
2018-03-30 22:12:26 UTC
(In reply to John Pittman from comment #0)
> Description of problem:
>
> With no change to the multipath device, pvresize command report repeated
> successful resizes.
>
John, are you just looking for 'pvresize' to report an error if no resize actually took place?
Hey Jonathan, thanks for looking at this one. It should just report that it wasn't resized. So, using mpatha, if a device is actually resized it would say:
[root@host]# pvresize /dev/mapper/mpatha
Physical volume "/dev/mapper/mpatha" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
And if not:
[root@host]# pvresize /dev/mapper/mpatha
Physical volume "/dev/mapper/mpatha" changed
0 physical volume(s) resized / 1 physical volume(s) not resized
My memory may be wrong, but I think this is how it worked at one point.
This isn't a multipath specific issue and happens on any PV.
[root@host-093 ~]# pvcreate /dev/sda1
Physical volume "/dev/sda1" successfully created.
[root@host-093 ~]# pvs /dev/sda1
PV VG Fmt Attr PSize PFree
/dev/sda1 lvm2 --- <30.00g <30.00g
[root@host-093 ~]# pvresize /dev/sda1
Physical volume "/dev/sda1" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@host-093 ~]# pvresize /dev/sda1
Physical volume "/dev/sda1" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
[root@host-093 ~]# pvs /dev/sda1
PV VG Fmt Attr PSize PFree
/dev/sda1 lvm2 --- <30.00g <30.00g
My two cents:
I seem to recall past issues/discussions I bought up about other cmds that also reported they "did" something, even if they really didn't, as long as the end result after the cmd was what was expected, it was fine. In this case it would be expected that the PV would now utilize the entirety of available space underneath, even if the available space didn't change. A failure would imply, that the PV does *not* now currently utilize the entirety of available space. Now, if a message was also added that it wasn't resized due to the fact that the underlying space didn't change, then I'd be fine with this fix.
Something like:
[root@host-093 ~]# lvcreate -L 100M foo
Logical volume "lvol0" created.
[root@host-093 ~]# lvresize -L 100M /dev/foo/lvol0
New size (25 extents) matches existing size (25 extents).
I'm inclined after longer studing this logic - we should change the message:
resized -> updated.
There is physical write access updating PV header (not necessarily changing something) but the header is really written.
There is no code detecting if the 'header to be written' is matching what has been already stored on this.
The PV header update may also update VG metadata.
While metadata update is reversible operation (vgcfgrestore) - there is only 1 PV header - so any write of PV header is irreversible.
ATM pvresize updates/rewrites PV header (thus it may fix possibly badly written header from previous command).
My believe here is - the most 'clear' way forward is likely just the update of actual printed message - which means that resize may or may not have happened.
Adding new code to do a deep check if there is a real need of writing new header because 1 bit of either PV or VG metadata has changed is not worth the complexity for this very occasionally used command.
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, 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-2018:3193