Blob Blame History Raw
From 314a01c98e5f98ff686333966dbe675935b7b6a8 Mon Sep 17 00:00:00 2001
From: Christine Caulfield <ccaulfie@redhat.com>
Date: Mon, 2 Mar 2015 15:48:01 +0000
Subject: [PATCH] Votequorum: Fix auto_tie_breaker default

The default for auto_tie_breaker should be 'lowest' - which is what it
was before the extended ATB functionality of auto_tie_breaker_node was
added, and what the documentation states.

However this was broken so that if auto_tie_breaker_node was not
specified then auto_tie_breaker itself was ignored. This patch fixes
that.

It also fixes a typo in a comment.

Signed-Off-By: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
---
 exec/votequorum.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/exec/votequorum.c b/exec/votequorum.c
index 6caccaf..3757b53 100644
--- a/exec/votequorum.c
+++ b/exec/votequorum.c
@@ -628,7 +628,7 @@ static int is_in_nodelist(int nodeid, unsigned int *members, int entries)
 }
 
 /*
- * The algorithm for a list of time-breaker nodes is:
+ * The algorithm for a list of tie-breaker nodes is:
  * travel the list of nodes in the auto_tie_breaker list,
  * if the node IS in our current partition, check if the
  * nodes earlier in the atb list are in the 'previous' partition;
@@ -1290,7 +1290,12 @@ static char *votequorum_readconfig(int runtime)
 		icmap_get_uint8("quorum.auto_tie_breaker", &atb);
 		icmap_get_string("quorum.auto_tie_breaker_node", &atb_string);
 
-		if (!atb) {
+		/* auto_tie_breaker defaults to LOWEST */
+		if (atb) {
+		    auto_tie_breaker = ATB_LOWEST;
+		    icmap_set_uint32("runtime.votequorum.atb_type", auto_tie_breaker);
+		}
+		else {
 			auto_tie_breaker = ATB_NONE;
 			if (atb_string) {
 				log_printf(LOGSYS_LEVEL_WARNING,
-- 
1.7.1