Bug 1075644

Summary: Resizing pool metadata on RAID10 LV fails due to rounding error
Product: Red Hat Enterprise Linux 7 Reporter: Marian Csontos <mcsontos>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Thin Provisioning QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, rbednar, thornber, zkabelac
Version: 7.0   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.161-2.el7 Doc Type: Bug Fix
Doc Text:
Cause: Resize of metadata used 2 different code path where only one was able to handle all LV types and proper rounding. Consequence: Some LV types like i.e. raid10 may have missed proper rounding and lead to error resulting state of the whole resize operation. Fix: lvm2 has updated to pass all resize operation through a one code path. Result: Resize should give consistent results.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 04:06:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1119323, 1189117, 1295577, 1313485    

Description Marian Csontos 2014-03-12 14:02:18 UTC
Description of problem:

Resizing thin-pool metadata on RAID10 does not round up to (stripes * extent size) boundary but only to closest extent boundary.

Works fine with both pure RAID10 LVs and with pool metadata on linear LVs.

Version-Release number of selected component (if applicable):
kernel-3.10.0-105.el7
lvm2-2.02.105-10.el7.x86_64

How reproducible:
100%

Resizing pool with metadata on RAID10 (-i 3 -m 1):
(08:41:00) [root@cimrmanc2-node02:~]$ lvresize --poolmetadatasize +1M /dev/snapper_thinp/POOL
  Rounding pool metadata size to boundary between physical extents: 4.00 MiB
  Extending logical volume POOL_tmeta to 1.40 GiB.
  Number of extents requested (1) needs to be divisible by 3.

Resizing pool with metadata on linear volume:
(08:40:32) [root@cimrmanc2-node02:~]$ lvresize --poolmetadatasize +1M /dev/snapper_thinp/pool
  Rounding pool metadata size to boundary between physical extents: 4.00 MiB
  Extending logical volume pool_tmeta to 8.00 MiB.
  Logical volume pool successfully resized

Resizing RAID10:
(08:43:51) [root@cimrmanc2-node02:~]$ lvresize -L+1M snapper_thinp/r10
  Rounding size to boundary between physical extents: 4.00 MiB
  Extending 2 mirror images.
  Rounding size (13 extents) up to stripe boundary size for segment (15 extents)
  Extending logical volume r10 to 60.00 MiB
  Logical volume r10 successfully resized

Comment 2 RHEL Program Management 2014-03-22 05:48:30 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 Jonathan Earl Brassow 2016-01-22 16:10:43 UTC
metadata on RAID10?  We can work on it or disallow it.

Comment 8 Zdenek Kabelac 2016-07-22 12:31:52 UTC
Upstream resize changes started with this commit:

https://www.redhat.com/archives/lvm-devel/2016-June/msg00117.html

Comment 10 Corey Marthaler 2016-08-10 21:41:59 UTC
*** Bug 1077368 has been marked as a duplicate of this bug. ***

Comment 11 Corey Marthaler 2016-08-10 23:55:20 UTC
Marking verified in the latest rpms.  'lvresize --poolmetadatasize' now rounds properly when resizing raid10 meta data.


3.10.0-489.el7.x86_64
lvm2-2.02.163-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016
lvm2-libs-2.02.163-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016
lvm2-cluster-2.02.163-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016
device-mapper-1.02.133-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016
device-mapper-libs-1.02.133-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016
device-mapper-event-1.02.133-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016
device-mapper-event-libs-1.02.133-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016
device-mapper-persistent-data-0.6.3-1.el7    BUILT: Fri Jul 22 05:29:13 CDT 2016
cmirror-2.02.163-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016
sanlock-3.4.0-1.el7    BUILT: Fri Jun 10 11:41:03 CDT 2016
sanlock-lib-3.4.0-1.el7    BUILT: Fri Jun 10 11:41:03 CDT 2016
lvm2-lockd-2.02.163-1.el7    BUILT: Wed Aug 10 06:53:21 CDT 2016




(LVRESIZE --poolmetadatasize +43M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 48.00m eq NEW 96.00m
  [POOL_tmeta]          snapper_thinp ewi-aor---  96.00m                                    

(LVRESIZE --poolmetadatasize +31M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 96.00m eq NEW 132.00m
  [POOL_tmeta]          snapper_thinp ewi-aor--- 132.00m                                    

(LVRESIZE --poolmetadatasize +27M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 132.00m eq NEW 168.00m
  [POOL_tmeta]          snapper_thinp ewi-aor--- 168.00m                                    

(LVRESIZE --poolmetadatasize +47M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 168.00m eq NEW 216.00m
  [POOL_tmeta]          snapper_thinp ewi-aor--- 216.00m                                    

(LVRESIZE --poolmetadatasize +42M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 216.00m eq NEW 264.00m
  [POOL_tmeta]          snapper_thinp ewi-aor--- 264.00m                                    

(LVRESIZE --poolmetadatasize +44M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 264.00m eq NEW 312.00m
  [POOL_tmeta]          snapper_thinp ewi-aor--- 312.00m                                    

(LVRESIZE --poolmetadatasize +54M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 312.00m eq NEW 372.00m
  [POOL_tmeta]          snapper_thinp ewi-aor--- 372.00m                                    

(LVRESIZE --poolmetadatasize +31M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 372.00m eq NEW 408.00m
  [POOL_tmeta]          snapper_thinp ewi-aor--- 408.00m                                    

(LVRESIZE --poolmetadatasize +52M /dev/snapper_thinp/POOL)
  WARNING: Sum of all thin volume sizes (7.00 GiB) exceeds the size of thin pools (1.01 GiB)!
OLD 408.00m eq NEW 468.00m
  [POOL_tmeta]          snapper_thinp ewi-aor--- 468.00m

Comment 13 errata-xmlrpc 2016-11-04 04:06:42 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://rhn.redhat.com/errata/RHBA-2016-1445.html