RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 612291 - dm devices associated with split off mirror images are not removed
Summary: dm devices associated with split off mirror images are not removed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.0
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-07 19:23 UTC by Corey Marthaler
Modified: 2010-11-10 21:08 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.72-8.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-10 21:08:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Corey Marthaler 2010-07-07 19:23:19 UTC
Description of problem:

[root@taft-01 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      mwi-a- 100.00m mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0),mirror_mimage_2(0)
  [mirror_mimage_0] taft      iwi-ao 100.00m                    /dev/sdb1(0)
  [mirror_mimage_1] taft      iwi-ao 100.00m                    /dev/sdc1(0)
  [mirror_mimage_2] taft      iwi-ao 100.00m                    /dev/sdd1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)

[root@taft-01 ~]# lvconvert --splitmirrors 1 --name new taft/mirror
  Logical volume mirror converted.

# The proper LVs show up after the split

[root@taft-01 ~]# lvs -a -o +devices
  LV                VG        Attr   LSize   Log         Copy%  Devices
  mirror            taft      mwi-a- 100.00m mirror_mlog 100.00 mirror_mimage_1(0),mirror_mimage_2(0)
  [mirror_mimage_1] taft      iwi-ao 100.00m                    /dev/sdc1(0)
  [mirror_mimage_2] taft      iwi-ao 100.00m                    /dev/sdd1(0)
  [mirror_mlog]     taft      lwi-ao   4.00m                    /dev/sdh1(0)
  new               taft      -wi-a- 100.00m                    /dev/sdb1(0)

# However the dm device associated with mimage_0 still exists and there isn't a new one for the new split off linear.

[root@taft-01 ~]# dmsetup ls
taft-mirror_mimage_2    (253, 8)
taft-mirror_mimage_1    (253, 5)
taft-mirror     (253, 6)
taft-mirror_mimage_0    (253, 4)
taft-mirror_mlog        (253, 3)

# When the LV/VG is finally removed the old image still remains, which causes new mirror creation to fail.

Version-Release number of selected component (if applicable):
lvm2-2.02.69-2.el6    BUILT: Fri Jul  2 07:26:01 CDT 2010
lvm2-libs-2.02.69-2.el6    BUILT: Fri Jul  2 07:26:01 CDT 2010
lvm2-cluster-2.02.69-2.el6    BUILT: Fri Jul  2 07:26:01 CDT 2010
udev-147-2.18.el6    BUILT: Fri Jun 11 07:47:21 CDT 2010
device-mapper-1.02.51-2.el6    BUILT: Fri Jul  2 07:26:01 CDT 2010
device-mapper-libs-1.02.51-2.el6    BUILT: Fri Jul  2 07:26:01 CDT 2010
device-mapper-event-1.02.51-2.el6    BUILT: Fri Jul  2 07:26:01 CDT 2010
device-mapper-event-libs-1.02.51-2.el6    BUILT: Fri Jul  2 07:26:01 CDT 2010
cmirror-2.02.69-2.el6    BUILT: Fri Jul  2 07:26:01 CDT 2010

How reproducible:
Everytime

Comment 1 Corey Marthaler 2010-07-07 19:37:06 UTC
Deactivating and then reactivating the volume group appears to fix this issue.

[root@taft-01 ~]# dmsetup ls
taft-mirror_mimage_2    (253, 8)
taft-mirror_mimage_1    (253, 5)
taft-mirror     (253, 6)
taft-mirror_mimage_0    (253, 4)
taft-mirror_mlog        (253, 3)

[root@taft-01 ~]# vgchange -an taft
  0 logical volume(s) in volume group "taft" now active

[root@taft-01 ~]# vgchange -ay taft
  2 logical volume(s) in volume group "taft" now active

[root@taft-01 ~]# dmsetup ls
taft-mirror_mimage_2    (253, 5)
taft-mirror_mimage_1    (253, 4)
taft-mirror     (253, 6)
taft-mirror_mlog        (253, 3)
taft-new        (253, 7)

