diff --git a/SOURCES/bz1848025-sybaseASE-run-verify-for-start-action-only.patch b/SOURCES/bz1848025-sybaseASE-run-verify-for-start-action-only.patch new file mode 100644 index 0000000..402bbd6 --- /dev/null +++ b/SOURCES/bz1848025-sybaseASE-run-verify-for-start-action-only.patch @@ -0,0 +1,41 @@ +From 953f689cb2a37606b6d4b2250ebec23f129f5095 Mon Sep 17 00:00:00 2001 +From: Reid wahl +Date: Thu, 9 Jul 2020 23:32:22 -0700 +Subject: [PATCH] sybaseASE: Run verify_all() for start operation only + +The `sybaseASE` resource agent runs the `verify_all()` function at the +beginning of start, stop, and monitor operations. + +When `verify_all()` is run for a probe (monitor) operation and +`sybase_home` resides on a cluster-managed filesystem, the probe often +fails with `$OCF_ERR_GENERIC` because the filesystem isn't mounted yet. +This prevents the resource from starting on that node. + +For the stop operation, there's simply no reason to run `verify_all()`. + +This patch removes `verify_all()` for the stop and monitor operations. +It is now only run for the start operation. + +Resolves: RHBZ#1848673 +Resolves: RHBZ#1848025 +--- + heartbeat/sybaseASE.in | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/heartbeat/sybaseASE.in b/heartbeat/sybaseASE.in +index 9ddd429be..7ff30bd31 100755 +--- a/heartbeat/sybaseASE.in ++++ b/heartbeat/sybaseASE.in +@@ -864,12 +864,10 @@ case $__OCF_ACTION in + exit $? + ;; + stop) +- verify_all || exit $OCF_ERR_GENERIC + ase_stop + exit $? + ;; + status | monitor) +- verify_all || exit $OCF_ERR_GENERIC + ase_status $OCF_CHECK_LEVEL + exit $? + ;; diff --git a/SOURCES/bz1861001-sybaseASE-add-logfile-parameter.patch b/SOURCES/bz1861001-sybaseASE-add-logfile-parameter.patch new file mode 100644 index 0000000..b294584 --- /dev/null +++ b/SOURCES/bz1861001-sybaseASE-add-logfile-parameter.patch @@ -0,0 +1,53 @@ +From d62d8776df8aaa1da32e8452b3816505d1ea1f7f Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 28 Oct 2020 15:06:47 +0100 +Subject: [PATCH] sybaseASE: add logfile parameter + +--- + heartbeat/sybaseASE.in | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git a/heartbeat/sybaseASE.in b/heartbeat/sybaseASE.in +index 7ff30bd31..fef76474e 100755 +--- a/heartbeat/sybaseASE.in ++++ b/heartbeat/sybaseASE.in +@@ -115,6 +115,13 @@ fi + interfaces_file_default="${OCF_RESKEY_sybase_home}/interfaces" + : ${OCF_RESKEY_interfaces_file=${interfaces_file_default}} + ++if [ $__OCF_ACTION != "meta-data" ]; then ++ logfile_default="$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase/install/$OCF_RESKEY_server_name.log" ++else ++ logfile_default="detect" ++fi ++: ${OCF_RESKEY_logfile=${logfile_default}} ++ + export LD_POINTER_GUARD=0 + + ####################################################################################### +@@ -122,7 +129,7 @@ export LD_POINTER_GUARD=0 + ####################################################################################### + declare login_string="" + declare RUNSERVER_SCRIPT=$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase/install/RUN_$OCF_RESKEY_server_name +-declare CONSOLE_LOG=$OCF_RESKEY_sybase_home/$OCF_RESKEY_sybase_ase/install/$OCF_RESKEY_server_name.log ++declare CONSOLE_LOG="$OCF_RESKEY_logfile" + + ################################################################################################## + # This function will be called by Pacemaker to get the meta data of resource agent "sybaseASE". # +@@ -223,6 +230,16 @@ meta_data() + + + ++ ++ ++ Logfile ++ ++ ++ Logfile ++ ++ ++ ++ + + + diff --git a/SOURCES/bz1891835-galera-set-bootstrap-attribute-before-promote.patch b/SOURCES/bz1891835-galera-set-bootstrap-attribute-before-promote.patch new file mode 100644 index 0000000..7dfdc48 --- /dev/null +++ b/SOURCES/bz1891835-galera-set-bootstrap-attribute-before-promote.patch @@ -0,0 +1,36 @@ +From ac213f158ff851422d78ae8f56b022e8e30751bc Mon Sep 17 00:00:00 2001 +From: Damien Ciabrini +Date: Mon, 26 Oct 2020 14:54:05 +0100 +Subject: [PATCH] galera: set bootstrap attribute before promote + +When the master detection takes place, the node chosen for +becoming the master is given two attributes in the CIB: +a master score and a bootstrap flag. The master score makes +pacemaker schedule a promote operation, and the bootstrap flag +drives how the galera server is started. + +The order in which we set the attributes is racy; it may happen +that a promote operation is started before the current master +detection function has set the bootstrap flag, in which case +the promotion will fail. + +Reverse the order in which we set the attributes on a bootstrap +node to close the race. +--- + heartbeat/galera | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/heartbeat/galera b/heartbeat/galera +index d2f4faa86..b4d7e187d 100755 +--- a/heartbeat/galera ++++ b/heartbeat/galera +@@ -587,8 +587,8 @@ detect_first_master() + fi + + ocf_log info "Promoting $best_node to be our bootstrap node" +- set_master_score $best_node + set_bootstrap_node $best_node ++ set_master_score $best_node + } + + detect_safe_to_bootstrap() diff --git a/SOURCES/bz1891855-galera-recover-2-node-cluster.patch b/SOURCES/bz1891855-galera-recover-2-node-cluster.patch new file mode 100644 index 0000000..22ab885 --- /dev/null +++ b/SOURCES/bz1891855-galera-recover-2-node-cluster.patch @@ -0,0 +1,80 @@ +--- a/heartbeat/galera 2020-10-28 16:28:48.125700714 +0100 ++++ b/heartbeat/galera 2020-10-28 16:31:14.932820752 +0100 +@@ -81,6 +81,11 @@ + . /etc/default/clustercheck + fi + ++# Parameter defaults ++ ++OCF_RESKEY_two_node_mode_default="false" ++: ${OCF_RESKEY_two_node_mode=${OCF_RESKEY_two_node_mode_default}} ++ + ####################################################################### + + usage() { +@@ -249,6 +254,16 @@ + + + ++ ++ ++If running in a 2-node pacemaker cluster, rely on pacemaker quorum ++to allow automatic recovery even when the other node is unreachable. ++Use it with caution! (and fencing) ++ ++Special recovery when running on a 2-node cluster ++ ++ ++ + + + +@@ -400,6 +415,27 @@ + return 0 + } + ++is_two_node_mode_active() ++{ ++ # crm_node or corosync-quorumtool cannot access various corosync ++ # flags when running inside a bundle, so only count the cluster ++ # members ++ ocf_is_true "$OCF_RESKEY_two_node_mode" && ${HA_SBIN_DIR}/crm_mon -1X | xmllint --xpath "count(//nodes/node[@type='member'])" - | grep -q -w 2 ++} ++ ++is_last_node_in_quorate_partition() ++{ ++ # when a network split occurs in a 2-node cluster, pacemaker ++ # fences the other node and try to retain quorum. So until ++ # the fencing is resolved (and the status of the peer node ++ # is clean), we shouldn't consider ourself quorate. ++ local partition_members=$(${HA_SBIN_DIR}/crm_node -p | wc -w) ++ local quorate=$(${HA_SBIN_DIR}/crm_node -q) ++ local clean_members=$(${HA_SBIN_DIR}/crm_mon -1X | xmllint --xpath 'count(//nodes/node[@type="member" and @unclean="false"])' -) ++ ++ [ "$partition_members" = 1 ] && [ "$quorate" = 1 ] && [ "$clean_members" = 2 ] ++} ++ + master_exists() + { + if [ "$__OCF_ACTION" = "demote" ]; then +@@ -518,8 +554,20 @@ + done + + for node in $nodes_recovered $nodes; do ++ # On clean shutdown, galera sets the last stopped node as 'safe to bootstrap', ++ # so use this hint when we can + safe_to_bootstrap=$(get_safe_to_bootstrap $node) + ++ # Special case for 2-node clusters: during a network split, rely on ++ # pacemaker's quorum to check whether we can restart galera ++ if [ "$safe_to_bootstrap" != "1" ] && [ "$node" = "$NODENAME" ] && is_two_node_mode_active; then ++ is_last_node_in_quorate_partition ++ if [ $? -eq 0 ]; then ++ ocf_log warn "Survived a split in a 2-node cluster, considering ourselves safe to bootstrap" ++ safe_to_bootstrap=1 ++ fi ++ fi ++ + if [ "$safe_to_bootstrap" = "1" ]; then + # Galera marked the node as safe to boostrap during shutdown. Let's just + # pick it as our bootstrap node. diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index 0e57d97..8025843 100644 --- a/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec @@ -70,7 +70,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.1.1 -Release: 71%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 72%{?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} @@ -245,6 +245,11 @@ Patch153: bz1881114-galera-recover-joining-non-existing-cluster.patch Patch154: bz1815013-redis-parse-password-correctly-based-on-version.patch Patch155: bz1763249-manpages-fix-pcs-syntax.patch Patch156: bz1890068-gcp-pd-move-fix-partially-matched-disk_name.patch +Patch157: bz1848025-sybaseASE-run-verify-for-start-action-only.patch +Patch158: bz1861001-sybaseASE-add-logfile-parameter.patch +Patch159: bz1891835-galera-set-bootstrap-attribute-before-promote.patch +Patch160: bz1891855-galera-recover-2-node-cluster.patch + # bundle patches Patch1000: 7-gcp-bundled.patch @@ -557,6 +562,10 @@ exit 1 %patch154 -p1 -F1 %patch155 -p1 %patch156 -p1 +%patch157 -p1 +%patch158 -p1 +%patch159 -p1 +%patch160 -p1 chmod 755 heartbeat/nova-compute-wait chmod 755 heartbeat/NovaEvacuate @@ -1120,6 +1129,17 @@ ccs_update_schema > /dev/null 2>&1 ||: %endif %changelog +* Wed Oct 28 2020 Oyvind Albrigtsen - 4.1.1-72 +- sybaseASE: Run verify_all() for start operation only +- sybaseASE: add logfile parameter +- galera: set bootstrap attribute before promote +- galera: recover after network split in a 2-node cluster + + Resolves: rhbz#1848025 + Resolves: rhbz#1861001 + Resolves: rhbz#1891835 + Resolves: rhbz#1891855 + * Tue Oct 27 2020 Oyvind Albrigtsen - 4.1.1-71 - redis: parse password correctly based on version - all agents: fix pcs syntax in manpage for pcs 0.10+