upgrade resource-agents to CentOS 7.5 version

Story: 2003389
Task: 24500
Depends-On: https://review.openstack.org/#/c/595986/

Change-Id: I1d1101bf1f419fe8c4260b4b638544871b39531d
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
This commit is contained in:
zhipengl 2018-08-24 19:52:31 +08:00 committed by zhipeng liu
parent 7a1cd4ac02
commit 80480de8bc
17 changed files with 27 additions and 735 deletions

View File

@ -1,8 +1,7 @@
From 2bc73669b8de70bf32d2f786b158738506e480ff Mon Sep 17 00:00:00 2001 From 85cd40238fb1f76483848007bd1e5663bb3f21ff Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com> From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 15:11:59 -0400 Date: Mon, 2 Oct 2017 15:11:59 -0400
Subject: [PATCH 08/10] WRS: Subject: [PATCH] WRS: 0001-Update-package-versioning-for-TIS-format.patch
0001-Update-package-versioning-for-TIS-format.patch
Conflicts: Conflicts:
SPECS/resource-agents.spec SPECS/resource-agents.spec
@ -11,18 +10,18 @@ Conflicts:
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec
index 6be3418..28a8129 100644 index 21fa049..fd8bc97 100644
--- a/SPECS/resource-agents.spec --- a/SPECS/resource-agents.spec
+++ b/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
Name: resource-agents Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 3.9.5 Version: 3.9.5
-Release: 105%{?dist} -Release: 124%{?dist}
+Release: 105.el7%{?_tis_dist}.%{tis_patch_ver} +Release: 124.el7%{?_tis_dist}.%{tis_patch_ver}
License: GPLv2+, LGPLv2+ and ASL 2.0 License: GPLv2+, LGPLv2+ and ASL 2.0
URL: https://github.com/ClusterLabs/resource-agents URL: https://github.com/ClusterLabs/resource-agents
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
-- --
1.9.1 2.7.4

View File

@ -1,33 +0,0 @@
From c4165b39531872b7b56d497c4ebd86b5d1d79800 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Wed, 25 Oct 2017 16:18:02 -0400
Subject: [PATCH]
Modify-error-code-of-bz1454699-fix-to-prevent-inactive-controller-reboot-loop
---
SPECS/resource-agents.spec | 2 ++
1 file changed, 2 insertions(+)
diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec
index 19580ef..2536cb7 100644
--- a/SPECS/resource-agents.spec
+++ b/SPECS/resource-agents.spec
@@ -252,6 +252,7 @@ Patch1116: ocf-shellfuncs_change_logtag.patch
Patch1117: lvm_cleanup_refs_on_stop.patch
Patch1118: ipaddr2_if_down.patch
Patch1119: ipaddr2_ignore_lo_if_state.patch
+Patch1120: Modify-error-code-of-bz1454699-fix-to-prevent-inactive-controller-reboot-loop.patch
Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version}
@@ -561,6 +562,7 @@ exit 1
%patch1117 -p1
%patch1118 -p1
%patch1119 -p1
+%patch1120 -p1
%build
if [ ! -f configure ]; then
--
1.9.1

View File

@ -8,6 +8,5 @@ spec-lvm-cleanup-refs-on-stop.patch
0001-Update-package-versioning-for-TIS-format.patch 0001-Update-package-versioning-for-TIS-format.patch
ipaddr2-if-down.patch ipaddr2-if-down.patch
spec-add-ipaddr2-ignore-lo-state.patch spec-add-ipaddr2-ignore-lo-state.patch
Modify-error-code-of-bz1454699-fix-to-prevent-inactive-controller-reboot-loop.patch
Disable-creation-of-the-debug-package.patch Disable-creation-of-the-debug-package.patch
metapatch-for-arp_bg.patch metapatch-for-arp_bg.patch

View File