Comment 2 Peter Rajnoha 2010-07-09 12:08:51 UTC
Yes, seems like a forgotten resume for a new device with a new name assigned so the change gets accounted for.

Just like in case of bug #612248, the problem is located in _split_mirror_image fn. So it seems this one really needs inspection and a few fixes :)

Comment 3 Jonathan Earl Brassow 2010-07-12 14:31:08 UTC
Preliminary patch sent to lvm-devel

Comment 4 Jonathan Earl Brassow 2010-07-13 21:55:23 UTC
pending version 2.02.71

Comment 6 Corey Marthaler 2010-07-29 22:22:55 UTC
In the latest build the dm devices are only removed on the node that does the split operation. All other nodes continue to have the zombie dm devices.

[root@taft-02 ~]# lvconvert --splitmirrors 1 --name new taft/mirror
  Logical volume mirror converted.

[root@taft-02 ~]# dmsetup ls
taft-mirror_mimage_1    (253, 5)
taft-mirror     (253, 7)
taft-mirror_mimage_0    (253, 4)
taft-mirror_mlog        (253, 3)
taft-new        (253, 6)



[root@taft-01 ~]# dmsetup ls
taft-mirror_mimage_2    (253, 6)
taft-mirror_mimage_1    (253, 5)
taft-mirror     (253, 7)
taft-mirror_mimage_0    (253, 4)
taft-mirror_mlog        (253, 3)

[root@taft-03 ~]# dmsetup ls
taft-mirror_mimage_2    (253, 6)
taft-mirror_mimage_1    (253, 5)
taft-mirror     (253, 7)
taft-mirror_mimage_0    (253, 4)
taft-mirror_mlog        (253, 3)

[root@taft-04 ~]# dmsetup ls
taft-mirror_mimage_2    (253, 6)
taft-mirror_mimage_1    (253, 5)
taft-mirror     (253, 7)
taft-mirror_mimage_0    (253, 4)
taft-mirror_mlog        (253, 3)



2.6.32-52.el6.x86_64

lvm2-2.02.72-3.el6    BUILT: Wed Jul 28 15:39:43 CDT 2010
lvm2-libs-2.02.72-3.el6    BUILT: Wed Jul 28 15:39:43 CDT 2010
lvm2-cluster-2.02.72-3.el6    BUILT: Wed Jul 28 15:39:43 CDT 2010
udev-147-2.21.el6    BUILT: Mon Jul 12 04:55:00 CDT 2010
device-mapper-1.02.53-3.el6    BUILT: Wed Jul 28 15:39:43 CDT 2010
device-mapper-libs-1.02.53-3.el6    BUILT: Wed Jul 28 15:39:43 CDT 2010
device-mapper-event-1.02.53-3.el6    BUILT: Wed Jul 28 15:39:43 CDT 2010
device-mapper-event-libs-1.02.53-3.el6    BUILT: Wed Jul 28 15:39:43 CDT 2010
cmirror-2.02.72-3.el6    BUILT: Wed Jul 28 15:39:43 CDT 2010

Comment 8 Corey Marthaler 2010-08-12 16:27:11 UTC
This still exists in the latest rpms.

2.6.32-59.1.el6.x86_64

lvm2-2.02.72-7.el6    BUILT: Wed Aug 11 17:12:24 CDT 2010
lvm2-libs-2.02.72-7.el6    BUILT: Wed Aug 11 17:12:24 CDT 2010
lvm2-cluster-2.02.72-7.el6    BUILT: Wed Aug 11 17:12:24 CDT 2010
udev-147-2.22.el6    BUILT: Fri Jul 23 07:21:33 CDT 2010
device-mapper-1.02.53-7.el6    BUILT: Wed Aug 11 17:12:24 CDT 2010
device-mapper-libs-1.02.53-7.el6    BUILT: Wed Aug 11 17:12:24 CDT 2010
device-mapper-event-1.02.53-7.el6    BUILT: Wed Aug 11 17:12:24 CDT 2010
device-mapper-event-libs-1.02.53-7.el6    BUILT: Wed Aug 11 17:12:24 CDT 2010
cmirror-2.02.72-7.el6    BUILT: Wed Aug 11 17:12:24 CDT 2010

