diff --git a/SOURCES/bz2157873-1-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch b/SOURCES/bz2157873-1-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch new file mode 100644 index 0000000..85f5f48 --- /dev/null +++ b/SOURCES/bz2157873-1-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/SOURCES/bz2157873-2-Filesystem-CTDB-validate-all-improvements.patch b/SOURCES/bz2157873-2-Filesystem-CTDB-validate-all-improvements.patch new file mode 100644 index 0000000..bd95157 --- /dev/null +++ b/SOURCES/bz2157873-2-Filesystem-CTDB-validate-all-improvements.patch @@ -0,0 +1,49 @@ +From 21666c5c842b8a6028699ee78db75a1d7134fad0 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 4 Jan 2023 10:39:16 +0100 +Subject: [PATCH 1/2] Filesystem: remove validate-all mountpoint warning as it + is auto-created during start-action if it doesnt exist + +--- + heartbeat/Filesystem | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem +index 44270ad98..65088029e 100755 +--- a/heartbeat/Filesystem ++++ b/heartbeat/Filesystem +@@ -851,10 +851,6 @@ Filesystem_monitor() + # + Filesystem_validate_all() + { +- if [ -n "$MOUNTPOINT" ] && [ ! -d "$MOUNTPOINT" ]; then +- ocf_log warn "Mountpoint $MOUNTPOINT does not exist" +- fi +- + # Check if the $FSTYPE is workable + # NOTE: Without inserting the $FSTYPE module, this step may be imprecise + # TODO: This is Linux specific crap. + +From 8a7f40b6ab93d8d39230d864ab06a57ff48d6f1f Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Thu, 5 Jan 2023 13:09:48 +0100 +Subject: [PATCH 2/2] CTDB: change public_addresses validate-all warning to + info + +--- + heartbeat/CTDB.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/heartbeat/CTDB.in b/heartbeat/CTDB.in +index 46f56cfac..b4af66bc1 100755 +--- a/heartbeat/CTDB.in ++++ b/heartbeat/CTDB.in +@@ -940,7 +940,7 @@ ctdb_validate() { + fi + + if [ -f "${OCF_RESKEY_ctdb_config_dir}/public_addresses" ]; then +- ocf_log warn "CTDB file '${OCF_RESKEY_ctdb_config_dir}/public_addresses' exists - CTDB will try to manage IP failover!" ++ ocf_log info "CTDB file '${OCF_RESKEY_ctdb_config_dir}/public_addresses' exists - CTDB will try to manage IP failover!" + fi + + if [ ! -f "$OCF_RESKEY_ctdb_config_dir/nodes" ]; then diff --git a/SOURCES/bz2157873-3-pgsqlms-validate-all-OCF_CHECK_LEVEL-10.patch b/SOURCES/bz2157873-3-pgsqlms-validate-all-OCF_CHECK_LEVEL-10.patch new file mode 100644 index 0000000..7b98a63 --- /dev/null +++ b/SOURCES/bz2157873-3-pgsqlms-validate-all-OCF_CHECK_LEVEL-10.patch @@ -0,0 +1,68 @@ +--- a/heartbeat/pgsqlms 2023-01-04 14:42:36.093258702 +0100 ++++ b/heartbeat/pgsqlms 2023-01-04 14:40:52.403994545 +0100 +@@ -66,6 +66,7 @@ + my $maxlag = $ENV{'OCF_RESKEY_maxlag'} || $maxlag_default; + my $recovery_tpl = $ENV{'OCF_RESKEY_recovery_template'} + || "$pgdata/recovery.conf.pcmk"; ++my $ocf_check_level = $ENV{'OCF_CHECK_LEVEL'} || 0; + + + # PostgreSQL commands path +@@ -1304,26 +1305,28 @@ + return $OCF_ERR_INSTALLED; + } + +- # check notify=true +- $ans = qx{ $CRM_RESOURCE --resource "$OCF_RESOURCE_INSTANCE" \\ +- --meta --get-parameter notify 2>/dev/null }; +- chomp $ans; +- unless ( lc($ans) =~ /^true$|^on$|^yes$|^y$|^1$/ ) { +- ocf_exit_reason( +- 'You must set meta parameter notify=true for your master resource' +- ); +- return $OCF_ERR_INSTALLED; +- } ++ if ( $ocf_check_level == 10 ) { ++ # check notify=true ++ $ans = qx{ $CRM_RESOURCE --resource "$OCF_RESOURCE_INSTANCE" \\ ++ --meta --get-parameter notify 2>/dev/null }; ++ chomp $ans; ++ unless ( lc($ans) =~ /^true$|^on$|^yes$|^y$|^1$/ ) { ++ ocf_exit_reason( ++ 'You must set meta parameter notify=true for your "master" resource' ++ ); ++ return $OCF_ERR_INSTALLED; ++ } + +- # check master-max=1 +- unless ( +- defined $ENV{'OCF_RESKEY_CRM_meta_master_max'} +- and $ENV{'OCF_RESKEY_CRM_meta_master_max'} eq '1' +- ) { +- ocf_exit_reason( +- 'You must set meta parameter master-max=1 for your master resource' +- ); +- return $OCF_ERR_INSTALLED; ++ # check master-max=1 ++ unless ( ++ defined $ENV{'OCF_RESKEY_CRM_meta_master_max'} ++ and $ENV{'OCF_RESKEY_CRM_meta_master_max'} eq '1' ++ ) { ++ ocf_exit_reason( ++ 'You must set meta parameter master-max=1 for your "master" resource' ++ ); ++ return $OCF_ERR_INSTALLED; ++ } + } + + if ( $PGVERNUM >= $PGVER_12 ) { +@@ -2242,6 +2245,9 @@ + # Set current node name. + $nodename = ocf_local_nodename(); + ++if ( $__OCF_ACTION ne 'validate-all' ) { ++ $ocf_check_level = 10; ++} + $exit_code = pgsql_validate_all(); + + exit $exit_code if $exit_code != $OCF_SUCCESS or $__OCF_ACTION eq 'validate-all'; 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 deleted file mode 100644 index 85f5f48..0000000 --- a/SOURCES/bz2157873-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch +++ /dev/null @@ -1,137 +0,0 @@ -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 f94405e..01428cc 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: 36%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 37%{?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,7 +131,9 @@ 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 +Patch43: bz2157873-1-all-ras-validate-all-OCF_CHECK_LEVEL-10.patch +Patch44: bz2157873-2-Filesystem-CTDB-validate-all-improvements.patch +Patch45: bz2157873-3-pgsqlms-validate-all-OCF_CHECK_LEVEL-10.patch # bundle patches Patch1000: 7-gcp-bundled.patch @@ -355,6 +357,8 @@ exit 1 %patch41 -p1 %patch42 -p1 %patch43 -p1 +%patch44 -p1 +%patch45 -p1 chmod 755 heartbeat/nova-compute-wait chmod 755 heartbeat/NovaEvacuate @@ -930,7 +934,7 @@ 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 +* Thu Jan 5 2023 Oyvind Albrigtsen - 4.9.0-37 - all agents: dont check notify/promotable settings during validate-action