Bug 1268445

Summary: limitations to what can be done to shared (-asy) activated LVs on shared VGs
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: LVM lock daemon / lvmlockd QA Contact: cluster-qe <cluster-qe>
Status: CLOSED WONTFIX Docs Contact:
Severity: low    
Priority: low CC: agk, heinzm, jbrassow, prajnoha, teigland, zkabelac
Version: 7.2   
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: 2020-12-15 07:37:14 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
verbose vgcreate attempt none

Description Corey Marthaler 2015-10-02 20:14:54 UTC
Description of problem:

# First reproduction
Oct  2 13:43:07 mckinley-01 qarshd[83341]: Running cmdline: lvchange --addtag L7/ --addtag L8= /dev/stripe_2_4543/stripe_2_45430
Oct  2 13:50:57 mckinley-01 sanlock[76262]: 2015-10-02 13:50:57-0500 1393561 [76267]: r3839 ballot 25 abort1 mbal 176 mbal[212] 213
Oct  2 13:50:57 mckinley-01 sanlock[76262]: 2015-10-02 13:50:57-0500 1393561 [76267]: r3839 paxos_acquire 25 retry delay 85667 us
Oct  2 13:50:57 mckinley-01 sanlock[76262]: 2015-10-02 13:50:57-0500 1393561 [76267]: r3839 paxos_acquire 25 owner is 1870 1 0
Oct  2 13:50:57 mckinley-01 sanlock[76262]: 2015-10-02 13:50:57-0500 1393561 [76267]: r3839 acquire_token held error -244
Oct  2 13:50:57 mckinley-01 sanlock[76262]: 2015-10-02 13:50:57-0500 1393561 [76267]: r3839 cmd_acquire 2,8,76274 acquire_token -244 lease owned by other host

[root@mckinley-01 ~]# lvchange --addtag L7/ --addtag L8= /dev/stripe_2_4543/stripe_2_45430
  LV stripe_2_4543/stripe_2_45430 lock failed: error -17




# Second reproduction on different shared VG/LV
[root@harding-02 ~]# lvs -a -o +devices
  LV             VG            Attr       LSize   Devices                                                                                                            
  [lvmlock]      global        -wi-ao---- 256.00m /dev/mapper/mpatha2(0)                                                                                             
  [lvmlock]      stripe_5_7072 -wi-ao---- 256.00m /dev/mapper/mpatha1(0)                                                                                             
  stripe_5_70720 stripe_5_7072 -wi-a-----   1.02g /dev/mapper/mpatha1(64),/dev/mapper/mpathb2(0),/dev/mapper/mpathb1(0),/dev/mapper/mpathc2(0),/dev/mapper/mpathc1(0)

[root@harding-02 ~]# lvchange --addtag L7/ --addtag L8= /dev/stripe_5_7072/stripe_5_70720
  LV stripe_5_7072/stripe_5_70720 lock failed: error -17

[root@harding-02 ~]# lvchange -ay --addtag L7/ --addtag L8= /dev/stripe_5_7072/stripe_5_70720
  Logical volume "stripe_5_70720" changed.

[root@harding-02 ~]# lvs -o +devices,lv_tags
  VG stripe_5_7072 lock skipped: error -9
  Reading VG stripe_5_7072 without a lock.
  LV             VG            Attr       LSize  Devices                                                                                                             LV Tags
  stripe_5_70720 stripe_5_7072 -wi-a----- 1.02g  /dev/mapper/mpatha1(64),/dev/mapper/mpathb2(0),/dev/mapper/mpathb1(0),/dev/mapper/mpathc2(0),/dev/mapper/mpathc1(0) L7/,L8=

[root@harding-02 ~]# lvchange -an --addtag L9 /dev/stripe_5_7072/stripe_5_70720
  VG stripe_5_7072 lock skipped: error -9
  Reading VG stripe_5_7072 without a lock.
  Logical volume "stripe_5_70720" changed.
  LV stripe_5_7072/stripe_5_70720 lock failed: error -9
  Failed to unlock logical volume stripe_5_7072/stripe_5_70720

[root@harding-02 ~]# lvs -o +devices,lv_tags
  VG stripe_5_7072 lock skipped: error -9
  Reading VG stripe_5_7072 without a lock.
  LV             VG            Attr       LSize Devices                                                                                                             LV Tags   
  stripe_5_70720 stripe_5_7072 -wi------- 1.02g /dev/mapper/mpatha1(64),/dev/mapper/mpathb2(0),/dev/mapper/mpathb1(0),/dev/mapper/mpathc2(0),/dev/mapper/mpathc1(0) L7/,L8=,L9