Comment 9 Jonathan Earl Brassow 2010-08-12 22:31:39 UTC
patch posted for review to lvm-devel

Comment 10 Jonathan Earl Brassow 2010-08-12 22:33:52 UTC
problem is that the suspend/resume operations that cause the node issuing the 'lvconvert' to reload the dm devices locally has no effect remotely.  This is because the newly split LV has no entry in the lv_hash as required to do the suspend/resume operation.  It can only get into the hash via a activate_lv operation.  So, the patch replaces the suspend/resume with an activate_lv for the newly split LV.

Comment 11 Jonathan Earl Brassow 2010-08-16 18:06:16 UTC
POST:

Fix for bug 612291: dm devices of split off mirror images are not removed

DM devices were not handled properly on nodes in a cluster that were not
where the splitmirrors command was issued.  This was happening because
suspend_lv/resume_lv were being used in a place where activate_lv should
have been used.

When the suspend/resume are issued on (effectively) new LVs, their
'resource' (UUID) is not located in the lv_hash.  Thus, both operations
turn into no-ops.  You can see this from the output of clvmd from one
of the remote nodes:
<snip>
CLVMD[3c7ed710]: Aug 12 17:01:44 do_suspend_lv, lock not already held
<snip>
CLVMD[3c7ed710]: Aug 12 17:02:03 do_resume_lv, lock not already held

'activate_lv' enjoins the other nodes in the cluster to process the lock
and activate the new LV.  clvmd output from remote node as follows:
CLVMD[776e5710]: Aug 12 16:53:21 do_lock_lv: resource 'zMseY7CBuO3Ty09vXlplPAHzD0Y0CovjrTdv0R1VcwggMwPdYhutHErRcwm5Nd2S', cmd = 0x19 LCK_LV_ACTIVATE (READ|LV|NONBLOCK), flags = 0x84 (DMEVENTD_MONITOR ), memlock = 1
CLVMD[776e5710]: Aug 12 16:53:21 sync_lock: 'zMseY7CBuO3Ty09vXlplPAHzD0Y0CovjrTdv0R1VcwggMwPdYhutHErRcwm5Nd2S' mode:1 flags=1
CLVMD[776e5710]: Aug 12 16:53:21 sync_lock: returning lkid 27b0001

Comment 12 Corey Marthaler 2010-08-18 21:23:08 UTC
Fix verified in the latest rpms.

2.6.32-59.1.el6.x86_64

lvm2-2.02.72-8.el6    BUILT: Wed Aug 18 10:41:52 CDT 2010
lvm2-libs-2.02.72-8.el6    BUILT: Wed Aug 18 10:41:52 CDT 2010
lvm2-cluster-2.02.72-8.el6    BUILT: Wed Aug 18 10:41:52 CDT 2010
udev-147-2.22.el6    BUILT: Fri Jul 23 07:21:33 CDT 2010
device-mapper-1.02.53-8.el6    BUILT: Wed Aug 18 10:41:52 CDT 2010
device-mapper-libs-1.02.53-8.el6    BUILT: Wed Aug 18 10:41:52 CDT 2010
device-mapper-event-1.02.53-8.el6    BUILT: Wed Aug 18 10:41:52 CDT 2010
device-mapper-event-libs-1.02.53-8.el6    BUILT: Wed Aug 18 10:41:52 CDT 2010
cmirror-2.02.72-8.el6    BUILT: Wed Aug 18 10:41:52 CDT 2010

Comment 13 releng-rhel@redhat.com 2010-11-10 21:08:22 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.