|
|
79554c |
From a6b40d102e24134a3e5e99a63bd3636aebc2145a Mon Sep 17 00:00:00 2001
|
|
|
79554c |
From: Damien Ciabrini <dciabrin@redhat.com>
|
|
|
79554c |
Date: Thu, 13 Apr 2017 08:51:39 +0200
|
|
|
79554c |
Subject: [PATCH] galera: fix master target during promotion with
|
|
|
79554c |
cluster_host_map
|
|
|
79554c |
|
|
|
79554c |
When option cluster_host_map is in use, it is assumed that galera node
|
|
|
79554c |
names map to pacemaker node names _because_ those galera names are not
|
|
|
79554c |
part of the pacemaker cluster in the first place.
|
|
|
79554c |
|
|
|
79554c |
This is not always the case (e.g. when using pacemaker bundles), so
|
|
|
79554c |
fix accordingly.
|
|
|
79554c |
---
|
|
|
79554c |
heartbeat/galera | 11 +++++++++--
|
|
|
79554c |
1 file changed, 9 insertions(+), 2 deletions(-)
|
|
|
79554c |
|
|
|
79554c |
diff --git a/heartbeat/galera b/heartbeat/galera
|
|
|
79554c |
index 475a8ba..32c4222 100755
|
|
|
79554c |
--- a/heartbeat/galera
|
|
|
79554c |
+++ b/heartbeat/galera
|
|
|
79554c |
@@ -415,6 +415,13 @@ promote_everyone()
|
|
|
79554c |
{
|
|
|
79554c |
|
|
|
79554c |
for node in $(echo "$OCF_RESKEY_wsrep_cluster_address" | sed 's/gcomm:\/\///g' | tr -d ' ' | tr -s ',' ' '); do
|
|
|
79554c |
+ local pcmk_node=$(galera_to_pcmk_name $node)
|
|
|
79554c |
+ if [ -z "$pcmk_node" ]; then
|
|
|
79554c |
+ ocf_log err "Could not determine pacemaker node from galera name <${node}>."
|
|
|
79554c |
+ return
|
|
|
79554c |
+ else
|
|
|
79554c |
+ node=$pcmk_node
|
|
|
79554c |
+ fi
|
|
|
79554c |
|
|
|
79554c |
set_master_score $node
|
|
|
79554c |
done
|
|
|
79554c |
@@ -463,7 +470,7 @@ detect_first_master()
|
|
|
79554c |
best_node_gcomm=$(echo "$all_nodes" | sed 's/^.* \(.*\)$/\1/')
|
|
|
79554c |
best_node=$(galera_to_pcmk_name $best_node_gcomm)
|
|
|
79554c |
if [ -z "$best_node" ]; then
|
|
|
79554c |
- ocf_log error "Could not determine initial best node from galera name <${best_node_gcomm}>."
|
|
|
79554c |
+ ocf_log err "Could not determine initial best node from galera name <${best_node_gcomm}>."
|
|
|
79554c |
return
|
|
|
79554c |
fi
|
|
|
79554c |
|
|
|
79554c |
@@ -471,7 +478,7 @@ detect_first_master()
|
|
|
79554c |
for node in $all_nodes; do
|
|
|
79554c |
local pcmk_node=$(galera_to_pcmk_name $node)
|
|
|
79554c |
if [ -z "$pcmk_node" ]; then
|
|
|
79554c |
- ocf_log error "Could not determine pacemaker node from galera name <${node}>."
|
|
|
79554c |
+ ocf_log err "Could not determine pacemaker node from galera name <${node}>."
|
|
|
79554c |
return
|
|
|
79554c |
else
|
|
|
79554c |
node=$pcmk_node
|