Hide Forgot
Two changes: 1) Update regionsize default to larger size 2) Allow users to change regionsize via lvconvert or lvchange See: bug 1392927 bug 1392936
Prepared for review/integration as lvconvert functionality on lvm2 upstream branch dev-lvmguy-raid-takeover-reshape-resize_work
Upstream commit cfb6ef654d3d
Roman, we also will need the default region_size changed to completely fix this bug. thanks
Upstream commit 5ae7a016b8e5796d36cf491345b1cf8e43ec9ea5 raises the default regionsize from 512KiB to 2MiB. Existing activation.raid_region_size in lvm.conf has to be adjusted or the old default will still be applied.
The regionsize change may require diskspace allocation for its metadata. Thus it's not classic 'lvchange' example. lvconvert allows to pass 'PV' list for extent allocation. lvchange does not let you specify this. So while future version may eventually let you change regionsize via lvchange, current code path is routed via lvconvert.
Additional region size question: bug 1443636
Marking verified with latest rpms. lvconvert -R option now allows users to change region size. Also the default region size changed from 512K to 2048K. Package update does not change the default value. BEFORE PATCH: # grep region_size /etc/lvm/lvm.conf # Configuration option activation/raid_region_size. raid_region_size = 512 # lvcreate -n raid1 --type raid1 -L1G vg # lvconvert -R256K vg/raid1 WARNING: Failed to connect to lvmetad. Falling back to device scanning. Conversion operation not yet supported. AFTER PATCH: # grep region_size /etc/lvm/lvm.conf # Configuration option activation/raid_region_size. raid_region_size = 2048 # lvcreate -n raid1 --type raid1 -L1G vg # lvconvert -R256K vg/raid1 Do you really want to change the region_size 512.00 KiB of LV vg/raid1 to 256.00 KiB? [y/n]: y Changed region size on RAID LV vg/raid1 to 256.00 KiB. # lvs -a -o lv_name,region_size LV Region ... raid1 256.00k ... Also tested with raid4, raid5, raid6, raid10. 3.10.0-663.el7.x86_64 lvm2-2.02.171-1.el7 BUILT: Wed May 3 14:05:13 CEST 2017 lvm2-libs-2.02.171-1.el7 BUILT: Wed May 3 14:05:13 CEST 2017 lvm2-cluster-2.02.171-1.el7 BUILT: Wed May 3 14:05:13 CEST 2017 device-mapper-1.02.140-1.el7 BUILT: Wed May 3 14:05:13 CEST 2017 device-mapper-libs-1.02.140-1.el7 BUILT: Wed May 3 14:05:13 CEST 2017 device-mapper-event-1.02.140-1.el7 BUILT: Wed May 3 14:05:13 CEST 2017 device-mapper-event-libs-1.02.140-1.el7 BUILT: Wed May 3 14:05:13 CEST 2017 device-mapper-persistent-data-0.7.0-0.1.rc6.el7 BUILT: Mon Mar 27 17:15:46 CEST 2017 cmirror-2.02.171-1.el7 BUILT: Wed May 3 14:05:13 CEST 2017 NOTE: Raid volume has to be synced in order to change the region size. Attempting the change on non-synced volume will result in error: # lvconvert -R256K vg/raid1 WARNING: Sync status for vg/raid1 is inconsistent. Unable to change region size on raid1 LV vg/raid1 while it is not in-sync. ==================================================================== EXAMPLES: 1) Create raid LV using default region size: # lvcreate -n raidlv --type raid1 -L1G vg 2) Create raid LV overriding default region size at cli: # lvcreate -n another_raidlv -R512K --type raid1 -L1G vg 3) List the LVs and verify region size: # lvs -a -o lv_name,region_size -S lv_name=~"raidlv" LV Region raidlv 2.00m [raidlv_rimage_0] 0 [raidlv_rimage_1] 0 [raidlv_rmeta_0] 0 [raidlv_rmeta_1] 0 4) Change the region size of existing raid (raid has to be synced) # lvconvert --yes -R 1024K vg/raidlv Changed region size on RAID LV vg/raidlv to 1.00 MiB. 5) Check the result: # lvs -a -o lv_name,region_size -S lv_name="raidlv" LV Region raidlv 1.00m 6) Change default region size in lvm.conf from 2048 to 512 # sed -i -- 's/raid_region_size = 2048/raid_region_size = 512/g' /etc/lvm/lvm.conf 7) Create another raid LV # lvcreate -n default_raidlv --type raid1 -L1G vg 8) Check that new value from lvm.conf applied correctly: # lvs -a -o lv_name,region_size -S lv_name="default_raidlv" LV Region default_raidlv 512.00k
Editing the doc text for the release note description. Please let me know if there is any problem or confusion with the edited text.
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