Bug 1443705

Summary: should altered region sizes survive reshaping?
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID QA Contact: Heinz Mauelshagen <heinzm>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, prockai, rbednar, zkabelac
Version: 7.4   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.171-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 21:52:19 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:

Description Corey Marthaler 2017-04-19 18:55:34 UTC
Description of problem:
[root@host-076 ~]# lvcreate  --type linear   -n takeover -L 500M VG
  Logical volume "takeover" created.

# Convert and alter the region size.
[root@host-076 ~]# lvconvert --yes -R 2048.00k -m 1 --type raid1 VG/takeover
  Logical volume VG/takeover successfully converted.

[root@host-076 ~]# lvs -a -o +devices,segtype,regionsize
  LV                  VG  Attr       LSize   Cpy%Sync Devices                                   Type   Region
  takeover            VG  rwi-a-r--- 500.00m 100.00   takeover_rimage_0(0),takeover_rimage_1(0) raid1   2.00m
  [takeover_rimage_0] VG  iwi-aor--- 500.00m          /dev/sdc1(0)                              linear     0 
  [takeover_rimage_1] VG  iwi-aor--- 500.00m          /dev/sdd1(1)                              linear     0 
  [takeover_rmeta_0]  VG  ewi-aor---   4.00m          /dev/sdc1(125)                            linear     0 
  [takeover_rmeta_1]  VG  ewi-aor---   4.00m          /dev/sdd1(0)                              linear     0 

# Reshape by adding additional images
[root@host-076 ~]# lvconvert --yes -m 4 VG/takeover
  Logical volume VG/takeover successfully converted.

# Previous operation changed the region size back to the default. Is this expected?
[root@host-076 ~]# lvs -a -o +devices,segtype,regionsize
  LV                  VG  Attr       LSize   Cpy%Sync Devices                                                                                                  Type   Region 
  takeover            VG  rwi-a-r--- 500.00m 100.00   takeover_rimage_0(0),takeover_rimage_1(0),takeover_rimage_2(0),takeover_rimage_3(0),takeover_rimage_4(0) raid1  512.00k
  [takeover_rimage_0] VG  iwi-aor--- 500.00m          /dev/sdc1(0)                                                                                             linear      0 
  [takeover_rimage_1] VG  iwi-aor--- 500.00m          /dev/sdd1(1)                                                                                             linear      0 
  [takeover_rimage_2] VG  iwi-aor--- 500.00m          /dev/sdf1(1)                                                                                             linear      0 
  [takeover_rimage_3] VG  iwi-aor--- 500.00m          /dev/sdh1(1)                                                                                             linear      0 
  [takeover_rimage_4] VG  iwi-aor--- 500.00m          /dev/sda1(1)                                                                                             linear      0 
  [takeover_rmeta_0]  VG  ewi-aor---   4.00m          /dev/sdc1(125)                                                                                           linear      0 
  [takeover_rmeta_1]  VG  ewi-aor---   4.00m          /dev/sdd1(0)                                                                                             linear      0 
  [takeover_rmeta_2]  VG  ewi-aor---   4.00m          /dev/sdf1(0)                                                                                             linear      0 
  [takeover_rmeta_3]  VG  ewi-aor---   4.00m          /dev/sdh1(0)                                                                                             linear      0 
  [takeover_rmeta_4]  VG  ewi-aor---   4.00m          /dev/sda1(0)                                                                                             linear      0 


Version-Release number of selected component (if applicable):
3.10.0-651.el7.x86_64

lvm2-2.02.170-2.el7    BUILT: Thu Apr 13 14:37:43 CDT 2017
lvm2-libs-2.02.170-2.el7    BUILT: Thu Apr 13 14:37:43 CDT 2017
lvm2-cluster-2.02.170-2.el7    BUILT: Thu Apr 13 14:37:43 CDT 2017
device-mapper-1.02.139-2.el7    BUILT: Thu Apr 13 14:37:43 CDT 2017
device-mapper-libs-1.02.139-2.el7    BUILT: Thu Apr 13 14:37:43 CDT 2017
device-mapper-event-1.02.139-2.el7    BUILT: Thu Apr 13 14:37:43 CDT 2017
device-mapper-event-libs-1.02.139-2.el7    BUILT: Thu Apr 13 14:37:43 CDT 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017

Comment 3 Heinz Mauelshagen 2017-04-24 14:05:21 UTC
Upstream commit 8333d5a969042a321f00656271bd55a37c1ea179

Comment 4 Marian Csontos 2017-04-27 08:53:35 UTC
This has broken lot of raid tests in da testsuite. An example:

100 [ 0:00] #lvconvert-raid-allocation.sh:27+ lvconvert -y --type raid1 -m 1 @PREFIX@vg/LV1 /dev/mapper/@PREFIX@pv3
101 [ 0:00]   LV LV1 invalid: zero region_size for raid1 segment
102 [ 0:00]   LV LV1 invalid: non power of 2 region size (is 0) for raid1 segment
103 [ 0:00]   Internal error: LV segments corrupted in LV1.

Comment 5 Heinz Mauelshagen 2017-04-27 14:00:03 UTC
Upstream commit 05164479781486dbe2486c0439d42ed03e4483e8

Previous commit 8333d5a969042a321f00656271bd55a37c1ea179 missed to set region size on raid1 up conversions.

Comment 8 errata-xmlrpc 2017-08-01 21:52:19 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-2017:2222