[PATCH 16/21] votequorum: fix regression introduced by 05b4e99a6e (dispatch notifications only once)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

Effectively there are 2 kind of quorum notifications that cannot be merged into 1.

config_change: when the quorum membership changes, triggered by totem/membership changes
               (node join/leave)

quorum_status_changes: same membership node becomes quorate or not.

A quorum status change does not necessarely match a membership change, hence it needs
to be dispatched separately.

An example is a cluster that is not quorate, user changes the amount of votes in a node to
regain quorum. No membership changes happen at this point, but votequorum will
effectively broadcast the votes: XX change and recalculate quorum.
In turn we need to notify quorum users.

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
:100644 100644 88a104c... 1e84df3... M	services/votequorum.c
 services/votequorum.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/services/votequorum.c b/services/votequorum.c
index 88a104c..1e84df3 100644
--- a/services/votequorum.c
+++ b/services/votequorum.c
@@ -666,6 +666,7 @@ static int check_low_node_id_partition(void)
 static void set_quorate(int total_votes)
 {
 	int quorate;
+	int quorum_change = 0;
 
 	ENTER();
 
@@ -699,14 +700,21 @@ static void set_quorate(int total_votes)
 	}
 
 	if (cluster_is_quorate && !quorate) {
+		quorum_change = 1;
 		log_printf(LOGSYS_LEVEL_INFO, "quorum lost, blocking activity\n");
 	}
 	if (!cluster_is_quorate && quorate) {
+		quorum_change = 1;
 		log_printf(LOGSYS_LEVEL_INFO, "quorum regained, resuming activity\n");
 	}
 
 	cluster_is_quorate = quorate;
 
+	if (quorum_change) {
+		set_quorum(quorum_members, quorum_members_entries,
+			   cluster_is_quorate, &quorum_ringid);
+	}
+
 	LEAVE();
 }
 
@@ -1020,7 +1028,9 @@ static void quorum_confchg_fn (
 	}
 
 	memcpy(&quorum_ringid, ring_id, sizeof(*ring_id));
-	set_quorum(quorum_members, quorum_members_entries, cluster_is_quorate, &quorum_ringid);
+
+	set_quorum(quorum_members, quorum_members_entries,
+		   cluster_is_quorate, &quorum_ringid);
 
 	LEAVE();
 }
-- 
1.7.7.5

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux