Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 743976

Summary: timing issue causing snapshot and origin removals to fail
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: agk, dwysocha, heinzm, jbrassow, mbroz, prajnoha, prockai, syeghiay, thornber, zkabelac
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.87-6.el6 Doc Type: Bug Fix
Doc Text:
Do not document.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 17:03:38 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:

Description Corey Marthaler 2011-10-06 16:07:32 UTC
Description of problem:

SCENARIO - [remove_snap_during_origin_io]
Create a snapshot and then attempt to remove it during origin IO
Making origin volume
Making snapshots of origin volume

 LV                        VG       Attr   LSize  Origin Snap%  Devices
 origin                    snapper  owi-ao  1.00g               /dev/sdc1(0)
 remove_during_origin_io_1 snapper  swi-a-  1.00g origin  0.04  /dev/sdc1(256)
 remove_during_origin_io_2 snapper  swi-a-  1.00g origin  0.04  /dev/sdc1(512)

Starting io to origin
dd if=/dev/zero of=/dev/snapper/origin count=3000000

Removing volume snapper/remove_during_origin_io_1
[root@grant-01 ~]# lvremove -f /dev/snapper/remove_during_origin_io_1
  LV snapper/remove_during_origin_io_1 in use: not deactivating
  Unable to deactivate logical volume "remove_during_origin_io_1"
# Note: if tried again right away, it usually works
[root@grant-01 ~]# lvremove -f /dev/snapper/remove_during_origin_io_1
  Logical volume "remove_during_origin_io_1" successfully removed


Version-Release number of selected component (if applicable):
2.6.32-203.el6.x86_64

lvm2-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
lvm2-libs-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
lvm2-cluster-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
udev-147-2.40.el6    BUILT: Fri Sep 23 07:51:13 CDT 2011
device-mapper-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-libs-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-event-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-event-libs-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
cmirror-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011


How reproducible:
About 80% of the time

Comment 1 Corey Marthaler 2011-10-06 19:33:16 UTC
This appears to be a more general snapshot/origin removal issue. I've seen this now with quite a few snap test cases.

SCENARIO - [remove_origin_under_snap]
Create a snapshot and then attempt to remove it's origin
Making origin volume
Making snapshot of origin volume
sleeping for a bit
Attempt to remove origin volume
hayes-01: lvremove -f /dev/snapper/origin
  LV snapper/remove_origin_under_snap in use: not deactivating
  Unable to deactivate logical volume "remove_origin_under_snap"
should have been able to remove origin


SCENARIO - [stacked_snaps]
Stack snapshots on top of existing snapshots
Setting up base level origin/snapshot
Creating stacked level PV/VG
  Writing physical volume data to disk "/dev/snapper/origin"
Creating stacked level origin/snapshot
Removing stacked level origin/snapshot
  Unable to deactivate open snapper_stack-snap_level2 (253:8)
  Unable to deactivate logical volume "snap_level2"
couldn't remove snapshot snap_level2

Comment 2 Corey Marthaler 2011-10-06 19:48:42 UTC
Another regression is that you can now remove the origin volume, and the snapshot volume may remain.

Comment 3 Zdenek Kabelac 2011-10-18 14:46:45 UTC
I think, it's most probably related to my upstream fix:

https://www.redhat.com/archives/lvm-devel/2011-October/msg00082.html

Comment 4 Peter Rajnoha 2011-10-19 15:45:04 UTC
Corey tested a scratch with this patch and he was not able to hit this issue anymore.

Comment 7 Corey Marthaler 2011-10-20 14:41:35 UTC
Current snapshot regression tests now pass. Marking this bug verified in the latest rpms.

2.6.32-209.el6.x86_64

lvm2-2.02.87-6.el6    BUILT: Wed Oct 19 06:46:31 CDT 2011
lvm2-libs-2.02.87-6.el6    BUILT: Wed Oct 19 06:46:31 CDT 2011
lvm2-cluster-2.02.87-6.el6    BUILT: Wed Oct 19 06:46:31 CDT 2011
udev-147-2.40.el6    BUILT: Fri Sep 23 07:51:13 CDT 2011
device-mapper-1.02.66-6.el6    BUILT: Wed Oct 19 06:46:31 CDT 2011
device-mapper-libs-1.02.66-6.el6    BUILT: Wed Oct 19 06:46:31 CDT 2011
device-mapper-event-1.02.66-6.el6    BUILT: Wed Oct 19 06:46:31 CDT 2011
device-mapper-event-libs-1.02.66-6.el6    BUILT: Wed Oct 19 06:46:31 CDT 2011
cmirror-2.02.87-6.el6    BUILT: Wed Oct 19 06:46:31 CDT 2011

Comment 8 Peter Rajnoha 2011-10-26 13:05:32 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Do not document.

Comment 9 errata-xmlrpc 2011-12-06 17:03:38 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.

http://rhn.redhat.com/errata/RHBA-2011-1522.html