Version-Release number of selected component (if applicable):
3.10.0-306.el7.x86_64

lvm2-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
lvm2-libs-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
lvm2-cluster-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-1.02.107-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-libs-1.02.107-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-event-1.02.107-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-event-libs-1.02.107-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
device-mapper-persistent-data-0.5.5-1.el7    BUILT: Thu Aug 13 09:58:10 CDT 2015
cmirror-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015
sanlock-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
sanlock-lib-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
lvm2-lockd-2.02.130-2.el7    BUILT: Tue Sep 15 07:15:40 CDT 2015


How reproducible:
Everytime

Comment 1 David Teigland 2015-10-02 20:56:18 UTC
All error numbers from lvmlockd are meant to be caught so that an explanatory error message can be printed instead of just the error number, so this EEXIST error:

  LV vg/lv lock failed: error -17

has been updated and is now printed as:

  LV is already locked with incompatible mode: vg/lv

Because the LV is active with a shared LV lock, but lvchange wants to use an incompatible ex LV lock to "modify" the LV.  This may change since tags don't really modify the LV...

The larger question above is whether tags can be added or removed on an LV that is active with a shared lock (potentially active on multiple hosts).  Since adding and removing tags does not require the LV to be active, does not affect how the LV is used, but only changes VG metadata, we could just lock the VG for the metadata change, and not bother with any LV lock at all.

A second issue above is what lvchange actions can be combined in a single command, e.g. -an and --addtag are done together.  To answer this we'll want to look at all possible combinations of lvchange actions and decide on a common policy for what can be combined.

Comment 2 Corey Marthaler 2015-10-05 16:00:48 UTC
Other issues:

shared mirror conversion attempt
[root@harding-02 ~]# lvconvert --type mirror -m 1 /dev/linear_5_1697/linear_5_16970
  LV linear_5_1697/linear_5_16970 lock failed: error -17


shared size reduction attempt
[root@mckinley-01 ~]# lvreduce -f -l 158 /dev/linear_1_9785/linear_1_97850
  LV linear_1_9785/linear_1_97850 lock failed: error -17

Comment 3 Corey Marthaler 2015-10-05 16:55:02 UTC
[root@host-113 ~]# lvchange -f -My --major 255 --minor 139 /dev/stripe_2_4948/stripe_2_49480
  LV stripe_2_4948/stripe_2_49480 lock failed: error -17

Comment 4 Corey Marthaler 2015-10-05 19:29:50 UTC
[root@harding-02 ~]# lvrename stripe_4_4693 /dev/stripe_4_4693/stripe_4_46930 rename_889
  LV stripe_4_4693/stripe_4_46930 lock failed: error -17

Comment 6 Corey Marthaler 2018-05-23 17:15:50 UTC
Created attachment 1440715 [details]
verbose vgcreate attempt

Not sure this is even the same issue, but here's another "-17" issue recently seen

mckinley-01: pvcreate /dev/mapper/mpatha2 /dev/mapper/mpatha1 /dev/mapper/mpathb2 /dev/mapper/mpathb1 /dev/mapper/mpathc2 /dev/mapper/mpathc1 /dev/mapper/mpathd2 /dev/mapper/mpathd1 /dev/mapper/mpathe2 /dev/mapper/mpathe1
mckinley-01: vgcreate  --shared raid_sanity /dev/mapper/mpatha2 /dev/mapper/mpatha1 /dev/mapper/mpathb2 /dev/mapper/mpathb1 /dev/mapper/mpathc2 /dev/mapper/mpathc1 /dev/mapper/mpathd2 /dev/mapper/mpathd1 /dev/mapper/mpathe2 /dev/mapper/mpathe1
  VG raid_sanity init failed: -17
  Failed to initialize lock args for lock type dlm
vgcreate failed on mckinley-01

Comment 7 Corey Marthaler 2018-11-13 00:26:00 UTC
Adding a note to this bug about shared lvextend bug 1649086 - Support online resizing for GFS2.

Comment 8 Corey Marthaler 2018-11-13 20:42:29 UTC
Adding a note to this bug about shared lvconvert bug 1649546 - Support shared activated image conversion

(this was already mentioned above in comment #2 w/ sanlock. Bug 1649546 being about w/ dlm)

Comment 10 RHEL Program Management 2020-12-15 07:37:14 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.