Blob Blame History Raw
From 6c24147ebe0e979c48db93a5f8ec6094b8707591 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Thu, 26 Sep 2019 12:52:39 +0200
Subject: [PATCH] LVM-activate: move pvscan --cache to validate

It needs to be called before validate attempts to look at the VG.
---
 configure.ac           | 2 +-
 heartbeat/LVM-activate | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 97dac7cf8..1eb65cf34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,7 @@ dnl     checks for system services
 
 AC_INIT([resource-agents], 
 	m4_esyscmd([make/git-version-gen .tarball-version]),
-	[to_be_defined@foobar.org])
+	[developers@clusterlabs.org])
 
 AC_USE_SYSTEM_EXTENSIONS
 
diff --git a/heartbeat/LVM-activate b/heartbeat/LVM-activate
index 3df40c894..9b7c0aa7f 100755
--- a/heartbeat/LVM-activate
+++ b/heartbeat/LVM-activate
@@ -489,6 +489,11 @@ lvm_validate() {
 	check_binary lvm
 	check_binary dmsetup
 
+	# This is necessary when using system ID to update lvm hints,
+	# or in older versions of lvm, this is necessary to update the
+	# lvmetad cache.
+	pvscan --cache
+
 	if ! vgs --foreign ${VG} >/dev/null 2>&1 ; then
 		# stop action exits successfully if the VG cannot be accessed...
 		if [ $__OCF_ACTION = "stop" ]; then
@@ -627,7 +632,6 @@ clvmd_activate() {
 systemid_activate() {
 	local cur_systemid
 
-	pvscan --cache
 	cur_systemid=$(vgs --foreign --noheadings -o systemid ${VG} | tr -d '[:blank:]')
 
 	# Put our system ID on the VG