Jelajahi Sumber

votequorum: Don't send multiple callbacks when nodes join

This patch aligns the votequorum callbacks so that they are
the same as the quorum ones. Previously it was quite common
for votequorum to send one callback for every node in the cluster
when a single new node joined (because it sent one for every
nodeinfo message it received).

This new system makes much more sense in itself and being
consistent with the internal quorum is also an advantage!

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Christine Caulfield 10 tahun lalu
induk
melakukan
a71ec5d95d
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      exec/votequorum.c

+ 3 - 2
exec/votequorum.c

@@ -1054,6 +1054,7 @@ static void are_we_quorate(unsigned int total_votes)
 	    (sync_in_progress == 0)) {
 		quorum_callback(quorum_members, quorum_members_entries,
 				cluster_is_quorate, &quorum_ringid);
+		votequorum_exec_send_quorum_notification(NULL, 0L);
 	}
 
 	LEAVE();
@@ -1120,8 +1121,6 @@ static void recalculate_quorum(int allow_decrease, int by_current_nodes)
 	quorum = calculate_quorum(allow_decrease, cluster_members, &total_votes);
 	are_we_quorate(total_votes);
 
-	votequorum_exec_send_quorum_notification(NULL, 0L);
-
 	LEAVE();
 }
 
@@ -2352,6 +2351,8 @@ static void votequorum_sync_activate (void)
 	recalculate_quorum(0, 0);
 	quorum_callback(quorum_members, quorum_members_entries,
 			cluster_is_quorate, &quorum_ringid);
+	votequorum_exec_send_quorum_notification(NULL, 0L);
+
 	sync_in_progress = 0;
 }