@ -1,4 +1,4 @@
From 6dc3b747b2688498a69d3ca8f826f30aecfc9f5b Mon Sep 17 00:00:00 2001 From 00b88829aad297c6732617a706501b466bb9be7a Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com> From: Al Bailey <Al.Bailey@windriver.com>
Date: Mon, 28 May 2018 14:12:45 -0500 Date: Mon, 28 May 2018 14:12:45 -0500
Subject: [PATCH] metapatch for arp_bg Subject: [PATCH] metapatch for arp_bg
@ -8,25 +8,25 @@ Subject: [PATCH] metapatch for arp_bg
1 file changed, 2 insertions(+) 1 file changed, 2 insertions(+)
diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec
index 2536cb7..5b38434 100644 index c70d20b..520d9c3 100644
--- a/SPECS/resource-agents.spec --- a/SPECS/resource-agents.spec
+++ b/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec
@@ -253,6 +253,7 @@ Patch1117: lvm_cleanup_refs_on_stop.patch @@ -282,6 +282,7 @@ Patch1116: ocf-shellfuncs_change_logtag.patch
Patch1117: lvm_cleanup_refs_on_stop.patch
Patch1118: ipaddr2_if_down.patch Patch1118: ipaddr2_if_down.patch
Patch1119: ipaddr2_ignore_lo_if_state.patch Patch1119: ipaddr2_ignore_lo_if_state.patch
Patch1120: Modify-error-code-of-bz1454699-fix-to-prevent-inactive-controller-reboot-loop.patch +Patch1120: Re-enable-background-execution-of-arp-commands.patch
+Patch1121: Re-enable-background-execution-of-arp-commands.patch
Obsoletes: heartbeat-resources <= %{version} Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version} Provides: heartbeat-resources = %{version}
@@ -563,6 +564,7 @@ exit 1 @@ -618,6 +619,7 @@ exit 1
%patch1117 -p1
%patch1118 -p1 %patch1118 -p1
%patch1119 -p1 %patch1119 -p1
%patch1120 -p1 +%patch1120 -p1
+%patch1121 -p1
%build %build
if [ ! -f configure ]; then if [ ! -f configure ]; then
-- --
1.8.3.1 2.7.4

View File

