Blame SOURCES/bz1470840-LVM-volume_group_check_only.patch

7b144c
From c414259728610f95243d9e34289fefd596b0ac8b Mon Sep 17 00:00:00 2001
7b144c
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
7b144c
Date: Fri, 22 Jun 2018 15:37:36 +0200
7b144c
Subject: [PATCH] LVM: add "volume_group_check_only" parameter to avoid
7b144c
 timeouts in some cases
7b144c
7b144c
---
7b144c
 heartbeat/LVM        | 10 ++++++++++
7b144c
 heartbeat/lvm-tag.sh | 24 +++++++++++++-----------
7b144c
 2 files changed, 23 insertions(+), 11 deletions(-)
7b144c
7b144c
diff --git a/heartbeat/LVM b/heartbeat/LVM
7b144c
index d3cd1a14..10f7186d 100755
7b144c
--- a/heartbeat/LVM
7b144c
+++ b/heartbeat/LVM
7b144c
@@ -103,6 +103,16 @@ logical volumes.
7b144c
 <content type="string" default="false" />
7b144c
 </parameter>
7b144c
 
7b144c
+<parameter name="volume_group_check_only" unique="0" required="0">
7b144c
+<longdesc lang="en">
7b144c
+If set, only the volume group will be checked during monitoring.
7b144c
+
7b144c
+WARNING: ONLY USE IF YOU HAVE ISSUES WITH TIMEOUTS!
7b144c
+</longdesc>
7b144c
+<shortdesc lang="en">Only check volume group during monitoring</shortdesc>
7b144c
+<content type="string" default="false" />
7b144c
+</parameter>
7b144c
+
7b144c
 </parameters>
7b144c
 
7b144c
 <actions>
7b144c
diff --git a/heartbeat/lvm-tag.sh b/heartbeat/lvm-tag.sh
7b144c
index 71f53b20..170426e8 100644
7b144c
--- a/heartbeat/lvm-tag.sh
7b144c
+++ b/heartbeat/lvm-tag.sh
7b144c
@@ -160,19 +160,21 @@ lvm_validate_all() {
7b144c
 lvm_status() {
7b144c
 	local rc=0
7b144c
 
7b144c
-	# If vg is running, make sure the correct tag is present. Otherwise we
7b144c
-	# can not guarantee exclusive activation.
7b144c
-	if ! check_tags; then
7b144c
-		ocf_exit_reason "WARNING: $OCF_RESKEY_volgrpname is active without the cluster tag, \"$OUR_TAG\""
7b144c
-		rc=$OCF_ERR_GENERIC
7b144c
-	fi
7b144c
+	if ! ocf_is_true "$OCF_RESKEY_volume_group_check_only"; then
7b144c
+		# If vg is running, make sure the correct tag is present. Otherwise we
7b144c
+		# can not guarantee exclusive activation.
7b144c
+		if ! check_tags; then
7b144c
+			ocf_exit_reason "WARNING: $OCF_RESKEY_volgrpname is active without the cluster tag, \"$OUR_TAG\""
7b144c
+			rc=$OCF_ERR_GENERIC
7b144c
+		fi
7b144c
 
7b144c
-	# make sure the environment for tags activation is still valid
7b144c
-	if ! verify_tags_environment; then
7b144c
-		rc=$OCF_ERR_GENERIC
7b144c
+		# make sure the environment for tags activation is still valid
7b144c
+		if ! verify_tags_environment; then
7b144c
+			rc=$OCF_ERR_GENERIC
7b144c
+		fi
7b144c
+		# let the user know if their initrd is older than lvm.conf.
7b144c
+		check_initrd_warning
7b144c
 	fi
7b144c
-	# let the user know if their initrd is older than lvm.conf.
7b144c
-	check_initrd_warning
7b144c
 
7b144c
 	return $rc
7b144c
 }
7b144c
-- 
7b144c
2.17.1
7b144c