Bug 651102
| Summary: | lvm commands block while online resize is taking place | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | LVM and device-mapper development team <lvm-team> |
| lvm2 sub component: | Default / Unclassified | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED DEFERRED | Docs Contact: | |
| Severity: | medium | ||
| Priority: | medium | CC: | agk, cbuissar, cmarthal, coughlan, dwysocha, heinzm, jbrassow, joe.thornber, msnitzer, okozina, prajnoha, prockai, zkabelac |
| Version: | 7.3 | Keywords: | Triaged |
| Target Milestone: | rc | ||
| Target Release: | 7.3 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-01-18 23:29:37 UTC | Type: | --- |
| 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: | 756082, 1075802, 1159926, 1172231 | ||
|
Description
Corey Marthaler
2010-11-08 20:21:43 UTC
Resize takes exclusive write lock - so no one else can change it so it can not be dropped for current LVM implementation. lvs has an option '--ignorelockingfailure' (man lvm) to give some results. Unsure how to proceed here - We would probably need few different lock types to make a difference between "write - wait for result before read" and "do not modify, but you can read for now" - something like exclusive READ lock which only this application could switch to write - when all readers are gone. So we could temporarily drop exclusive write access - and allow parallel read operation to happen - and switch back when needed to WRITE As pointed by Alasdair - another way to go is to use 'pvmove' like way of marking LV as metadata locking flags and extend lvresize operation with '--abort' flag. Slow operations have to be broken up - VG locks are currently designed only to be held for fairly short periods. Isn't the operation already done? The extension was made and the metadata written. Are there any more changes to be made? As far as I know, it is holding the lock just to tell the user when the rest of the mirror has been synced - it doesn't need a write lock for that. Does 'lvconvert -m +1' have this same problem? Isn't that a similar issue? 'lvconvert -m +1' hangs other lvm operations until the operation is "done". However once the mirror is syncing (but before the 'lvconvert -m +1' operation is finished, all other lvm operations succeed. [root@grant-01 ~]# lvconvert -m +1 /dev/grant/lv [all other lvm operations "hang" until the sync starts below] grant/lv: Converted: 0.0% grant/lv: Converted: 0.1% grant/lv: Converted: 0.1% grant/lv: Converted: 0.1% grant/lv: Converted: 0.1% grant/lv: Converted: 0.1% grant/lv: Converted: 0.2% grant/lv: Converted: 0.2% grant/lv: Converted: 0.2% grant/lv: Converted: 0.3% grant/lv: Converted: 0.3% grant/lv: Converted: 0.3% grant/lv: Converted: 0.3% grant/lv: Converted: 0.4% grant/lv: Converted: 0.4% This will not be ready for 6.1. Moving to 6.2. Adding QA ack for 6.2. Command seems to complete quite quickly now: [root@bp-03 ~]# lvextend -L +10G -r /dev/vg/lv Extending 2 mirror images. Size of logical volume vg/lv changed from 4.00 GiB (1024 extents) to 14.00 GiB (3584 extents). Logical volume lv successfully resized resize2fs 1.42.9 (28-Dec-2013) Filesystem at /dev/mapper/vg-lv is mounted on /mnt; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 The filesystem on /dev/mapper/vg-lv is now 3670016 blocks long. [root@bp-03 ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert home rhel_bp-03 -wi-ao---- 407.33g root rhel_bp-03 -wi-ao---- 50.00g swap rhel_bp-03 -wi-ao---- 7.88g lv vg mwi-aom--- 14.00g lv_mlog 32.14 Could you retest? (This was performed on rhel7.1 though.) This is no longer reproducable in rhel7.1, however it is still reproducable in rhel6.6.
[root@hayes-01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/mirror_sanity-open_fsadm_resize
4.8G 10M 4.6G 1% /mnt/other1
[root@hayes-01 ~]# lvextend -L +175G -r /dev/mirror_sanity/open_fsadm_resize
Extending 2 mirror images.
Size of logical volume mirror_sanity/open_fsadm_resize changed from 5.00 GiB (1280 extents) to 180.00 GiB (46080 extents).
Logical volume open_fsadm_resize successfully resized
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/mirror_sanity-open_fsadm_resize is mounted on /mnt/other1; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 12
Performing an on-line resize of /dev/mapper/mirror_sanity-open_fsadm_resize to 47185920 (4k) blocks.
The filesystem on /dev/mapper/mirror_sanity-open_fsadm_resize is now 47185920 blocks long.
[WHILE ABOVE IS TAKING PLACE]
[root@hayes-01 ~]# lvs -a -o +devices
^C Interrupted...
Giving up waiting for lock.
/var/lock/lvm/V_mirror_sanity: flock failed: Interrupted system call
Can't get lock for mirror_sanity
Skipping volume group mirror_sanity
Interrupted...
Giving up waiting for lock.
Interrupted...
Giving up waiting for lock.
Interrupted...
Internal error: Volume Group vg_hayes01 was not unlocked
Device '/dev/sda2' has been left open (0 remaining references).
Internal error: 1 device(s) were left open and have been closed.
You have a memory leak (not released memory pool):
[0x7ffe71432e80] format_instance
[0x7ffe718849a0] read_vg
[0x7ffe71433b50] read_vg
Internal error: Unreleased memory pool(s) found.
[root@hayes-01 ~]# time lvs -a -o +devices
real 0m45.039s
user 0m0.364s
sys 0m0.045s
2.6.32-502.el6.x86_64
lvm2-2.02.111-2.el6 BUILT: Mon Sep 1 06:46:43 CDT 2014
lvm2-libs-2.02.111-2.el6 BUILT: Mon Sep 1 06:46:43 CDT 2014
lvm2-cluster-2.02.111-2.el6 BUILT: Mon Sep 1 06:46:43 CDT 2014
udev-147-2.57.el6 BUILT: Thu Jul 24 08:48:47 CDT 2014
device-mapper-1.02.90-2.el6 BUILT: Mon Sep 1 06:46:43 CDT 2014
device-mapper-libs-1.02.90-2.el6 BUILT: Mon Sep 1 06:46:43 CDT 2014
device-mapper-event-1.02.90-2.el6 BUILT: Mon Sep 1 06:46:43 CDT 2014
device-mapper-event-libs-1.02.90-2.el6 BUILT: Mon Sep 1 06:46:43 CDT 2014
device-mapper-persistent-data-0.3.2-1.el6 BUILT: Fri Apr 4 08:43:06 CDT 2014
cmirror-2.02.111-2.el6 BUILT: Mon Sep 1 06:46:43 CDT 2014
When we rebase for rhel6, we'll have to try to reproduce this again. I believe it will likely be fixed. The block occurs while waiting for the file system to resize when using the '-r' option. This happens when the file system is xfs or ext4 and when the segment type is raid1 or mirror. The fix will require some code restructuring that is not appropriate for rhel6.7 release. The change is more suited to rhel7 and may make its way into rhel6 via a backport if necessary. In the meantime, the workaround is to grow the logical volume and the file system separately (forego the use of '-r'). This affects non raid and mirror types as well in the latest 6.7 # Online mirror resize [root@mckinley-01 ~]# time lvs -a -o +devices LV Attr LSize Log Cpy%Sync Devices open_fsadm_resize Mwi-aom--- 179.00g open_fsadm_resize_mlog 100.00 open_fsadm_resize_mimage_0(0),open_fsadm_resize_mimage_1(0) [open_fsadm_resize_mimage_0] iwi-aom--- 179.00g /dev/mapper/mpathgp2(0) [open_fsadm_resize_mimage_0] iwi-aom--- 179.00g /dev/mapper/mpathcp2(0) [open_fsadm_resize_mimage_1] iwi-aom--- 179.00g /dev/mapper/mpathgp1(0) [open_fsadm_resize_mimage_1] iwi-aom--- 179.00g /dev/mapper/mpathcp1(0) [open_fsadm_resize_mlog] lwi-aom--- 4.00m /dev/mapper/mpathbp1(0) real 1m13.254s user 0m0.193s sys 0m0.046s # Online linear resize [root@mckinley-01 ~]# time lvs -a -o +devices LV Attr LSize Log Cpy%Sync Devices open_fsadm_resize -wi-ao---- 179.00g /dev/mapper/mpathgp2(0) open_fsadm_resize -wi-ao---- 179.00g /dev/mapper/mpathgp1(0) real 0m42.267s user 0m0.187s sys 0m0.028s 2.6.32-562.el6.x86_64 lvm2-2.02.118-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015 lvm2-libs-2.02.118-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015 lvm2-cluster-2.02.118-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015 udev-147-2.62.el6 BUILT: Thu Apr 23 05:44:37 CDT 2015 device-mapper-1.02.95-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015 device-mapper-libs-1.02.95-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015 device-mapper-event-1.02.95-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015 device-mapper-event-libs-1.02.95-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015 device-mapper-persistent-data-0.3.2-1.el6 BUILT: Fri Apr 4 08:43:06 CDT 2014 cmirror-2.02.118-2.el6 BUILT: Wed Apr 15 06:34:08 CDT 2015 A candidate now for lvmpolld? If we target for lvmpolld - let's move this bug it 7.X. It's quite late for RHEL6 (In reply to Zdenek Kabelac from comment #28) > If we target for lvmpolld - let's move this bug it 7.X. > It's quite late for RHEL6 Yes, but in comment 21, reporter says it is not reproducible in rhel7... since we don't intend to fix this in RHEL6 and it is already fixed in rhel7, I am closing this bug "DEFERRED". (Perhaps now that this bug is associated with RHEL7, it would be better as "CURRENTRELEASE"?) |