Bug 1543429

Summary: locking error upon mirror creation
Product: Red Hat Enterprise Linux 7 Reporter: Roman Bednář <rbednar>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Clustered Mirror / cmirrord QA Contact: cluster-qe <cluster-qe>
Status: CLOSED NOTABUG Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 7.5   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-08 13:53:03 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
lvcreate_vvvv none

Description Roman Bednář 2018-02-08 13:05:16 UTC
Not 100% reproducible. 

dmeventd was running while lvcreate was attempted

So far I was not able to reproduce manually because of bug's random behaviour so I can not attach the verbose logs.

lvm2-2.02.177-1.el7.x86_64

[2018-02-08 11:20:44.683431] SCENARIO - [triple_dmeventd_monitoring]
[2018-02-08 11:20:44.683751] Turn dmeventd monitoring on for mirror, snapshot and thin
[2018-02-08 11:20:44.684043] Have dmeventd monitoring turned on for a:
[2018-02-08 11:20:44.684305] 	mirror (libdevmapper-event-lvm2mirror.so)
[2018-02-08 11:20:44.684566] 	snapshot (libdevmapper-event-lvm2snapshot.so)
[2018-02-08 11:20:44.684782] 	thin (libdevmapper-event-lvm2thin.so)
[2018-02-08 11:20:44.685001] Make a couple mirrored with snapshot volumes
[2018-02-08 11:20:44.685273] lvcreate --activate ey --type mirror -m 1 -n dual_mirror_1 --alloc anywhere -L 100M snapper_thinp
[2018-02-08 11:20:44.926140]   Error locking on node UNKNOWN 1: Refusing activation of partial LV snapper_thinp/dual_mirror_1_mlog.  Use '--activationmode partial' to override.
[2018-02-08 11:20:44.926371]   Aborting. Failed to activate mirror log.
[2018-02-08 11:20:44.991836]   Failed to initialise mirror log.

Comment 2 Roman Bednář 2018-02-08 13:11:13 UTC
This is what dm table contained after lvcreate failure. Unfortunately I can not get the tables from all nodes since I'm not able to reproduce this after reboot.

# dmsetup table
rhel_virt--369-swap: 0 1679360 linear 252:2 2048
rhel_virt--369-root: 0 12992512 linear 252:2 1681408
snapper_thinp-dual_mirror_1_mlog: 0 8192 linear 8:145 16384

Comment 3 Roman Bednář 2018-02-08 13:35:40 UTC
Created attachment 1393185 [details]
lvcreate_vvvv

I just recalled saving the log from previous attempts so here it is.

Comment 4 Zdenek Kabelac 2018-02-08 13:53:03 UTC
From log trace it looks like failure was cause by:

device-mapper: create ioctl on snapper_thinp-dual_mirror_1_mlog

So here lvm2 could not create a DM device with this name - likely becuase it already exists in your system.

The possibly explanation is the device has been 'forgotten' leaked from some other previous test.


So the failure is rather in the situation where this device was not removed during some 'vgremove -f' command for whatever reason.


So far I'm not seeing the bug on lvcreate side.

It works as designed - lvcreate simply stops when it find 'name collision' and it's upto admin to resolve this case.

Simplest way to trigger is the 'dmsetup' some  DM device with name in form of  'vgname-lvname'  and then run 'lvcreate' with matching name.