Merge "rebase resource-agents patch to CentOS 7.6 version" into f/centos76

This commit is contained in:
Zuul 2019-01-15 01:58:51 +00:00 committed by Gerrit Code Review
commit 81977810aa
21 changed files with 285 additions and 342 deletions

View File

@ -1 +1 @@
TIS_PATCH_VER=12
TIS_PATCH_VER=0

View File

@ -11,13 +11,13 @@ diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec
index 21fa049..fd8bc97 100644
--- a/SPECS/resource-agents.spec
+++ b/SPECS/resource-agents.spec
@@ -48,7 +48,7 @@
@@ -89,7 +89,7 @@
Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 3.9.5
-Release: 124%{?dist}
+Release: 124.el7%{?_tis_dist}.%{tis_patch_ver}
License: GPLv2+, LGPLv2+ and ASL 2.0
Version: 4.1.1
-Release: 12%{?dist}.7
+Release: 12.el7_6.7%{?_tis_dist}.%{tis_patch_ver}
License: GPLv2+ and LGPLv2+ and ASL 2.0
URL: https://github.com/ClusterLabs/resource-agents
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
--

View File

@ -20,7 +20,7 @@ index 2536cb7..e5fbbeb 100644
+%define debug_package %{nil}
+
%global upstream_prefix ClusterLabs-resource-agents
%global upstream_version 5434e96
%global upstream_version e711383f
--
1.8.3.1

View File

