[PATCH 05/21] votequorum: transmit wait_for_all info in node info message

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

 



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

this is necessary to reset the wait_for_all data when a node is joining a cluster
that has already seen all nodes once.

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
:100644 100644 a11b9b3... 5682522... M	services/votequorum.c
 services/votequorum.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/services/votequorum.c b/services/votequorum.c
index a11b9b3..5682522 100644
--- a/services/votequorum.c
+++ b/services/votequorum.c
@@ -417,6 +417,7 @@ struct req_exec_quorum_nodeinfo {
 	unsigned int patch_version;	/* Backwards/forwards compatible */
 	unsigned int config_version;
 	unsigned int flags;
+	unsigned int wait_for_all;
 
 } __attribute__((packed));
 
@@ -889,6 +890,7 @@ static int quorum_exec_send_nodeinfo()
 	req_exec_quorum_nodeinfo.patch_version = VOTEQUORUM_PATCH_VERSION;
 	req_exec_quorum_nodeinfo.flags = us->flags;
 	req_exec_quorum_nodeinfo.first_trans = first_trans;
+	req_exec_quorum_nodeinfo.wait_for_all = wait_for_all;
 	if (have_disallowed())
 		req_exec_quorum_nodeinfo.flags |= NODE_FLAGS_SEESDISALLOWED;
 
@@ -1007,6 +1009,7 @@ static void exec_votequorum_nodeinfo_endian_convert (void *msg)
 	nodeinfo->patch_version = swab32(nodeinfo->patch_version);
 	nodeinfo->config_version = swab32(nodeinfo->config_version);
 	nodeinfo->flags = swab32(nodeinfo->flags);
+	nodeinfo->wait_for_all = swab32(nodeinfo->wait_for_all);
 }
 
 static void exec_votequorum_reconfigure_endian_convert (void *msg)
@@ -1066,7 +1069,7 @@ static void message_handler_req_exec_votequorum_nodeinfo (
 	node->expected_votes = req_exec_quorum_nodeinfo->expected_votes;
 	node->state = NODESTATE_MEMBER;
 
-	log_printf(LOGSYS_LEVEL_DEBUG, "nodeinfo message: votes: %d, expected:%d\n", req_exec_quorum_nodeinfo->votes, req_exec_quorum_nodeinfo->expected_votes);
+	log_printf(LOGSYS_LEVEL_DEBUG, "nodeinfo message: votes: %d, expected: %d wfa: %d\n", req_exec_quorum_nodeinfo->votes, req_exec_quorum_nodeinfo->expected_votes, req_exec_quorum_nodeinfo->wait_for_all);
 
 	/* Check flags for disallowed (if enabled) */
 	if (quorum_flags & VOTEQUORUM_FLAG_FEATURE_DISALLOWED) {
@@ -1095,6 +1098,10 @@ static void message_handler_req_exec_votequorum_nodeinfo (
 		free(node);
 	}
 
+	if ((wait_for_all) && (!req_exec_quorum_nodeinfo->wait_for_all)) {
+		wait_for_all = 0;
+	}
+
 	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