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 1063542 - pending thin snapshot merge after "reboot" causes problems when pool is stacked on raid
Summary: pending thin snapshot merge after "reboot" causes problems when pool is stack...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-11 00:27 UTC by Corey Marthaler
Modified: 2021-09-08 20:32 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.02.105-4.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 12:20:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Corey Marthaler 2014-02-11 00:27:53 UTC
Description of problem:
Test case to simulate a pending thin snap merge at boot up. This only fails when the pool is a converted raid volume.  

SCENARIO - [reboot_before_merge_starts]
Attempt to merge an inuse snapshot, then "reboot" the machine before the merge can take place
Making origin volume
Converting *Raid* volumes to thin pool and thin pool metadata devices
lvcreate --type raid1 -m 1 --zero n -L 2G -n POOL snapper_thinp
lvcreate --type raid1 -m 1 --zero n -L 2G -n meta snapper_thinp
Waiting until all mirror|raid volumes become fully syncd...
   0/2 mirror(s) are fully synced: ( 9.45% 9.10% )
   0/2 mirror(s) are fully synced: ( 20.34% 19.94% )
   0/2 mirror(s) are fully synced: ( 31.09% 30.73% )
   0/2 mirror(s) are fully synced: ( 41.13% 40.84% )
   0/2 mirror(s) are fully synced: ( 51.90% 51.54% )
   0/2 mirror(s) are fully synced: ( 62.57% 56.93% )
   0/2 mirror(s) are fully synced: ( 73.41% 73.10% )
   0/2 mirror(s) are fully synced: ( 84.37% 84.06% )
   0/2 mirror(s) are fully synced: ( 95.00% 94.78% )
   2/2 mirror(s) are fully synced: ( 100.00% 100.00% )
lvconvert --thinpool snapper_thinp/POOL --poolmetadata meta
Sanity checking pool device metadata
(thin_check /dev/mapper/snapper_thinp-POOL_tmeta)
examining superblock
examining devices tree
examining mapping tree
lvcreate --virtualsize 1G -T snapper_thinp/POOL -n origin
lvcreate -V 1G -T snapper_thinp/POOL -n other1
lvcreate -V 1G -T snapper_thinp/POOL -n other2
lvcreate -V 1G -T snapper_thinp/POOL -n other3
lvcreate -V 1G -T snapper_thinp/POOL -n other4
Placing an xfs filesystem on origin volume
Mounting origin volume

Making snapshot of origin volume
lvcreate -K -s /dev/snapper_thinp/origin -n merge_reboot
Mounting snap volume

Attempt to merge snapshot snapper_thinp/merge_reboot
[root@host-049 ~]# lvconvert --merge snapper_thinp/merge_reboot
  Logical volume snapper_thinp/merge_reboot contains a filesystem in use.
  Delaying merge since snapshot is open.
  Merging of thin snapshot merge_reboot will occur on next activation.

umount /mnt/merge_reboot /mnt/origin
vgchange -an snapper_thinp
vgchange --sysinit -ay snapper_thinp


[root@host-049 ~]# lvs -a -o +devices
  LV                    Attr       LSize   Pool Origin Data%  Cpy%Sync Devices
  POOL                  twi-a-tz--  2.00g               2.58           POOL_tdata(0)
  [POOL_tdata]          rwi-aor---  2.00g                      100.00  POOL_tdata_rimage_0(0),POOL_tdata_rimage_1(0)
  [POOL_tdata_rimage_0] iwi-aor---  2.00g                              /dev/sdf1(1)
  [POOL_tdata_rimage_1] iwi-aor---  2.00g                              /dev/sdd1(1)
  [POOL_tdata_rmeta_0]  ewi-aor---  4.00m                              /dev/sdf1(0)
  [POOL_tdata_rmeta_1]  ewi-aor---  4.00m                              /dev/sdd1(0)
  [POOL_tmeta]          ewi-aor---  2.00g                      100.00  POOL_tmeta_rimage_0(0),POOL_tmeta_rimage_1(0)
  [POOL_tmeta_rimage_0] iwi-aor---  2.00g                              /dev/sdf1(514)
  [POOL_tmeta_rimage_1] iwi-aor---  2.00g                              /dev/sdd1(514)
  [POOL_tmeta_rmeta_0]  ewi-aor---  4.00m                              /dev/sdf1(513)
  [POOL_tmeta_rmeta_1]  ewi-aor---  4.00m                              /dev/sdd1(513)
  [lvol0_pmspare]       ewi-------  2.00g                              /dev/sdf1(1026)
  [merge_reboot]        Swi---tz-k  1.00g POOL origin
  origin                Owi-a-tz--  1.00g POOL          4.95
  other1                Vwi-a-tz--  1.00g POOL          0.00
  other2                Vwi-a-tz--  1.00g POOL          0.00
  other3                Vwi-a-tz--  1.00g POOL          0.00
  other4                Vwi-a-tz--  1.00g POOL          0.00
[root@host-049 ~]# vgchange --refresh snapper_thinp
  Thin pool transaction_id=7, while expected: 5.
  Unable to deactivate open snapper_thinp-POOL_tdata (253:11)
  Unable to deactivate open snapper_thinp-POOL_tmeta (253:6)
  Failed to deactivate snapper_thinp-POOL-tpool
  Failed to reactivate other4.
  libdevmapper exiting with 2 device(s) still suspended.