@ -1,6 +1,6 @@
From 98591b479bd64c2835ab1e8884118c57dd499b9c Mon Sep 17 00:00:00 2001 From 7c181a1afdc85456333f9cbf9c5827ceb0554a91 Mon Sep 17 00:00:00 2001
From: Chris Friesen <chris.friesen@windriver.com> From: Chris Friesen <chris.friesen@windriver.com>
Date: Tue, 21 Jun 2016 14:29:36 -0400 Date: Fri, 24 Aug 2018 03:51:37 +0800
Subject: [PATCH] Fix VG activity bug in heartbeat/LVM script Subject: [PATCH] Fix VG activity bug in heartbeat/LVM script
There is currently an issue in the lvm2 package where if you create an LVM thin There is currently an issue in the lvm2 package where if you create an LVM thin
@ -19,17 +19,20 @@ group is not active.
This commit changes the code to directly query lvm about the volume group This commit changes the code to directly query lvm about the volume group
activity rather than relying on side effects. activity rather than relying on side effects.
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
--- ---
heartbeat/LVM | 15 ++++++--------- heartbeat/LVM | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-) 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/heartbeat/LVM b/heartbeat/LVM diff --git a/heartbeat/LVM b/heartbeat/LVM
index 1c23c05..d91a3bc 100755 index 893ece8..1efb207 100755
--- a/heartbeat/LVM --- a/heartbeat/LVM
+++ b/heartbeat/LVM +++ b/heartbeat/LVM
@@ -350,19 +350,16 @@ LVM_status() { @@ -338,19 +338,16 @@ LVM_status() {
ocf_exit_reason "LVM Volume $1 is not available" fi
return $OCF_ERR_GENERIC fi
fi fi
- -
- if [ -d /dev/$1 ]; then - if [ -d /dev/$1 ]; then
@ -54,5 +57,5 @@ index 1c23c05..d91a3bc 100755
1) # exclusive with tagging. 1) # exclusive with tagging.
# If vg is running, make sure the correct tag is present. Otherwise we # If vg is running, make sure the correct tag is present. Otherwise we
-- --
1.9.1 2.7.4

View File

@ -1,27 +0,0 @@
From b9fdbdf20d62655c9b529f744f8efb9fb66c5851 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Wed, 25 Oct 2017 16:13:20 -0400
Subject: [PATCH] Modify error code of
bz1454699-LVM-status-check-for-missing-VG.patch to prevent controler-1 reboot
loop
---
heartbeat/LVM | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/heartbeat/LVM b/heartbeat/LVM
index 5347765..e4cd0ea 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -348,7 +348,7 @@ LVM_status() {
fi
if ! echo "$output" | grep -q "Found.*\"$1\""; then
ocf_exit_reason "LVM Volume $1 is not available"
- return $OCF_ERR_GENERIC
+ return $OCF_NOT_RUNNING
fi
# Ask lvm whether the volume group is active. This maps to
--
1.9.1

View File

@ -1 +1,2 @@
mirror:Source/resource-agents-3.9.5-105.el7.src.rpm mirror:Source/resource-agents-3.9.5-124.el7.src.rpm

View File

@ -1,38 +0,0 @@
---
heartbeat/Filesystem | 3 ++-
heartbeat/LVM | 1 +
heartbeat/pgsql | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
--- a/heartbeat/Filesystem
+++ b/heartbeat/Filesystem
@@ -2,7 +2,8 @@
#
# Support: linux-ha@lists.linux-ha.org
# License: GNU General Public License (GPL)
-#
+# Copyright (c) 2014 Wind River Systems, Inc. All rights reserved.
+#
# Filesystem
# Description: Manages a Filesystem on a shared storage medium.
# Original Author: Eric Z. Ayers (eric.ayers@compgen.com)
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -10,6 +10,7 @@
# Support: linux-ha@lists.linux-ha.org
# License: GNU General Public License (GPL)
# Copyright: (C) 2002 - 2005 International Business Machines, Inc.
+# Copyright (c) 2014 Wind River Systems, Inc. All rights reserved.
#
# This code significantly inspired by the LVM resource
# in FailSafe by Lars Marowsky-Bree
--- a/heartbeat/pgsql
+++ b/heartbeat/pgsql
@@ -9,6 +9,7 @@
#
# Copyright: 2006-2012 Serge Dubrouski <sergeyfd@gmail.com>
# and other Linux-HA contributors
+# Copyright (c) 2014 Wind River Systems, Inc. All rights reserved.
# License: GNU General Public License (GPL)
#
###############################################################################

View File

@ -1,15 +0,0 @@
Index: resource-agents-3.9.5/heartbeat/exportfs
===================================================================
--- resource-agents-3.9.5/heartbeat/exportfs 2013-02-07 07:17:42.000000000 -0500
+++ resource-agents-3.9.5/heartbeat/exportfs 2015-12-18 12:40:18.382930869 -0500
@@ -184,7 +184,9 @@
is_exported() {
local dir=$1
- local spec=$2
+ # Because clientspec contains square brackets when using IPv6, and the exports entry does not,
+ # it is necessary to remove the square brackets to compare them with each other.
+ local spec=$(echo $2|sed -r 's/(\[|\])//g')
exportfs |
sed -e '$! N; s/\n[[:space:]]\+/ /; t; s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' |
grep -q -x -F "$dir $spec"

View File

@ -1,193 +0,0 @@
---
heartbeat/Filesystem | 59 ++++++++++++++++++++++++++++++++++++++++++++++++---
heartbeat/LVM | 59 +++++++++++++++++++++++++++++++++++++++++++++++----
2 files changed, 111 insertions(+), 7 deletions(-)
--- a/heartbeat/Filesystem
+++ b/heartbeat/Filesystem
@@ -19,6 +19,7 @@
# OCF_RESKEY_run_fsck
# OCF_RESKEY_fast_stop
# OCF_RESKEY_force_clones
+# OCF_RESKEY_rmon_rsc_name
#
#OCF_RESKEY_device : name of block device for the filesystem. e.g. /dev/sda1, /dev/md0
# Or a -U or -L option for mount, or an NFS mount specification
@@ -30,6 +31,7 @@
#OCF_RESKEY_fast_stop : fast stop: yes(default)/no
#OCF_RESKEY_force_clones : allow running the resource as clone. e.g. local xfs mounts
# for each brick in a glusterfs setup
+#OCF_RESKEY_rmon_rsc_name: resource name to use when notifing RMON
#
#
# This assumes you want to manage a filesystem on a shared (SCSI) bus,
@@ -1053,20 +1055,65 @@ if [ "$OP" != "monitor" ]; then
ocf_log info "Running $OP for $DEVICE on $MOUNTPOINT"
fi
+RMON_NOTIFY="/usr/local/bin/rmon_resource_notify"
+
+rmon_notify() {
+ local RSC_STATE=$1 TIMEOUT=$2
+
+ if [ -z "OCF_RESKEY_rmon_rsc_name" ]
+ then
+ ocf_log err "No RMON resource name given for $OCF_RESKEY_directory"
+ return
+ fi
+
+ if [[ -x $RMON_NOTIFY ]]
+ then
+ $RMON_NOTIFY --resource-name $OCF_RESKEY_rmon_rsc_name \
+ --resource-state $RSC_STATE \
+ --resource-type mount \
+ --device $OCF_RESKEY_device \
+ --mount-point $OCF_RESKEY_directory \
+ --timeout $TIMEOUT \
+ >/dev/null 2>&1
+ else
+ ocf_log err "$RMON_NOTIFY not available, failed to execute: \
+$RMON_NOTIFY --resource-name $OCF_RESKEY_rmon_rsc_name \
+--resource-state $RSC_STATE --resource-type mount \
+--device $OCF_RESKEY_device --mount-point $OCF_RESKEY_directory \
+--timeout $TIMEOUT"
+ fi
+}
+
# These operations do not require the clone checking + OCFS2
# initialization.
case $OP in
status) Filesystem_status
- exit $?
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc
;;
monitor) Filesystem_monitor
- exit $?
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc
;;
validate-all) Filesystem_validate_all
exit $?
;;
stop) Filesystem_stop
- exit $?
+ rc=$?
+ rmon_notify "disabled" 300
+ exit $rc
;;
esac
@@ -1114,6 +1161,12 @@ fi
case $OP in
start) Filesystem_start
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ fi
+ exit $rc
;;
notify) Filesystem_notify
;;
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -22,6 +22,7 @@
#
# OCF parameters are as below:
# OCF_RESKEY_volgrpname
+# OCF_RESKEY_rmon_rsc_name
#
#######################################################################
# Initialization:
@@ -311,6 +312,35 @@ then
exit $OCF_ERR_CONFIGURED
fi
+RMON_NOTIFY="/usr/local/bin/rmon_resource_notify"
+
+rmon_notify() {
+ local RSC_STATE=$1 TIMEOUT=$2
+
+ if [ -z "OCF_RESKEY_rmon_rsc_name" ]
+ then
+ ocf_log err "No RMON resource name given for $OCF_RESKEY_volgrpname"
+ return
+ fi
+
+ if [[ -x $RMON_NOTIFY ]]
+ then
+ $RMON_NOTIFY --resource-name $OCF_RESKEY_rmon_rsc_name \
+ --resource-state $RSC_STATE \
+ --resource-type lvg \
+ --volume-group $OCF_RESKEY_volgrpname \
+ --timeout $TIMEOUT \
+ >/dev/null 2>&1
+ else
+ ocf_log err "$RMON_NOTIFY not available, failed to execute: \
+$RMON_NOTIFY --resource-name $OCF_RESKEY_rmon_rsc_name \
+--resource-state $RSC_STATE --resource-type lvg \
+--volume-group $OCF_RESKEY_volgrpname \
+--timeout $TIMEOUT"
+ fi
+}
+
+
# Get the LVM version number, for this to work we assume(thanks to panjiam):
#
# LVM1 outputs like this
@@ -345,16 +375,37 @@ OP_METHOD=$1
case "$1" in
start) LVM_start $VOLUME
- exit $?;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ fi
+ exit $rc;;
stop) LVM_stop $VOLUME
- exit $?;;
+ rc=$?
+ rmon_notify "disabled" 300
+ exit $rc;;
status) LVM_status $VOLUME $1
- exit $?;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc;;
monitor) LVM_monitor $VOLUME
- exit $?;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc;;
validate-all) LVM_validate_all
;;

