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

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