@ -12,7 +12,7 @@ diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec
index ec85fc2..bb96485 100644
--- a/SPECS/resource-agents.spec
+++ b/SPECS/resource-agents.spec
@@ -723,14 +723,11 @@ rm -rf %{buildroot}
@@ -725,14 +725,11 @@ rm -rf %{buildroot}
%endif
%if %{with linuxha}
@ -31,7 +31,7 @@ index ec85fc2..bb96485 100644
%if %{with rgmanager}
/usr/lib/ocf/resource.d/redhat
%endif
@@ -753,8 +750,6 @@ rm -rf %{buildroot}
@@ -758,8 +755,6 @@ rm -rf %{buildroot}
%{_includedir}/heartbeat
@ -40,7 +40,7 @@ index ec85fc2..bb96485 100644
%{_mandir}/man7/*.7*
###
@@ -864,7 +859,6 @@ rm -rf %{buildroot}
@@ -912,7 +907,6 @@ rm -rf %{buildroot}
%exclude %{_mandir}/man8/ldirectord.8.gz
# For compatability with pre-existing agents

View File

@ -5,18 +5,18 @@ Subject: [PATCH] WRS: spec-include-TiS-patches.patch
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
---
SPECS/resource-agents.spec | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
SPECS/resource-agents.spec | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec
index a16660a..ec85fc2 100644
--- a/SPECS/resource-agents.spec
+++ b/SPECS/resource-agents.spec
@@ -263,6 +263,25 @@ Patch202: bz1536548-sap_redhat_cluster_connector-fix-unknown-gvi-function.patch
Patch203: bz1543366-redis-add-support-for-tunneling-replication-traffic.patch
Patch204: bz1546083-galera-fix-temp-logfile-rights.patch
@@ -148,6 +148,24 @@ Patch1002: bz1568588-9-google-cloud-sdk-oauth2client-python-rsa-to-cryptography.
Patch1003: bz1568588-10-gcloud-support-info.patch
Patch1004: bz1568589-4-aliyun-vpc-move-ip-bundled.patch
+# WRS
+# STX
+Patch1105: filesystem_rmon.patch
+Patch1106: new_ocf_return_codes.patch
+Patch1107: ipaddr2_check_if_state.patch
@ -32,17 +32,16 @@ index a16660a..ec85fc2 100644
+Patch1117: lvm_cleanup_refs_on_stop.patch
+Patch1118: ipaddr2_if_down.patch
+Patch1119: ipaddr2_ignore_lo_if_state.patch
+Patch1120: Re-enable-background-execution-of-arp-commands.patch
+Patch1121: ipaddr2-avoid-failing-svc-if-down.patch
+Patch1122: ipaddr2-use-host-scope-for-addresses-on-loopback.patch
Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version}
@@ -582,6 +601,26 @@ exit 1
%patch203 -p1
%patch204 -p1
@@ -508,6 +526,25 @@ cp %{aliyuncli_dir}/LICENSE %{aliyuncli}_LICENSE
%patch1004 -p1
%endif
+# WRS
+# STX
+%patch1105 -p1
+%patch1106 -p1
+%patch1107 -p1
@ -58,7 +57,6 @@ index a16660a..ec85fc2 100644
+%patch1117 -p1
+%patch1118 -p1
+%patch1119 -p1
+%patch1120 -p1
+%patch1121 -p1
+%patch1122 -p1
+

View File

@ -30,11 +30,10 @@ diff --git a/heartbeat/LVM b/heartbeat/LVM
index 893ece8..1efb207 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -338,19 +338,16 @@ LVM_status() {
fi
@@ -191,18 +191,15 @@ LVM_status() {
fi
fi
-
- if [ -d /dev/$1 ]; then
- test "`cd /dev/$1 && ls`" != ""
- rc=$?
@ -42,7 +41,7 @@ index 893ece8..1efb207 100755
- ocf_exit_reason "VG $1 with no logical volumes is not supported by this RA!"
- fi
- fi
-
- if [ $rc -ne 0 ]; then
+ # Ask lvm whether the volume group is active. This maps to
+ # the question "Are there any logical volumes that are active in
@ -53,9 +52,9 @@ index 893ece8..1efb207 100755
rc=$OCF_NOT_RUNNING
else
+ rc=0
case $(get_vg_mode) in
1) # exclusive with tagging.
# If vg is running, make sure the correct tag is present. Otherwise we
lvm_status
rc=$?
fi
--
2.7.4

View File

@ -1,36 +0,0 @@
From 9cdb2de3b5f1d08d74a762cfda2ade16692ef9db Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Mon, 28 May 2018 14:09:47 -0500
Subject: [PATCH] WRS. Re-enable background execution of arp commands.
Typical ARP commands are taking 6 seconds due to no responses back after 7 attempts.
This change allows that delay to be backgrounded
---
heartbeat/IPaddr2 | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
index 59620d2..86009b9 100755
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -719,12 +719,13 @@ run_send_arp() {
if [ $ARP_COUNT -ne 0 ] ; then
ARGS="-i $OCF_RESKEY_arp_interval -c $ARP_COUNT -p $SENDARPPIDFILE -I $NIC -m $MY_MAC $OCF_RESKEY_ip"
ocf_log $LOGLEVEL "$SENDARP $ARGS"
- output=$($SENDARP $ARGS 2>&1)
+ if ocf_is_true $OCF_RESKEY_arp_bg; then
+ ($SENDARP $ARGS || ocf_log err "Could not send gratuitous arps")& >&2
+ else
+ $SENDARP $ARGS || ocf_log err "Could not send gratuitous arps"
+ fi
rc=$?
if [ $rc -ne $OCF_SUCCESS ]; then
- if ! ocf_is_true $OCF_RESKEY_arp_bg; then
- ocf_log err "send_arp output: $output"
- fi
ocf_exit_reason "Could not send gratuitous arps"
exit $OCF_ERR_GENERIC
fi
--
1.8.3.1

View File

@ -15,7 +15,7 @@ index 27f03d2..af821b2 100755
+++ b/heartbeat/Filesystem
@@ -2,6 +2,8 @@
#
# Support: linux-ha@lists.linux-ha.org
# Support: users@clusterlabs.org
# License: GNU General Public License (GPL)
+#
+# Copyright (c) 2014 Wind River Systems, Inc. All rights reserved.
@ -27,7 +27,7 @@ index e435e7b..c11fed7 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -10,6 +10,7 @@
# Support: linux-ha@lists.linux-ha.org
# Support: users@clusterlabs.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.
@ -38,7 +38,7 @@ diff --git a/heartbeat/pgsql b/heartbeat/pgsql
index 794f85e..b176b1d 100755
--- a/heartbeat/pgsql
+++ b/heartbeat/pgsql
@@ -9,6 +9,7 @@
@@ -10,6 +10,7 @@
#
# Copyright: 2006-2012 Serge Dubrouski <sergeyfd@gmail.com>
# and other Linux-HA contributors

View File

@ -16,7 +16,7 @@ index d834096..8cd9c6b 100755
# OCF_RESKEY_run_fsck
# OCF_RESKEY_fast_stop
# OCF_RESKEY_force_clones
+# OCF_RESKEY_rmon_rsc_name
+# 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
@ -28,7 +28,7 @@ index d834096..8cd9c6b 100755
#
#
# This assumes you want to manage a filesystem on a shared (SCSI) bus,
@@ -1137,20 +1139,65 @@ if [ "$OP" != "monitor" ]; then
@@ -822,18 +824,63 @@ if [ "$OP" != "monitor" ]; then
ocf_log info "Running $OP for $DEVICE on $MOUNTPOINT"
fi
@ -61,55 +61,53 @@ index d834096..8cd9c6b 100755
+ 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
+ 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
+ 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
+ rc=$?
+ rmon_notify "disabled" 300
+ exit $rc
;;
esac
@@ -1199,6 +1246,12 @@ fi
@@ -879,6 +926,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
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ fi
+ exit $rc
;;
*) usage
exit $OCF_ERR_UNIMPLEMENTED
diff --git a/heartbeat/LVM b/heartbeat/LVM
index 425a60a..ba6c198 100755
--- a/heartbeat/LVM
@ -118,11 +116,11 @@ index 425a60a..ba6c198 100755
#
# OCF parameters are as below:
# OCF_RESKEY_volgrpname
+# OCF_RESKEY_rmon_rsc_name
+# OCF_RESKEY_rmon_rsc_name
#
#######################################################################
# Initialization:
@@ -699,6 +700,34 @@ then
@@ -406,6 +407,34 @@ then
exit $OCF_ERR_CONFIGURED
fi
@ -157,45 +155,45 @@ index 425a60a..ba6c198 100755
# Get the LVM version number, for this to work we assume(thanks to panjiam):
#
# LVM1 outputs like this
@@ -740,16 +769,37 @@ case "$1" in
@@ -449,16 +478,37 @@ case "$1" in
start)
LVM_validate_all
LVM_start $VOLUME
- exit $?;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ fi
+ exit $rc;;
+ 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;;
+ 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;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc;;
monitor) LVM_status $VOLUME
- exit $?;;
+ rc=$?
+ if [ $rc -eq $OCF_SUCCESS ]
+ then
+ rmon_notify "enabled" 300
+ else
+ rmon_notify "disabled" 300
+ fi
+ exit $rc;;
+ 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

@ -11,49 +11,49 @@ diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
index 86009b9..2da5c5e 100755
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -885,12 +885,8 @@ ip_start() {
then
exit $OCF_SUCCESS
else
- if [ "$OCF_RESKEY_dc" = "yes" ]; then
- ocf_log info "NIC $NIC is DOWN..."
- exit $OCF_SUCCESS
- else
- exit $OCF_ERR_GENERIC
- fi
+ ocf_log info "NIC $NIC is DOWN..."
+ exit $OCF_SUCCESS
fi
@@ -968,12 +968,8 @@ ip_start() {
then
exit $OCF_SUCCESS
else
- if [ "$OCF_RESKEY_dc" = "yes" ]; then
- ocf_log info "NIC $NIC is DOWN..."
- exit $OCF_SUCCESS
- else
- exit $OCF_ERR_GENERIC
- fi
+ ocf_log info "NIC $NIC is DOWN..."
+ exit $OCF_SUCCESS
fi
fi
@@ -954,12 +950,8 @@ ip_start() {
then
exit $OCF_SUCCESS
else
- if [ "$OCF_RESKEY_dc" = "yes" ]; then
- ocf_log info "NIC $NIC is DOWN"
- exit $OCF_SUCCESS
- else
- exit $OCF_ERR_GENERIC
- fi
+ ocf_log info "NIC $NIC is DOWN"
+ exit $OCF_SUCCESS
fi
@@ -1037,12 +1033,8 @@ ip_start() {
then
exit $OCF_SUCCESS
else
- if [ "$OCF_RESKEY_dc" = "yes" ]; then
- ocf_log info "NIC $NIC is DOWN"
- exit $OCF_SUCCESS
- else
- exit $OCF_ERR_GENERIC
- fi
+ ocf_log info "NIC $NIC is DOWN"
+ exit $OCF_SUCCESS
fi
}
@@ -1040,12 +1032,8 @@ ip_monitor() {
then
return $OCF_SUCCESS
else
- if [ "$OCF_RESKEY_dc" = "yes" ]; then
- ocf_log info "NIC $NIC is DOWN"
- return $OCF_SUCCESS
- else
- return $OCF_NOT_RUNNING
- fi
+ ocf_log info "NIC $NIC is DOWN"
+ return $OCF_SUCCESS
fi
@@ -1123,12 +1115,8 @@ ip_monitor() {
then
return $OCF_SUCCESS
else
- if [ "$OCF_RESKEY_dc" = "yes" ]; then
- ocf_log info "NIC $NIC is DOWN"
- return $OCF_SUCCESS
- else
- return $OCF_NOT_RUNNING
- fi
+ ocf_log info "NIC $NIC is DOWN"
+ exit $OCF_SUCCESS
fi
;;
partial|no|partial2)
--

View File

@ -11,7 +11,7 @@ diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
index 2da5c5e..79dbdcf 100755
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -584,10 +584,18 @@ add_interface () {
@@ -622,10 +622,18 @@ add_interface () {
add_ipv6_addrlabel $ipaddr
fi

View File

@ -11,45 +11,45 @@ diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
index aef6dc7..67a7ca3 100755
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -880,7 +880,12 @@ ip_start() {
@@ -964,7 +964,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
+ 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
@@ -939,7 +944,12 @@ ip_start() {
if [ -n "$IP_CIP" ] && ([ $ip_status = "no" ] || [ $ip_status = "partial2" ]); then
@@ -1023,7 +1028,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
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ then
+ exit $OCF_SUCCESS
+ else
+ exit $OCF_ERR_GENERIC
+ fi
}
ip_stop() {
@@ -1015,7 +1025,12 @@ ip_monitor() {
@@ -1099,7 +1109,12 @@ ip_monitor() {
case $ip_status in
ok)
$ARP_SEND_FUN refresh
run_arp_sender refresh
- return $OCF_SUCCESS
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ then
+ return $OCF_SUCCESS
+ else
+ return $OCF_NOT_RUNNING
+ fi
+ 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

@ -11,46 +11,46 @@ diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
index 67a7ca3..2cd822d 100755
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -884,7 +884,12 @@ ip_start() {
then
exit $OCF_SUCCESS
else
- exit $OCF_ERR_GENERIC
+ if [ "$OCF_RESKEY_dc" = "yes" ]; then
+ ocf_log info "NIC $NIC is DOWN..."
+ exit $OCF_SUCCESS
+ else
+ exit $OCF_ERR_GENERIC
+ fi
fi
@@ -968,7 +968,12 @@ ip_start() {
then
exit $OCF_SUCCESS
else
- exit $OCF_ERR_GENERIC
+ if [ "$OCF_RESKEY_dc" = "yes" ]; then
+ ocf_log info "NIC $NIC is DOWN..."
+ exit $OCF_SUCCESS
+ else
+ exit $OCF_ERR_GENERIC
+ fi
fi
fi
@@ -948,7 +953,12 @@ ip_start() {
then
exit $OCF_SUCCESS
else
- exit $OCF_ERR_GENERIC
+ if [ "$OCF_RESKEY_dc" = "yes" ]; then
+ ocf_log info "NIC $NIC is DOWN"
+ exit $OCF_SUCCESS
+ else
+ exit $OCF_ERR_GENERIC
+ fi
fi
@@ -1032,7 +1037,12 @@ ip_start() {
then
exit $OCF_SUCCESS
else
- exit $OCF_ERR_GENERIC
+ if [ "$OCF_RESKEY_dc" = "yes" ]; then
+ ocf_log info "NIC $NIC is DOWN"
+ exit $OCF_SUCCESS
+ else
+ exit $OCF_ERR_GENERIC
+ fi
fi
}
@@ -1029,7 +1039,12 @@ ip_monitor() {
then
return $OCF_SUCCESS
else
- return $OCF_NOT_RUNNING
+ if [ "$OCF_RESKEY_dc" = "yes" ]; then
+ ocf_log info "NIC $NIC is DOWN"
+ return $OCF_SUCCESS
+ else
+ return $OCF_NOT_RUNNING
+ fi
fi
@@ -1113,7 +1123,12 @@ ip_monitor() {
then
return $OCF_SUCCESS
else
- return $OCF_NOT_RUNNING
+ if [ "$OCF_RESKEY_dc" = "yes" ]; then
+ ocf_log info "NIC $NIC is DOWN"
+ return $OCF_SUCCESS
+ else
+ return $OCF_NOT_RUNNING
+ fi
fi
;;
partial|no|partial2)
--

View File

@ -11,33 +11,33 @@ diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
index 2cd822d..59620d2 100755
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -880,7 +880,7 @@ ip_start() {
@@ -964,7 +964,7 @@ ip_start() {
local ip_status=`ip_served`
if [ "$ip_status" = "ok" ]; then
- if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ] || [ "$NIC" = "lo" ]
then
exit $OCF_SUCCESS
else
@@ -949,7 +949,7 @@ ip_start() {
- if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ] || [ "$NIC" = "lo" ]
then
exit $OCF_SUCCESS
else
@@ -1033,7 +1033,7 @@ ip_start() {
fi
;;
esac
- if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ] || [ "$NIC" = "lo" ]
then
exit $OCF_SUCCESS
else
@@ -1035,7 +1035,7 @@ ip_monitor() {
- if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ] || [ "$NIC" = "lo" ]
then
exit $OCF_SUCCESS
else
@@ -1119,7 +1119,7 @@ ip_monitor() {
case $ip_status in
ok)
$ARP_SEND_FUN refresh
- if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ] || [ "$NIC" = "lo" ]
then
return $OCF_SUCCESS
else
run_arp_sender refresh
- if [ -n "`ip link show $NIC | grep \"state UP\"`" ]
+ if [ -n "`ip link show $NIC | grep \"state UP\"`" ] || [ "$NIC" = "lo" ]
then
return $OCF_SUCCESS
else
--
1.9.1

View File

@ -30,7 +30,7 @@ diff --git a/heartbeat/LVM b/heartbeat/LVM
index 1efb207..bde381c 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -601,6 +601,81 @@ EOF
@@ -365,6 +365,81 @@ LVM_start() {
}
#
@ -112,7 +112,7 @@ index 1efb207..bde381c 100755
# Disable the LVM volume
#
LVM_stop() {
@@ -632,6 +707,7 @@ LVM_stop() {
@@ -393,6 +468,7 @@ LVM_stop() {
break
fi

View File

@ -4,14 +4,14 @@ Date: Mon, 2 Oct 2017 15:12:54 -0400
Subject: [PATCH 06/13] WRS: Patch1110: lvm_vg_activation.patch
---
heartbeat/LVM | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 116 insertions(+), 14 deletions(-)
heartbeat/LVM | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 116 insertions(+), 3 deletions(-)
diff --git a/heartbeat/LVM b/heartbeat/LVM
index b0ca87a..38092f9 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -437,6 +437,81 @@ retry_exclusive_start()
@@ -222,6 +222,81 @@ LVM_status() {
}
#
@ -93,65 +93,54 @@ index b0ca87a..38092f9 100755
# Enable LVM volume
#
LVM_start() {
@@ -477,20 +552,47 @@ EOF
: ;;
esac
@@ -241,9 +316,47 @@ LVM_start() {
ocf_run vgscan
fi
- if ! ocf_run vgchange $vgchange_options $vg; then
- if [ $clvmd -eq 0 ]; then
- return $OCF_ERR_GENERIC
- fi
-
- # Failure to exclusively activate cluster vg.:
- # This could be caused by a remotely active LV, Attempt
- # to disable volume group cluster wide and try again.
- # Allow for some settling
- sleep 5
- if ! retry_exclusive_start; then
- return $OCF_ERR_GENERIC
- fi
- fi
+ # 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=$!
- lvm_pre_activate || exit
- ocf_run vgchange $vgchange_activate_options $vg
- lvm_post_activate $?
+ # 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
+ # 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 [ "$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 $vg; then
: OK Volume $vg activated just fine!

View File

@ -5,50 +5,44 @@ Subject: [PATCH 1/1] Notify rmon of shutdown before shutting down LVM and
Filesystem
---
heartbeat/Filesystem | 9 +++++----
heartbeat/LVM | 9 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
heartbeat/Filesystem | 5 +++--
heartbeat/LVM | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem
index 05e4097..d5f3417 100755
--- a/heartbeat/Filesystem
+++ b/heartbeat/Filesystem
@@ -1200,10 +1200,11 @@ case $OP in
@@ -883,9 +883,10 @@ case $OP in
validate-all) Filesystem_validate_all
exit $?
;;
- stop) Filesystem_stop
- rc=$?
- rmon_notify "disabled" 300
- exit $rc
- rc=$?
+ stop)
+ rmon_notify "disabled" 300
rmon_notify "disabled" 300
+ Filesystem_stop
+ rc=$?
+ exit $rc
exit $rc
;;
esac
diff --git a/heartbeat/LVM b/heartbeat/LVM
index 38092f9..893ece8 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -879,10 +879,11 @@ case "$1" in
fi
exit $rc;;
@@ -599,9 +599,10 @@ case "$1" in
fi
exit $rc;;
- stop) LVM_stop $VOLUME
- rc=$?
- rmon_notify "disabled" 300
- exit $rc;;
- rc=$?
+ stop)
+ rmon_notify "disabled" 300
rmon_notify "disabled" 300
+ LVM_stop $VOLUME
+ rc=$?
+ exit $rc;;
exit $rc;;
status) LVM_status $VOLUME $1
rc=$?
--
2.7.4

View File

@ -11,7 +11,7 @@ diff --git a/heartbeat/ocf-shellfuncs.in b/heartbeat/ocf-shellfuncs.in
index 3565e20..688c150 100644
--- a/heartbeat/ocf-shellfuncs.in
+++ b/heartbeat/ocf-shellfuncs.in
@@ -180,9 +180,9 @@ hadate() {
@@ -176,9 +176,9 @@ hadate() {
set_logtag() {
if [ -z "$HA_LOGTAG" ]; then
if [ -n "$OCF_RESOURCE_INSTANCE" ]; then

View File

@ -4,14 +4,14 @@ Date: Mon, 2 Oct 2017 15:12:59 -0400
Subject: [PATCH 07/13] WRS: Patch1111: pgsql.patch
---
heartbeat/pgsql | 23 ++++++++++++++++++++---
heartbeat/pgsql | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/heartbeat/pgsql b/heartbeat/pgsql
index 768608e..28cc046 100755
--- a/heartbeat/pgsql
+++ b/heartbeat/pgsql
@@ -38,6 +38,7 @@ get_pgsql_param() {
@@ -46,6 +46,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
@ -19,7 +19,7 @@ index 768608e..28cc046 100755
OCF_RESKEY_pgdba_default=postgres
OCF_RESKEY_pghost_default=""
OCF_RESKEY_pgport_default=5432
@@ -67,10 +68,11 @@ OCF_RESKEY_stop_escalate_in_slave_default=30
@@ -78,11 +79,12 @@ OCF_RESKEY_replication_slot_name_default=""
: ${OCF_RESKEY_pgctl=${OCF_RESKEY_pgctl_default}}
: ${OCF_RESKEY_psql=${OCF_RESKEY_psql_default}}
: ${OCF_RESKEY_pgdata=${OCF_RESKEY_pgdata_default}}
@ -27,12 +27,13 @@ index 768608e..28cc046 100755
: ${OCF_RESKEY_pgdba=${OCF_RESKEY_pgdba_default}}
: ${OCF_RESKEY_pghost=${OCF_RESKEY_pghost_default}}
: ${OCF_RESKEY_pgport=${OCF_RESKEY_pgport_default}}
: ${OCF_RESKEY_pglibs=${OCF_RESKEY_pglibs_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_ctl_opt=${OCF_RESKEY_ctl_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.
@@ -180,6 +182,14 @@ Path to PostgreSQL data directory.
<content type="string" default="${OCF_RESKEY_pgdata_default}" />
</parameter>
@ -47,7 +48,7 @@ index 768608e..28cc046 100755
<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 operations.
@@ -243,7 +253,7 @@ SQL script that will be used for monitor operations.
Path to the PostgreSQL configuration file for the instance.
</longdesc>
<shortdesc lang="en">Configuration file</shortdesc>
@ -56,10 +57,10 @@ index 768608e..28cc046 100755
</parameter>
<parameter name="pgdb" unique="0" required="0">
@@ -549,6 +559,12 @@ pgsql_real_start() {
ocf_log debug "PostgreSQL still hasn't started yet. Waiting..."
done
@@ -630,6 +640,12 @@ pgsql_real_start() {
fi
fi
+ # WRS: Create an unversioned symlink under /var/run so SM can easily
+ # find the PID file.
+ if [ ! -h $PIDFILE_SYMLINK ]; then
@ -69,8 +70,8 @@ index 768608e..28cc046 100755
ocf_log info "PostgreSQL is started."
return $rc
}
@@ -1756,10 +1772,11 @@ fi
@@ -2078,10 +2094,11 @@ then
fi
PIDFILE=${OCF_RESKEY_pgdata}/postmaster.pid
+PIDFILE_SYMLINK=/var/run/postmaster.pid
@ -81,7 +82,7 @@ index 768608e..28cc046 100755
+RECOVERY_CONF=${OCF_RESKEY_pgconf}/recovery.conf
NODENAME=$(ocf_local_nodename | tr '[A-Z]' '[a-z]')
if is_replication; then
case "$1" in
--
1.9.1

View File

@ -11,7 +11,7 @@ diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem
index f536298..05e4097 100755
--- a/heartbeat/Filesystem
+++ b/heartbeat/Filesystem
@@ -804,6 +804,10 @@ signal_processes() {
@@ -503,6 +503,10 @@ signal_processes() {
}
try_umount() {
local SUB=$1

View File

@ -1,2 +1,2 @@
mirror:Source/resource-agents-3.9.5-124.el7.src.rpm
mirror:Source/resource-agents-4.1.1-12.el7_6.7.src.rpm