Blame SOURCES/bz1679792-1-votequorum-set-wfa-status-only-on-startup.patch

c6d3cb
From 6894792d76b1e8932bc822bb040933ae17e1a0c7 Mon Sep 17 00:00:00 2001
c6d3cb
From: Jan Friesse <jfriesse@redhat.com>
c6d3cb
Date: Tue, 10 Mar 2020 17:49:27 +0100
c6d3cb
Subject: [PATCH] votequorum: set wfa status only on startup
c6d3cb
c6d3cb
Previously reload of configuration with enabled wait_for_all result in
c6d3cb
set of wait_for_all_status which set cluster_is_quorate to 0 but didn't
c6d3cb
inform the quorum service so votequorum and quorum information may get
c6d3cb
out of sync.
c6d3cb
c6d3cb
Example is 1 node cluster, which is extended to 3 nodes. Quorum service
c6d3cb
reports cluster as a quorate (incorrect) and votequorum as not-quorate
c6d3cb
(correct). Similar behavior happens when extending cluster in general,
c6d3cb
but some configurations are less incorrect (3->4).
c6d3cb
c6d3cb
Discussed solution was to inform quorum service but that would mean
c6d3cb
every reload would cause loss of quorum until all nodes would be seen
c6d3cb
again.
c6d3cb
c6d3cb
Such behaviour is consistent but seems to be a bit too strict.
c6d3cb
c6d3cb
Proposed solution sets wait_for_all_status only on startup and
c6d3cb
doesn't touch it during reload.
c6d3cb
c6d3cb
This solution fulfills requirement of "cluster will be quorate for
c6d3cb
the first time only after all nodes have been visible at least
c6d3cb
once at the same time." because node clears wait_for_all_status only
c6d3cb
after it sees all other nodes or joins cluster which is quorate. It also
c6d3cb
solves problem with extending cluster, because when cluster becomes
c6d3cb
unquorate (1->3) wait_for_all_status is set.
c6d3cb
c6d3cb
Added assert is only for ensure that I haven't missed any case when
c6d3cb
quorate cluster may become unquorate.
c6d3cb
c6d3cb
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
c6d3cb
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
c6d3cb
(cherry picked from commit ca320beac25f82c0c555799e647a47975a333c28)
c6d3cb
---
c6d3cb
 exec/votequorum.c | 6 ++++--
c6d3cb
 1 file changed, 4 insertions(+), 2 deletions(-)
c6d3cb
c6d3cb
diff --git a/exec/votequorum.c b/exec/votequorum.c
c6d3cb
index 1cbbe37..8b96199 100644
c6d3cb
--- a/exec/votequorum.c
c6d3cb
+++ b/exec/votequorum.c
c6d3cb
@@ -1016,7 +1016,7 @@ static void are_we_quorate(unsigned int total_votes)
c6d3cb
 				   "Waiting for all cluster members. "
c6d3cb
 				   "Current votes: %d expected_votes: %d",
c6d3cb
 				   total_votes, us->expected_votes);
c6d3cb
-			cluster_is_quorate = 0;
c6d3cb
+			assert(!cluster_is_quorate);
c6d3cb
 			return;
c6d3cb
 		}
c6d3cb
 		update_wait_for_all_status(0);
c6d3cb
@@ -1548,7 +1548,9 @@ static char *votequorum_readconfig(int runtime)
c6d3cb
 	update_ev_barrier(us->expected_votes);
c6d3cb
 	update_two_node();
c6d3cb
 	if (wait_for_all) {
c6d3cb
-		update_wait_for_all_status(1);
c6d3cb
+		if (!runtime) {
c6d3cb
+			update_wait_for_all_status(1);
c6d3cb
+		}
c6d3cb
 	} else if (wait_for_all_autoset && wait_for_all_status) {
c6d3cb
 		/*
c6d3cb
 		 * Reset wait for all status for consistency when wfa is auto-unset by 2node.
c6d3cb
-- 
c6d3cb
1.8.3.1
c6d3cb