From 3d335b21eb7cbce738ca2527e3eb23b44e296813 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Wed, 4 Jan 2023 08:11:09 +0000 Subject: [PATCH] import resource-agents-4.9.0-36.el8 --- ...-ras-validate-all-OCF_CHECK_LEVEL-10.patch | 137 ++++++++++++++++++ SPECS/resource-agents.spec | 10 +- 2 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 SOURCES/bz2157873-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch diff --git a/SOURCES/bz2157873-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch b/SOURCES/bz2157873-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch new file mode 100644 index 0000000..85f5f48 --- /dev/null +++ b/SOURCES/bz2157873-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch @@ -0,0 +1,137 @@ +From bf89ad06d5da5c05533c80a37a37c8dbbcd123aa Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Thu, 8 Dec 2022 15:40:07 +0100 +Subject: [PATCH] galera/mpathpersist/sg_persist/IPsrcaddr: only check notify + and promotable when OCF_CHECK_LEVEL=10 + +Pacemaker has started running validate-all action before creating the +resource. It doesnt provide notify/promotable settings while doing so, +so this patch moves these checks to OCF_CHECK_LEVEL 10 and runs the +validate action at OCF_CHECK_LEVEL 10 in the start-action. +--- + heartbeat/IPsrcaddr | 13 ++++++++----- + heartbeat/galera.in | 9 ++++++--- + heartbeat/mpathpersist.in | 13 +++++++++---- + heartbeat/sg_persist.in | 13 +++++++++---- + 4 files changed, 32 insertions(+), 16 deletions(-) + +diff --git a/heartbeat/IPsrcaddr b/heartbeat/IPsrcaddr +index 1bd41a930..66e2ad8cd 100755 +--- a/heartbeat/IPsrcaddr ++++ b/heartbeat/IPsrcaddr +@@ -510,11 +510,13 @@ srca_validate_all() { + fi + + # We should serve this IP address of course +- if ip_status "$ipaddress"; then +- : +- else +- ocf_exit_reason "We are not serving [$ipaddress], hence can not make it a preferred source address" +- return $OCF_ERR_INSTALLED ++ if [ "$OCF_CHECK_LEVEL" -eq 10 ]; then ++ if ip_status "$ipaddress"; then ++ : ++ else ++ ocf_exit_reason "We are not serving [$ipaddress], hence can not make it a preferred source address" ++ return $OCF_ERR_INSTALLED ++ fi + fi + return $OCF_SUCCESS + } +@@ -540,6 +542,7 @@ esac + + ipaddress="$OCF_RESKEY_ipaddress" + ++[ "$__OCF_ACTION" != "validate-all" ] && OCF_CHECK_LEVEL=10 + srca_validate_all + rc=$? + if [ $rc -ne $OCF_SUCCESS ]; then +diff --git a/heartbeat/galera.in b/heartbeat/galera.in +index cd2fee7c0..6aed3e4b6 100755 +--- a/heartbeat/galera.in ++++ b/heartbeat/galera.in +@@ -1015,9 +1015,11 @@ galera_stop() + + galera_validate() + { +- if ! ocf_is_ms; then +- ocf_exit_reason "Galera must be configured as a multistate Master/Slave resource." +- return $OCF_ERR_CONFIGURED ++ if [ "$OCF_CHECK_LEVEL" -eq 10 ]; then ++ if ! ocf_is_ms; then ++ ocf_exit_reason "Galera must be configured as a multistate Master/Slave resource." ++ return $OCF_ERR_CONFIGURED ++ fi + fi + + if [ -z "$OCF_RESKEY_wsrep_cluster_address" ]; then +@@ -1035,6 +1037,7 @@ case "$1" in + exit $OCF_SUCCESS;; + esac + ++[ "$__OCF_ACTION" = "start" ] && OCF_CHECK_LEVEL=10 + galera_validate + rc=$? + LSB_STATUS_STOPPED=3 +diff --git a/heartbeat/mpathpersist.in b/heartbeat/mpathpersist.in +index 0e2c2a4a0..8a46b9930 100644 +--- a/heartbeat/mpathpersist.in ++++ b/heartbeat/mpathpersist.in +@@ -630,10 +630,11 @@ mpathpersist_action_notify() { + } + + mpathpersist_action_validate_all () { +- +- if [ "$OCF_RESKEY_CRM_meta_master_max" != "1" ] && [ "$RESERVATION_TYPE" != "7" ] && [ "$RESERVATION_TYPE" != "8" ]; then +- ocf_log err "Master options misconfigured." +- exit $OCF_ERR_CONFIGURED ++ if [ "$OCF_CHECK_LEVEL" -eq 10 ]; then ++ if [ "$OCF_RESKEY_CRM_meta_master_max" != "1" ] && [ "$RESERVATION_TYPE" != "7" ] && [ "$RESERVATION_TYPE" != "8" ]; then ++ ocf_log err "Master options misconfigured." ++ exit $OCF_ERR_CONFIGURED ++ fi + fi + + return $OCF_SUCCESS +@@ -659,6 +660,10 @@ case $ACTION in + start|promote|monitor|stop|demote) + ocf_log debug "$RESOURCE: starting action \"$ACTION\"" + mpathpersist_init ++ if [ "$__OCF_ACTION" = "start" ]; then ++ OCF_CHECK_LEVEL=10 ++ mpathpersist_action_validate_all ++ fi + mpathpersist_action_$ACTION + exit $? + ;; +diff --git a/heartbeat/sg_persist.in b/heartbeat/sg_persist.in +index 16048ea6f..620c02f4a 100644 +--- a/heartbeat/sg_persist.in ++++ b/heartbeat/sg_persist.in +@@ -643,10 +643,11 @@ sg_persist_action_notify() { + } + + sg_persist_action_validate_all () { +- +- if [ "$OCF_RESKEY_CRM_meta_master_max" != "1" ] && [ "$RESERVATION_TYPE" != "7" ] && [ "$RESERVATION_TYPE" != "8" ]; then +- ocf_log err "Master options misconfigured." +- exit $OCF_ERR_CONFIGURED ++ if [ "$OCF_CHECK_LEVEL" -eq 10 ]; then ++ if [ "$OCF_RESKEY_CRM_meta_master_max" != "1" ] && [ "$RESERVATION_TYPE" != "7" ] && [ "$RESERVATION_TYPE" != "8" ]; then ++ ocf_log err "Master options misconfigured." ++ exit $OCF_ERR_CONFIGURED ++ fi + fi + + return $OCF_SUCCESS +@@ -672,6 +673,10 @@ case $ACTION in + start|promote|monitor|stop|demote) + ocf_log debug "$RESOURCE: starting action \"$ACTION\"" + sg_persist_init ++ if [ "$__OCF_ACTION" = "start" ]; then ++ OCF_CHECK_LEVEL=10 ++ sg_persist_action_validate_all ++ fi + sg_persist_action_$ACTION + exit $? + ;; diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index 4c212a8..f94405e 100644 --- a/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec @@ -69,7 +69,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.9.0 -Release: 35%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 36%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} @@ -131,6 +131,7 @@ Patch39: bz2141836-vdo-vol-dont-fail-probe-action.patch Patch40: bz2049319-Filesystem-add-support-for-Amazon-EFS.patch Patch41: bz2127117-nfsserver-nfsv4_only-parameter.patch Patch42: bz2139131-mysql-common-return-error-if-kill-fails.patch +Patch43: bz2157873-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch # bundle patches Patch1000: 7-gcp-bundled.patch @@ -353,6 +354,7 @@ exit 1 %patch40 -p1 %patch41 -p1 %patch42 -p1 +%patch43 -p1 chmod 755 heartbeat/nova-compute-wait chmod 755 heartbeat/NovaEvacuate @@ -928,6 +930,12 @@ ccs_update_schema > /dev/null 2>&1 ||: %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog +* Tue Jan 3 2023 Oyvind Albrigtsen - 4.9.0-36 +- all agents: dont check notify/promotable settings during + validate-action + + Resolves: rhbz#2157873 + * Thu Nov 24 2022 Oyvind Albrigtsen - 4.9.0-35 - mysql-common: return error in stop-action if kill fails to stop the process, so the node can get fenced