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 1533932 - Locking error when merging thin snapshot
Summary: Locking error when merging thin snapshot
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-12 15:01 UTC by Roman Bednář
Modified: 2021-09-03 12:49 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.177-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 15:23:49 UTC
Target Upstream Version:
Embargoed:
rhandlin: needinfo+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0853 0 None None None 2018-04-10 15:24:41 UTC

Description Roman Bednář 2018-01-12 15:01:27 UTC
Not 100% reproducible, possible race. 

=============================
SCENARIO - [invalidated_thin_snap_merge]
 Create "invalidated" (full) thin snapshots and then verify that merge attempts will not cause problem
 Making pool volume
 lvcreate --activate ey --thinpool POOL -L 500M  --zero n --poolmetadatasize 4M snapper_thinp
 
 Sanity checking pool device (POOL) metadata
 thin_check /dev/mapper/snapper_thinp-meta_swap.601
 examining superblock
 examining devices tree
 examining mapping tree
 checking space map counts
 
 
 Making origin volume
 lvcreate --activate ey --virtualsize 100M -T snapper_thinp/POOL -n origin
 lvcreate --activate ey --virtualsize 100M -T snapper_thinp/POOL -n other1
 lvcreate --activate ey -V 100M -T snapper_thinp/POOL -n other2
 lvcreate --activate ey -V 100M -T snapper_thinp/POOL -n other3
 lvcreate --activate ey --virtualsize 100M -T snapper_thinp/POOL -n other4
 lvcreate --activate ey -V 100M -T snapper_thinp/POOL -n other5
   WARNING: Sum of all thin volume sizes (600.00 MiB) exceeds the size of thin pool snapper_thinp/POOL (500.00 MiB).
 
 lvcreate --activate ey -y -k n -s /dev/snapper_thinp/origin -n invalid1
 Filling snapshot /dev/snapper_thinp/invalid1
 dd if=/dev/zero of=/dev/snapper_thinp/invalid1 bs=1M count=101
 dd: error writing ‘/dev/snapper_thinp/invalid1’: No space left on device
 101+0 records in
 100+0 records out
 104857600 bytes (105 MB) copied, 0.307725 s, 341 MB/s
 Attempt to merge back an invalidated snapshot volume
 lvconvert --merge /dev/snapper_thinp/invalid1 --yes
   Error locking on node UNKNOWN 1: Refusing activation of partial LV snapper_thinp/origin.  Use '--activationmode partial' to override.
   Failed to reactivate origin snapper_thinp/origin.
 couldn't merge invalidated snap


=============================
lvm2-2.02.176-5.el7.x86_64
kernel-3.10.0-826.el7.x86_64

Comment 2 Zdenek Kabelac 2018-01-12 15:04:55 UTC
The issue seems to popup as a race on cluster - where the reactivate origin needs to be activated exclusively.

Reasonable simple fix:


diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index deb7cc909..618d81953 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2170,7 +2170,7 @@ static int _lvconvert_merge_thin_snapshot(struct cmd_context *cmd,
 		log_print_unless_silent("Volume %s replaced origin %s.",
 					display_lvname(origin), display_lvname(lv));
 
-		if (origin_is_active && !activate_lv(cmd, lv)) {
+		if (origin_is_active && !activate_lv_excl(cmd, lv)) {
 			log_error("Failed to reactivate origin %s.",
 				  display_lvname(lv));
 			return 0;

Comment 4 Zdenek Kabelac 2018-01-17 16:02:56 UTC
Believed it's fixed upstream with these patch (fixing also few other possibly locking problems for lvconvert and stacking).


https://www.redhat.com/archives/lvm-devel/2018-January/msg00049.html

Comment 11 errata-xmlrpc 2018-04-10 15:23:49 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/RHEA-2018:0853


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