Bug 1268445 - limitations to what can be done to shared (-asy) activated LVs on shared VGs
limitations to what can be done to shared (-asy) activated LVs on shared VGs
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.2
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: David Teigland
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-02 16:14 EDT by Corey Marthaler
Modified: 2017-10-03 21:21 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Corey Marthaler 2015-10-02 16:14:54 EDT
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 16:56:18 EDT
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 12:00:48 EDT
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 12:55:02 EDT
[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 15:29:50 EDT
[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

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