Blame SOURCES/bz1470840-LVM-volume_group_check_only.patch

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