Bug 1468355 - pvscan fails "No matching physical volumes found" when lock operations are on going on other node
pvscan fails "No matching physical volumes found" when lock operations are on...
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.4
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: LVM and device-mapper development team
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-06 15:41 EDT by Corey Marthaler
Modified: 2017-08-17 14:31 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 2017-07-06 15:41:16 EDT
Description of problem:

[root@host-113 ~]# pvscan
  PV /dev/sdg1   VG global          lvm2 [<21.00 GiB / <20.75 GiB free]
  PV /dev/vda2   VG rhel_host-113   lvm2 [<7.00 GiB / 0    free]
  Total: 2 [27.99 GiB] / in use: 2 [27.99 GiB] / in no VG: 0 [0   ]

# Different window, same machine
host-113: vgcreate  --shared black_bird /dev/sdb1 /dev/sda1 /dev/sdf1 /dev/sdd1 /dev/sdh1 /dev/sdc1 /dev/sde1
host-113: vgchange --lock-start black_bird

# During above vgcreate/vgchange
[root@host-113 ~]# pvscan
  PV /dev/sdg1   VG global          lvm2 [<21.00 GiB / <20.75 GiB free]
  PV /dev/vda2   VG rhel_host-113   lvm2 [<7.00 GiB / 0    free]
  PV /dev/sdf1                      lvm2 [<21.00 GiB]
  PV /dev/sda1                      lvm2 [<21.00 GiB]
  PV /dev/sdc1                      lvm2 [<21.00 GiB]
  PV /dev/sdd1                      lvm2 [<21.00 GiB]
  PV /dev/sdh1                      lvm2 [<21.00 GiB]
  PV /dev/sdb1                      lvm2 [<21.00 GiB]
  PV /dev/sde1                      lvm2 [<21.00 GiB]
  Total: 9 [174.97 GiB] / in use: 2 [27.99 GiB] / in no VG: 7 [<146.98 GiB]

# After above vgcreate/vgchange
[root@host-113 ~]# pvscan
  PV /dev/sdb1   VG black_bird      lvm2 [<21.00 GiB / <20.75 GiB free]
  PV /dev/sda1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdf1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdd1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdh1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdc1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sde1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdg1   VG global          lvm2 [<21.00 GiB / <20.75 GiB free]
  PV /dev/vda2   VG rhel_host-113   lvm2 [<7.00 GiB / 0    free]
  Total: 9 [174.96 GiB] / in use: 9 [174.96 GiB] / in no VG: 0 [0   ]




# Different node in the cluster
[root@host-114 ~]# pvscan
  PV /dev/sdg1   VG global          lvm2 [<21.00 GiB / <20.75 GiB free]
  PV /dev/vda2   VG rhel_host-114   lvm2 [<7.00 GiB / 0    free]
  Total: 2 [27.99 GiB] / in use: 2 [27.99 GiB] / in no VG: 0 [0   ]

# During vgcreate/vgchange occurring on host-113
[root@host-114 ~]# pvscan
  Retrying sh global lock
  Retrying sh global lock
  Retrying sh global lock
  Global lock failed: held by other host.
  No matching physical volumes found

# After vgcreate/vgchange occurring on host-113
[root@host-114 ~]# pvscan
  VG black_bird lock skipped: lock start in progress
  Reading VG black_bird without a lock.
  PV /dev/sdb1   VG black_bird      lvm2 [<21.00 GiB / <20.75 GiB free]
  PV /dev/sda1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sde1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdd1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdh1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdc1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdf1   VG black_bird      lvm2 [<21.00 GiB / <21.00 GiB free]
  PV /dev/sdg1   VG global          lvm2 [<21.00 GiB / <20.75 GiB free]
  PV /dev/vda2   VG rhel_host-114   lvm2 [<7.00 GiB / 0    free]
  Total: 9 [174.96 GiB] / in use: 9 [174.96 GiB] / in no VG: 0 [0   ]


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

lvm2-2.02.171-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
lvm2-libs-2.02.171-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
lvm2-cluster-2.02.171-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
device-mapper-1.02.140-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
device-mapper-libs-1.02.140-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
device-mapper-event-1.02.140-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
device-mapper-event-libs-1.02.140-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017
cmirror-2.02.171-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
sanlock-3.5.0-1.el7    BUILT: Wed Apr 26 09:37:30 CDT 2017
sanlock-lib-3.5.0-1.el7    BUILT: Wed Apr 26 09:37:30 CDT 2017
lvm2-lockd-2.02.171-8.el7    BUILT: Wed Jun 28 13:28:58 CDT 2017
Comment 2 David Teigland 2017-07-06 16:10:29 EDT
The issue here is that the global lock is held for the duration of vgcreate, and vgcreate can take longer (with sanlock) than the default lock retry timeout used by other nodes:

# lvmconfig --type default  --withcomments global/lvmlockd_lock_retries
# Configuration option global/lvmlockd_lock_retries.
# Retry lvmlockd lock requests this many times.
# Applicable only if LVM is compiled with lockd support
# This configuration option has an automatic default value.
# lvmlockd_lock_retries=3

Three retries is usually enough to hide incidental lock conflicts when nodes happen to be running concurrent commands requesting conflicting locks, because most locks are held for short periods.  vgcreate is the main exception where a lock is held for a longer time.  I've been intending to split up the sanlock operations in vgcreate so that the long part is done outside of the global lock.

One way to confirm that this is really what's happening is to increase the retries for the given command, e.g. pvscan --config global/lvmlockd_lock_retries=10

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