Bug 1437653

Summary: up converting an inactive mirror with insufficient devs results in an over concerned warning
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Heinz Mauelshagen <heinzm>
lvm2 sub component: Mirroring and RAID QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 7.4Keywords: Regression
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:
Attachments:
Description Flags
verbose lvconvert attempt none

Description Corey Marthaler 2017-03-30 19:26:25 UTC
Description of problem:
This appears to be a direct regression of rhel5 bug 773312.

host-122: lvcreate --type mirror -m 1 -n insufficient_inactive_upconvert -L 500M mirror_sanity
Waiting until all mirror|raid volumes become fully syncd...
   1/1 mirror(s) are fully synced: ( 100.00% )
Sleeping 15 sec

Deactivate mirror
Attempt to add an additional leg, but w/o sufficient space
host-122: lvconvert ---type mirror -m+1 mirror_sanity/insufficient_inactive_upconvert /dev/sda1


[root@host-122 ~]# lvs -a -o +devices
  LV                                         VG            Attr       LSize    Log                                    Devices                 
  insufficient_inactive_upconvert            mirror_sanity mwi---m--- 500.00m  [insufficient_inactive_upconvert_mlog] insufficient_inactive_upconvert_mimage_0(0),insufficient_inactive_upconvert_mimage_1(0)
  [insufficient_inactive_upconvert_mimage_0] mirror_sanity Iwi---m--- 500.00m                                         /dev/sda1(0)                 
  [insufficient_inactive_upconvert_mimage_1] mirror_sanity Iwi---m--- 500.00m                                         /dev/sda2(0)                 
  [insufficient_inactive_upconvert_mlog]     mirror_sanity lwi---m---   4.00m                                         /dev/sdh2(0)                 

[root@host-122 ~]# lvconvert ---type mirror -m+1 mirror_sanity/insufficient_inactive_upconvert /dev/sda1
  Insufficient suitable allocatable extents for logical volume : 125 more required
  Unable to allocate extents for mirror(s).
  Internal error: LV mirror_sanity/insufficient_inactive_upconvert_mimagetmp_2 (UUID vj0z8wV7Ovw2xaVAU6lq025y2dA3LrtElD0aPSMl2uLU70R0B5pioyivbptbUmCf) not found in committed metadata.
  ABORTING: Failed to remove temporary mirror layer mirror_sanity/insufficient_inactive_upconvert_mimagetmp_2.
  Manual cleanup with vgcfgrestore and dmsetup may be required.



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

lvm2-2.02.169-3.el7    BUILT: Wed Mar 29 09:17:46 CDT 2017
lvm2-libs-2.02.169-3.el7    BUILT: Wed Mar 29 09:17:46 CDT 2017
lvm2-cluster-2.02.169-3.el7    BUILT: Wed Mar 29 09:17:46 CDT 2017
device-mapper-1.02.138-3.el7    BUILT: Wed Mar 29 09:17:46 CDT 2017
device-mapper-libs-1.02.138-3.el7    BUILT: Wed Mar 29 09:17:46 CDT 2017
device-mapper-event-1.02.138-3.el7    BUILT: Wed Mar 29 09:17:46 CDT 2017
device-mapper-event-libs-1.02.138-3.el7    BUILT: Wed Mar 29 09:17:46 CDT 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017

Comment 4 Corey Marthaler 2017-04-24 15:04:43 UTC
This exists in the 170-2 rpms as well.

[root@host-076 ~]# lvconvert --type mirror -m+1 VG/insufficient_inactive_upconvert /dev/sda1
  Insufficient suitable allocatable extents for logical volume : 125 more required
  Unable to allocate extents for mirror(s).
  Internal error: LV VG/insufficient_inactive_upconvert_mimagetmp_2 (UUID PhqddJvcyP2Tf03Ii53KYQl19actsm0tTHfSxU1Oa9hG1P62lpSYc3l10K6kYfTS) not found in committed metadata.
  ABORTING: Failed to remove temporary mirror layer VG/insufficient_inactive_upconvert_mimagetmp_2.
  Manual cleanup with vgcfgrestore and dmsetup may be required.



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 5 Corey Marthaler 2017-04-24 15:06:00 UTC
Created attachment 1273631 [details]
verbose lvconvert attempt

Comment 6 Heinz Mauelshagen 2017-04-24 15:46:39 UTC
Upstream commit aa1d5d5c89873c0002628142fd9b2c7c4cc1da55

Comment 8 Alasdair Kergon 2017-04-24 20:32:22 UTC
The bug was on an error path that assumed the mirror was active and attempted deactivation of its new component - the workaround in the patch checks additionally whether the LV is active and skips that deactivation attempt if not so.  (But this code needs some additional work - it shouldn't need to call lv_is_active like that on an error path.)

Comment 11 Corey Marthaler 2017-06-05 21:49:35 UTC
Fix verified in the latest rpms.

3.10.0-672.el7.x86_64
lvm2-2.02.171-3.el7    BUILT: Wed May 31 08:36:29 CDT 2017
lvm2-libs-2.02.171-3.el7    BUILT: Wed May 31 08:36:29 CDT 2017
lvm2-cluster-2.02.171-3.el7    BUILT: Wed May 31 08:36:29 CDT 2017
device-mapper-1.02.140-3.el7    BUILT: Wed May 31 08:36:29 CDT 2017
device-mapper-libs-1.02.140-3.el7    BUILT: Wed May 31 08:36:29 CDT 2017
device-mapper-event-1.02.140-3.el7    BUILT: Wed May 31 08:36:29 CDT 2017
device-mapper-event-libs-1.02.140-3.el7    BUILT: Wed May 31 08:36:29 CDT 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017


host-073: lvcreate --type mirror -m 1 -n insufficient_inactive_upconvert -L 500M mirror_sanity

[root@host-073 ~]# lvs -a -o +devices
  LV                                         VG            Attr       LSize   Log                                    Cpy%Sync Devices
  insufficient_inactive_upconvert            mirror_sanity mwi---m--- 500.00m [insufficient_inactive_upconvert_mlog]          insufficient_inactive_upconvert_mimage_0(0),insufficient_inactive_upconvert_mimage_1(0)
  [insufficient_inactive_upconvert_mimage_0] mirror_sanity Iwi---m--- 500.00m                                                 /dev/sda2(0)
  [insufficient_inactive_upconvert_mimage_1] mirror_sanity Iwi---m--- 500.00m                                                 /dev/sda1(0)
  [insufficient_inactive_upconvert_mlog]     mirror_sanity lwi---m---   4.00m                                                 /dev/sdf1(0)

[root@host-073 ~]# lvconvert ---type mirror -m+1 mirror_sanity/insufficient_inactive_upconvert /dev/sda2
  Insufficient suitable allocatable extents for logical volume : 125 more required
  Unable to allocate extents for mirror(s).

Comment 12 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