30 lines
1.5 KiB
Diff
30 lines
1.5 KiB
Diff
|
From 62a4f7561171328cd1d62cab394d0bba269ea7ad Mon Sep 17 00:00:00 2001
|
||
|
From: Vincent Untz <vuntz@suse.com>
|
||
|
Date: Fri, 8 Dec 2017 13:32:45 +0100
|
||
|
Subject: [PATCH] OCF RA: Avoid promoting nodes with same start time as master
|
||
|
|
||
|
It may happen that two nodes have the same start time, and one of these
|
||
|
is the master. When this happens, the node actually gets the same score
|
||
|
as the master and can get promoted. There's no reason to avoid being
|
||
|
stable here, so let's keep the same master in that scenario.
|
||
|
---
|
||
|
scripts/rabbitmq-server-ha.ocf | 5 +++++
|
||
|
1 file changed, 5 insertions(+)
|
||
|
|
||
|
diff --git a/scripts/rabbitmq-server-ha.ocf b/scripts/rabbitmq-server-ha.ocf
|
||
|
index 87bb7d4..da6aee6 100755
|
||
|
--- a/scripts/rabbitmq-server-ha.ocf
|
||
|
+++ b/scripts/rabbitmq-server-ha.ocf
|
||
|
@@ -1608,6 +1608,11 @@ get_monitor() {
|
||
|
ocf_log info "${LH} comparing us (start time: $our_start_time, score: $new_score) with $node (start time: $node_start_time, score: $node_score)"
|
||
|
if [ $node_start_time -ne 0 -a $node_score -ne 0 -a $node_start_time -lt $our_start_time ]; then
|
||
|
new_score=$((node_score - 10 < new_score ? node_score - 10 : new_score ))
|
||
|
+ elif [ $node_start_time -ne 0 -a $node_score -ne 0 -a $node_start_time -eq $our_start_time ]; then
|
||
|
+ # Do not get promoted if the other node is already master and we have the same start time
|
||
|
+ if is_master $node; then
|
||
|
+ new_score=$((node_score - 10 < new_score ? node_score - 10 : new_score ))
|
||
|
+ fi
|
||
|
fi
|
||
|
done
|
||
|
fi
|