Bug 742706

Summary: Allow conversion from local activation to exclusive for clustered LV
Product: Red Hat Enterprise Linux 7 Reporter: Roman <rommer>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Clustering / clvmd QA Contact: cluster-qe <cluster-qe>
Status: CLOSED WONTFIX Docs Contact:
Severity: medium    
Priority: medium CC: agk, dwysocha, heinzm, jbrassow, msnitzer, prajnoha, teigland, thornber, zkabelac
Version: 7.3   
Target Milestone: pre-dev-freeze   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-09 15:10:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
convertlock option for rhel6.1
none
convertlock option lvm2-2.0.88
none
convertlock option lvm2-2.0.95
none
convertlock option lvm2-2.0.98 none

Description Roman 2011-10-01 20:06:53 UTC
Description of problem:
Unable to exclusively activate opened clustered logical volume.

Version-Release number of selected component (if applicable):
lvm2-2.02.83-3.el6.x86_64
lvm2-cluster-2.02.83-3.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Build cluster:
[root@clvmd2 ~]# clustat
Cluster Status for test-cluster @ Sat Oct  1 23:24:19 2011
Member Status: Quorate

 Member Name                                            ID   Status
 ------ ----                                            ---- ------
 clvmd2                                                     1 Online, Local
 clvmd3                                                     2 Online

[root@clvmd2 ~]# vgs
  VG   #PV #LV #SN Attr   VSize VFree
  vg     1   1   0 wz--nc 9.31g 9.21g
[root@clvmd2 ~]# 

2. Open (mount, start vm, ...) volume on the node clvmd2:
[root@clvmd2 ~]# lvs
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  lv1  vg   -wi-ao 100.00m                                      
[root@clvmd2 ~]# 

3. Deactivate volume on the node clvmd3:
[root@clvmd3 ~]# lvchange -aln vg/lv1
[root@clvmd3 ~]# lvs
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  lv1  vg   -wi--- 100.00m                                      
[root@clvmd3 ~]#

4. Try to exclusively activate volume on the node clvmd2:
[root@clvmd2 ~]# lvchange -ae vg/lv1
  Error locking on node clvmd2: Device or resource busy
[root@clvmd2 ~]# 

Actual results:
Error locking on node clvmd2: Device or resource busy

Expected results:
Exclusive lock.

Additional info:
Attached patches adds option "--convertlock" to the lvchange and vgchange
commands, that allows to convert logical volume locks between
CR and EX dlm locks:

On the clvmd3:
[root@clvmd3 ~]# lvs
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  lv1  vg   -wi--- 100.00m                                      
[root@clvmd3 ~]#

On the clvmd2:
[root@clvmd2 ~]# lvs
  LV   VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  lv1  vg   -wi-ao 100.00m                                      
[root@clvmd2 ~]# dlm_tool lockdump clvmd
id 00120001 gr CR rq IV pid 17714 master 0 "WtfL8phZbJXo4JikRZMDGQDPm3s1A6cLdjm6EVCndfUCUSEiPri2ITjbGr6i6vhf"
[root@clvmd2 ~]# lvchange -ae vg/lv1
  Error locking on node clvmd3: Device or resource busy
[root@clvmd2 ~]# lvchange -ae --convertlock vg/lv1
[root@clvmd2 ~]# dlm_tool lockdump clvmd
id 00120001 gr EX rq IV pid 17714 master 0 "WtfL8phZbJXo4JikRZMDGQDPm3s1A6cLdjm6EVCndfUCUSEiPri2ITjbGr6i6vhf"
[root@clvmd2 ~]# lvchange -aly --convertlock vg/lv1
[root@clvmd2 ~]# dlm_tool lockdump clvmd
id 00120001 gr CR rq IV pid 17714 master 0 "WtfL8phZbJXo4JikRZMDGQDPm3s1A6cLdjm6EVCndfUCUSEiPri2ITjbGr6i6vhf"
[root@clvmd2 ~]#

Comment 1 Roman 2011-10-01 20:08:04 UTC
Created attachment 525884 [details]
convertlock option for rhel6.1

Comment 2 Roman 2011-10-01 20:08:45 UTC
Created attachment 525885 [details]
convertlock option lvm2-2.0.88

Comment 4 RHEL Program Management 2011-10-07 15:55:57 UTC
Since RHEL 6.2 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 5 Milan Broz 2012-03-22 14:54:48 UTC
With lvm2-2.02.95-2.el6 version:

[root@bar-01 ~]# lvchange -aly vg_test/lv1
[root@bar-01 ~]# lvchange -aey vg_test/lv1
  Error locking on node bar-01: Device or resource busy

Thanks for patch, I think we need to consider lock conversion option in future.

Comment 6 Roman 2012-03-22 18:48:40 UTC
Made patch for the latest lvm2 version - 2.02.95.

I use it (with lvm2-2.0.88) in production environment more than 5 month to
make snapshots of the working kvm virtual machines on clustered volume:

# lvchange -an vg/disk 2>/dev/null
# lvchange -aey --convertlock vg/disk
# lvcreate -s -L<snap-size> -n disk-snap vg/disk
# <dump snapshot>
# lvremove -f vg/disk-snap
# lvchange -aly --convertlock vg/disk
# lvchange -ay vg/disk

Comment 7 Roman 2012-03-22 18:49:34 UTC
Created attachment 572063 [details]
convertlock option lvm2-2.0.95

Comment 8 RHEL Program Management 2012-07-10 08:26:00 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 9 RHEL Program Management 2012-07-10 23:56:38 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 10 Peter Rajnoha 2012-12-10 13:44:01 UTC
I'm moving this for consideration in 6.5 as it's too late to include this in 6.4 and we still need to go through possible test cases and and do a full review of the code, maybe changing the command line options and reusing existing ones...

Comment 12 Roman 2013-04-13 21:38:52 UTC
Created attachment 735445 [details]
convertlock option lvm2-2.0.98

convertlock option support for the lvm2-2.0.98 (rhel6.4)