View File

@ -1,37 +0,0 @@
---
heartbeat/IPaddr2 | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -13,6 +13,7 @@
# Copyright (c) 2003 Tuomo Soini
# Copyright (c) 2004-2006 SUSE LINUX AG, Lars Marowsky-Brée
# All Rights Reserved.
+# Copyright (c) 2014 Wind River Systems, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
@@ -50,6 +51,7 @@
# OCF_RESKEY_nic
# OCF_RESKEY_cidr_netmask
# OCF_RESKEY_iflabel
+# OCF_RESKEY_if_type
# OCF_RESKEY_mac
# OCF_RESKEY_clusterip_hash
# OCF_RESKEY_arp_interval
@@ -314,7 +316,13 @@ ip_init() {
BASEIP="$OCF_RESKEY_ip"
BRDCAST="$OCF_RESKEY_broadcast"
- NIC="$OCF_RESKEY_nic"
+ IFTYPE="$OCF_RESKEY_if_type"
+ if [ -n "${IFTYPE}" ]
+ then
+ NIC=`grep ${IFTYPE}= /etc/platform/platform.conf | cut -f2 -d '='`
+ else
+ NIC="$OCF_RESKEY_nic"
+ fi
# Note: We had a version out there for a while which used
# netmask instead of cidr_netmask. Don't remove this aliasing code!
if

View File

@ -1,48 +0,0 @@
---
heartbeat/IPaddr2 | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -661,7 +661,12 @@ ip_start() {
local ip_status=`ip_served`
if [ "$ip_status" = "ok" ]; then
- exit $OCF_SUCCESS
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ then
+ exit $OCF_SUCCESS
+ else
+ exit $OCF_ERR_GENERIC
+ fi
fi
if [ -n "$IP_CIP" ] && [ $ip_status = "no" ] || [ $ip_status = "partial2" ]; then
@@ -714,7 +719,12 @@ ip_start() {
fi
;;
esac
- exit $OCF_SUCCESS
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ then
+ exit $OCF_SUCCESS
+ else
+ exit $OCF_ERR_GENERIC
+ fi
}
ip_stop() {
@@ -788,7 +798,12 @@ ip_monitor() {
local ip_status=`ip_served`
case $ip_status in
ok)
- return $OCF_SUCCESS
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ then
+ return $OCF_SUCCESS
+ else
+ return $OCF_NOT_RUNNING
+ fi
;;
partial|no|partial2)
exit $OCF_NOT_RUNNING

View File

@ -1,155 +0,0 @@
commit 69217b67c0d018f129c7cbf526aebf0b236be701
Author: Chris Friesen <chris.friesen@windriver.com>
Date: Thu Sep 17 15:26:16 2015 -0400
CGCS-2553/CGTS-2534: tweak LVM success criteria
It turns out that activating an LVM LV which has a snapshot (or activating
the snapshot) will take an amount of time that is proportional to the
delta between the snapshot and the original volume.
Because of this it's possible that running "vgchange" could take a long
time, since it also activates the LVs.
If this happens, rather than timeout the whole script we want to log which
LVs/snapshots havn't yet been activated, and then just continue on.
Accordingly, we want to set the internal timeout in the "start" operation
to something less than the timeout for the "start" action.
There will be corresponding changes in cinder to properly handle this case.
diff --git a/heartbeat/LVM b/heartbeat/LVM
index bd1a47a..24b0244 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -186,6 +186,81 @@ LVM_monitor() {
}
#
+# Activate one volume explicitly.
+#
+activate_volume() {
+ ocf_run lvchange $1 /dev/${2}/$3
+ if [ $? -eq 0 ] ; then
+ ocf_log info "Succesfully activated $LV."
+ else
+ ocf_log err "Problem activating $LV."
+ fi
+}
+
+#
+# Kick off parallel activation of all volumes
+#
+activate_all_volumes() {
+ VG=$1
+ shift
+ lvchange_args="$*"
+
+ # Get the list of volumes, without the first line which is column headings.
+ VOLS=`lvs $VG |tail -n +2`
+
+ while read -r LINE; do
+ # Convert the line into an array.
+ LINE_ARRAY=($LINE)
+
+ # First array element is the volume/snapshot name.
+ LV=${LINE_ARRAY[0]}
+
+ # Third array element is the attributes.
+ ATTR=${LINE_ARRAY[2]}
+
+ # Fifth character in the attributes is "a" if it's active.
+ ACTIVE=${ATTR:4:1}
+ if [ "$ACTIVE" == "a" ]; then
+ ocf_log info "$LV is already active."
+ continue
+ fi
+
+ SNAPSHOT_ORIGIN=${LINE_ARRAY[4]}
+ if [ "$SNAPSHOT_ORIGIN" != "" ] ; then
+ # If this is a snapshot, don't activate it.
+ continue
+ fi
+
+ ( activate_volume "$*" $VG $LV ) &
+ done <<< "$VOLS"
+}
+
+#
+# Scan for inactive volumes and log any that are found.
+#
+log_inactive_volumes() {
+ # Get the list of volumes, without the first line which is column headings.
+ VOLS=`lvs $1 |tail -n +2`
+
+ while read -r LINE; do
+ # Convert the line into an array.
+ LINE_ARRAY=($LINE)
+
+ # First array element is the volume/snapshot name.
+ LV=${LINE_ARRAY[0]}
+
+ # Third array element is the attributes.
+ ATTR=${LINE_ARRAY[2]}
+
+ # Fifth character in the attributes is "a" if it's active.
+ ACTIVE=${ATTR:4:1}
+ if [ "$ACTIVE" != "a" ]; then
+ ocf_log err "Volume $LV is not active after expiry of timeout."
+ fi
+ done <<< "$VOLS"
+}
+
+#
# Enable LVM volume
#
LVM_start() {
@@ -218,7 +293,47 @@ LVM_start() {
vgchange_options="$vgchange_options --monitor y"
fi
- ocf_run vgchange $vgchange_options $1 || return $OCF_ERR_GENERIC
+ # Kick off activation of all volumes. If it doesn't complete within
+ # the timeout period, then we'll log the not-yet-activated volumes and
+ # continue on.
+ (ocf_run vgchange $vgchange_options $1) & PID=$!
+
+ # Check every second for up to TIMEOUT seconds whether the vgchange has
+ # completed.
+ TIMEOUT=300
+ TIMED_OUT=true
+ SECONDS=0;
+ PARALLEL_ACTIVATE_DELAY=10
+ PARALLEL_ACTIVATE_DONE=false
+ while [ $SECONDS -lt $TIMEOUT ] ; do
+ kill -0 $PID &> /dev/null
+ if [ $? -eq 1 ] ; then
+ # process with pid of $PID doesn't exist, vgchange command completed
+ TIMED_OUT=false
+ break
+ fi
+ if [ $SECONDS -ge $PARALLEL_ACTIVATE_DELAY ] && \
+ [ "$PARALLEL_ACTIVATE_DONE" != true ] && \
+ [ "$1" == "cinder-volumes" ] ; then
+ # This will kick off parallel activation of all LVs in the VG.
+ # The delay is to ensure the VG is activated first.
+ PARALLEL_ACTIVATE_DONE=true
+ ocf_log info Explicitly activating all volumes in $1 with: $vgchange_options
+ activate_all_volumes $1 $vgchange_options
+ fi
+ sleep 1
+ done
+
+ if [ "$TIMED_OUT" = true ] ; then
+ ocf_log err "Timed out running ocf_run vgchange $vgchange_options $1"
+ log_inactive_volumes $1
+ else
+ # Child process completed, get its status.
+ wait $PID
+ if [ $? -ne 0 ] ; then
+ return $OCF_ERR_GENERIC
+ fi
+ fi
if LVM_status $1; then
: OK Volume $1 activated just fine!

View File

@ -1,52 +0,0 @@
---
heartbeat/ocf-returncodes | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
--- a/heartbeat/ocf-returncodes
+++ b/heartbeat/ocf-returncodes
@@ -5,6 +5,7 @@
# Copyright (c) 2004 SUSE LINUX AG, Andrew Beekhof
# All Rights Reserved.
#
+# Copyright (c) 2014 Wind River Systems, Inc. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -53,3 +54,37 @@ OCF_NOT_RUNNING=7
#
OCF_RUNNING_MASTER=8
OCF_FAILED_MASTER=9
+
+# Non-standard values particular to Wind River deployments.
+#
+# OCF does not include the concept of data sync states for master/slave
+# resources.
+#
+# OCF_DATA_INCONSISTENT:
+# The resource's data is not useable.
+#
+# OCF_DATA_OUTDATED:
+# The resource's data is consistent, but a peer with more recent data
+# has been seen.
+#
+# OCF_DATA_CONSISTENT:
+# The resource's data is consistent, but it is unsure that this is the
+# most recent data.
+#
+# OCF_SYNC:
+# The resource is syncing data.
+#
+# OCF_STANDALONE:
+# The resource is operating as standalone. No peer is available or
+# syncing is not possible (i.e. split brain fencing).
+#
+OCF_DATA_INCONSISTENT=32
+OCF_DATA_OUTDATED=33
+OCF_DATA_CONSISTENT=34
+OCF_DATA_SYNC=35
+OCF_DATA_STANDALONE=36
+OCF_RUNNING_MASTER_DATA_INCONSISTENT=37
+OCF_RUNNING_MASTER_DATA_OUTDATED=38
+OCF_RUNNING_MASTER_DATA_CONSISTENT=39
+OCF_RUNNING_MASTER_DATA_SYNC=40
+OCF_RUNNING_MASTER_DATA_STANDALONE=41

View File

@ -1,18 +0,0 @@
---
heartbeat/ocf-shellfuncs.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/heartbeat/ocf-shellfuncs.in
+++ b/heartbeat/ocf-shellfuncs.in
@@ -174,9 +174,9 @@ hadate() {
set_logtag() {
if [ -z "$HA_LOGTAG" ]; then
if [ -n "$OCF_RESOURCE_INSTANCE" ]; then
- HA_LOGTAG="$__SCRIPT_NAME($OCF_RESOURCE_INSTANCE)[$$]"
+ HA_LOGTAG="OCF_$__SCRIPT_NAME($OCF_RESOURCE_INSTANCE)[$$]"
else
- HA_LOGTAG="$__SCRIPT_NAME[$$]"
+ HA_LOGTAG="OCF_$__SCRIPT_NAME[$$]"
fi
fi
}

View File

@ -1,77 +0,0 @@
Index: resource-agents-3.9.5/heartbeat/pgsql
===================================================================
--- resource-agents-3.9.5.orig/heartbeat/pgsql
+++ resource-agents-3.9.5/heartbeat/pgsql
@@ -38,6 +38,7 @@ get_pgsql_param() {
OCF_RESKEY_pgctl_default=/usr/bin/pg_ctl
OCF_RESKEY_psql_default=/usr/bin/psql
OCF_RESKEY_pgdata_default=/var/lib/pgsql/data
+OCF_RESKEY_pgconf_default=/etc/postgresql
OCF_RESKEY_pgdba_default=postgres
OCF_RESKEY_pghost_default=""
OCF_RESKEY_pgport_default=5432
@@ -67,10 +68,11 @@ OCF_RESKEY_stop_escalate_in_slave_defaul
: ${OCF_RESKEY_pgctl=${OCF_RESKEY_pgctl_default}}
: ${OCF_RESKEY_psql=${OCF_RESKEY_psql_default}}
: ${OCF_RESKEY_pgdata=${OCF_RESKEY_pgdata_default}}
+: ${OCF_RESKEY_pgconf=${OCF_RESKEY_pgconf_default}}
: ${OCF_RESKEY_pgdba=${OCF_RESKEY_pgdba_default}}
: ${OCF_RESKEY_pghost=${OCF_RESKEY_pghost_default}}
: ${OCF_RESKEY_pgport=${OCF_RESKEY_pgport_default}}
-: ${OCF_RESKEY_config=${OCF_RESKEY_pgdata}/postgresql.conf}
+: ${OCF_RESKEY_config=${OCF_RESKEY_pgconf}/postgresql.conf}
: ${OCF_RESKEY_start_opt=${OCF_RESKEY_start_opt_default}}
: ${OCF_RESKEY_pgdb=${OCF_RESKEY_pgdb_default}}
: ${OCF_RESKEY_logfile=${OCF_RESKEY_logfile_default}}
@@ -166,6 +168,14 @@ Path to PostgreSQL data directory.
<content type="string" default="${OCF_RESKEY_pgdata_default}" />
</parameter>
+<parameter name="pgconf" unique="0" required="0">
+<longdesc lang="en">
+Path to PostgreSQL config directory.
+</longdesc>
+<shortdesc lang="en">pgconf</shortdesc>
+<content type="string" default="${OCF_RESKEY_pgconf_default}" />
+</parameter>
+
<parameter name="pgdba" unique="0" required="0">
<longdesc lang="en">
User that owns PostgreSQL.
@@ -220,7 +230,7 @@ SQL script that will be used for monitor
Path to the PostgreSQL configuration file for the instance.
</longdesc>
<shortdesc lang="en">Configuration file</shortdesc>
-<content type="string" default="${OCF_RESKEY_pgdata}/postgresql.conf" />
+<content type="string" default="${OCF_RESKEY_pgconf}/postgresql.conf" />
</parameter>
<parameter name="pgdb" unique="0" required="0">
@@ -475,6 +485,12 @@ pgsql_real_start() {
local postgres_options
local rc
+ # WRS: Create an unversioned symlink under /var/run so SM can easily
+ # find the PID file.
+ if [ ! -h $PIDFILE_SYMLINK ]; then
+ /bin/ln -s $PIDFILE $PIDFILE_SYMLINK
+ fi
+
if pgsql_status; then
ocf_log info "PostgreSQL is already running. PID=`cat $PIDFILE`"
if is_replication; then
@@ -1717,12 +1733,12 @@ then
exit $OCF_ERR_GENERIC
fi
-
PIDFILE=${OCF_RESKEY_pgdata}/postmaster.pid
+PIDFILE_SYMLINK=/var/run/postmaster.pid
BACKUPLABEL=${OCF_RESKEY_pgdata}/backup_label
RESOURCE_NAME=`echo $OCF_RESOURCE_INSTANCE | cut -d ":" -f 1`
PGSQL_WAL_RECEIVER_STATUS_ATTR="${RESOURCE_NAME}-receiver-status"
-RECOVERY_CONF=${OCF_RESKEY_pgdata}/recovery.conf
+RECOVERY_CONF=${OCF_RESKEY_pgconf}/recovery.conf
NODENAME=`uname -n | tr '[A-Z]' '[a-z]'`
if is_replication; then

View File

@ -1,17 +0,0 @@
---
heartbeat/Filesystem | 4 ++++
1 file changed, 4 insertions(+)
--- a/heartbeat/Filesystem
+++ b/heartbeat/Filesystem
@@ -727,6 +727,10 @@ signal_processes() {
}
try_umount() {
local SUB=$1
+
+ # We need to ensure we umount in namespaces, too
+ /usr/sbin/umount-in-namespace $SUB
+
$UMOUNT $umount_force $SUB
list_mounts | grep -q " $SUB " >/dev/null 2>&1 || {
ocf_log info "unmounted $SUB successfully"