cluster: RHEL58 - Fix for rhbz769731 - HA LVM failure to remove tag thwarts service relocation

Jonathan Brassow jbrassow at fedoraproject.org
Mon Jan 9 23:13:29 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d2a549268e462cc884622494b21325279087d813
Commit:        d2a549268e462cc884622494b21325279087d813
Parent:        0929325f4c245d94df5e1fed06d5a2c44f0668fd
Author:        Jonathan Brassow <jbrassow at redhat.com>
AuthorDate:    Mon Jan 9 17:05:52 2012 -0600
Committer:     Jonathan Brassow <jbrassow at redhat.com>
CommitterDate: Mon Jan 9 17:05:52 2012 -0600

Fix for rhbz769731 - HA LVM failure to remove tag thwarts service relocation

A change in the behaviour of handling missing PVs by LVM has necessitated
an update to the HA LVM scripts.  Without the update, a failed PV remains
in the VG until it is removed via 'vgreduce'.  Since no updates to the metadata
can happen while the VG is in this state, the "tags" used by HA LVM cannot be
removed and relocation cannot take place.
---
 rgmanager/src/resources/lvm_by_lv.sh |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/rgmanager/src/resources/lvm_by_lv.sh b/rgmanager/src/resources/lvm_by_lv.sh
index da15a15..966214f 100644
--- a/rgmanager/src/resources/lvm_by_lv.sh
+++ b/rgmanager/src/resources/lvm_by_lv.sh
@@ -238,7 +238,19 @@ lv_activate_and_tag()
 		lvchange --deltag $tag $lv_path
 		if [ $? -ne 0 ]; then
 			ocf_log err "Unable to delete tag from $lv_path"
-			return $OCF_ERR_GENERIC
+
+			# Newer versions of LVM require the missing PVs to
+			# be removed from the VG via a separate call before
+			# the tag can be removed.
+			ocf_log err "Attempting volume group clean-up and retry"
+			vgreduce --removemissing --force $OCF_RESKEY_vg_name
+
+			# Retry tag deletion
+			lvchange --deltag $tag $lv_path
+			if [ $? -ne 0 ]; then
+				ocf_log err "Failed to delete tag from $lv_path"
+				return $OCF_ERR_GENERIC
+			fi
 		fi
 
 		if [ `lvs --noheadings -o lv_tags $lv_path` == $tag ]; then


More information about the cluster-commits mailing list