[root@host-049 ~]# vgchange --refresh snapper_thinp
  Attempted to decrement suspended device counter below zero.
  Attempted to decrement suspended device counter below zero.



Version-Release number of selected component (if applicable):
3.10.0-84.el7.x86_64
lvm2-2.02.105-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
lvm2-libs-2.02.105-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
lvm2-cluster-2.02.105-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-1.02.84-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-libs-1.02.84-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-event-1.02.84-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-event-libs-1.02.84-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014
device-mapper-persistent-data-0.2.8-4.el7    BUILT: Fri Jan 24 14:28:55 CST 2014
cmirror-2.02.105-3.el7    BUILT: Wed Feb  5 06:36:34 CST 2014


How reproducible:
Everytime

Comment 1 Zdenek Kabelac 2014-02-18 13:39:28 UTC
Yep - there was a nasty bug in the locking code which cause horrible execution of metadata update without keeping the VG lock in some special cases.

Fixed already upstream:

https://www.redhat.com/archives/lvm-devel/2014-January/msg00056.html

Will be included in the next lvm2 build.

Comment 3 Corey Marthaler 2014-02-20 01:10:18 UTC
Fix verified in the latest rpms.

3.10.0-84.el7.x86_64
lvm2-2.02.105-4.el7    BUILT: Wed Feb 19 09:19:54 CST 2014
lvm2-libs-2.02.105-4.el7    BUILT: Wed Feb 19 09:19:54 CST 2014
lvm2-cluster-2.02.105-4.el7    BUILT: Wed Feb 19 09:19:54 CST 2014
device-mapper-1.02.84-4.el7    BUILT: Wed Feb 19 09:19:54 CST 2014
device-mapper-libs-1.02.84-4.el7    BUILT: Wed Feb 19 09:19:54 CST 2014
device-mapper-event-1.02.84-4.el7    BUILT: Wed Feb 19 09:19:54 CST 2014
device-mapper-event-libs-1.02.84-4.el7    BUILT: Wed Feb 19 09:19:54 CST 2014
device-mapper-persistent-data-0.2.8-4.el7    BUILT: Fri Jan 24 14:28:55 CST 2014
cmirror-2.02.105-4.el7    BUILT: Wed Feb 19 09:19:54 CST 2014



SCENARIO - [reboot_before_merge_starts]
Attempt to merge an inuse snapshot, then "reboot" the machine before the merge can take place
Making origin volume
Converting *Raid* volumes to thin pool and thin pool metadata devices
lvcreate --type raid1 -m 1 --zero n -L 4G -n POOL snapper_thinp
lvcreate --type raid1 -m 1 --zero n -L 4G -n meta snapper_thinp
Waiting until all mirror|raid volumes become fully syncd...
   0/2 mirror(s) are fully synced: ( 6.75% 3.08% )
   0/2 mirror(s) are fully synced: ( 14.11% 14.35% )
   0/2 mirror(s) are fully synced: ( 21.34% 21.57% )
   0/2 mirror(s) are fully synced: ( 86.21% 86.35% )
   0/2 mirror(s) are fully synced: ( 97.63% 94.10% )
   2/2 mirror(s) are fully synced: ( 100.00% 100.00% )
lvconvert --thinpool snapper_thinp/POOL --poolmetadata meta
Sanity checking pool device metadata
(thin_check /dev/mapper/snapper_thinp-POOL_tmeta)
examining superblock
examining devices tree
examining mapping tree
lvcreate --virtualsize 1G -T snapper_thinp/POOL -n origin
lvcreate --virtualsize 1G -T snapper_thinp/POOL -n other1
lvcreate --virtualsize 1G -T snapper_thinp/POOL -n other2
lvcreate --virtualsize 1G -T snapper_thinp/POOL -n other3
lvcreate -V 1G -T snapper_thinp/POOL -n other4
lvcreate -V 1G -T snapper_thinp/POOL -n other5
Placing an xfs filesystem on origin volume
Mounting origin volume

Making snapshot of origin volume
lvcreate -K -s /dev/snapper_thinp/origin -n merge_reboot
Mounting snap volume

Attempt to merge snapshot snapper_thinp/merge_reboot
lvconvert --merge snapper_thinp/merge_reboot
  Logical volume snapper_thinp/merge_reboot contains a filesystem in use.

umount and deactivate volume group
vgchange --sysinit -ay snapper_thinp
vgchange --refresh snapper_thinp

perform raid scrubbing on POOL_tdata
(lvchange --syncaction repair snapper_thinp/POOL_tdata)
perform raid scrubbing on POOL_tmeta
(lvchange --syncaction repair snapper_thinp/POOL_tmeta)
Waiting until all mirror|raid volumes become fully syncd...
   0/2 mirror(s) are fully synced: ( 12.83% 2.26% )
   0/2 mirror(s) are fully synced: ( 26.16% 6.76% )
   0/2 mirror(s) are fully synced: ( 39.11% 11.71% )
   1/2 mirror(s) are fully synced: ( 100.00% 77.74% )
   1/2 mirror(s) are fully synced: ( 100.00% 87.02% )
   1/2 mirror(s) are fully synced: ( 100.00% 95.51% )
   2/2 mirror(s) are fully synced: ( 100.00% 100.00% )

Removing thin origin and other virtual thin volumes
Removing thinpool snapper_thinp/POOL

Comment 4 Ludek Smid 2014-06-13 12:20:31 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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