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 1444205 - With no change to the multipath device, pvresize command reports repeated successful resizes
Summary: With no change to the multipath device, pvresize command reports repeated suc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.0
Hardware: All
OS: Linux
unspecified
low
Target Milestone: pre-dev-freeze
: ---
Assignee: Zdenek Kabelac
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1461138 1546181
TreeView+ depends on / blocked
 
Reported: 2017-04-20 20:33 UTC by John Pittman
Modified: 2021-09-09 12:15 UTC (History)
13 users (show)

Fixed In Version: lvm2-2.02.179-3.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 11:02:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3193 0 None None None 2018-10-30 11:03:23 UTC

Description John Pittman 2017-04-20 20:33:44 UTC
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 5 Jonathan 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?

Comment 6 John Pittman 2018-04-01 15:58:51 UTC
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.

Comment 7 Corey Marthaler 2018-04-02 15:31:17 UTC
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).

Comment 10 Zdenek Kabelac 2018-06-05 21:03:29 UTC
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.

Comment 11 Zdenek Kabelac 2018-06-09 15:35:05 UTC
Pushed updated message for pvresize:

https://www.redhat.com/archives/lvm-devel/2018-June/msg00065.html

Comment 14 Marian Csontos 2018-06-26 09:35:13 UTC
The commit on stable branch: e0bfc946cb182a021bb7a74a11ec7ac51ad9a7b0

Comment 16 Roman Bednář 2018-08-08 09:17:18 UTC
Verified.

# pvresize /dev/sda
  Physical volume "/dev/sda" changed
  1 physical volume(s) resized or updated / 0 physical volume(s) not resized

3.10.0-931.el7.x86_64
lvm2-2.02.180-2.el7

Comment 18 errata-xmlrpc 2018-10-30 11:02:16 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, 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


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