summaryrefslogtreecommitdiffstats
path: root/daemons/attrd/attrd_elections.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:45:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:45:40 +0000
commit07d7f4cfa4b10de87a31b68191036ff446add675 (patch)
tree7162524d8aaf1aef62d2f4fa51f595ed113981ff /daemons/attrd/attrd_elections.c
parentAdding upstream version 2.1.6. (diff)
downloadpacemaker-07d7f4cfa4b10de87a31b68191036ff446add675.tar.xz
pacemaker-07d7f4cfa4b10de87a31b68191036ff446add675.zip
Adding upstream version 2.1.7.upstream/2.1.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemons/attrd/attrd_elections.c')
-rw-r--r--daemons/attrd/attrd_elections.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/daemons/attrd/attrd_elections.c b/daemons/attrd/attrd_elections.c
index 3b6b55a..82fbe8a 100644
--- a/daemons/attrd/attrd_elections.c
+++ b/daemons/attrd/attrd_elections.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2022 the Pacemaker project contributors
+ * Copyright 2013-2023 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -25,9 +25,11 @@ attrd_election_cb(gpointer user_data)
/* Update the peers after an election */
attrd_peer_sync(NULL, NULL);
- /* Update the CIB after an election */
- attrd_write_attributes(true, false);
- return FALSE;
+ /* After winning an election, update the CIB with the values of all
+ * attributes as the winner knows them.
+ */
+ attrd_write_attributes(attrd_write_all);
+ return G_SOURCE_REMOVE;
}
void
@@ -48,7 +50,7 @@ attrd_start_election_if_needed(void)
{
if ((peer_writer == NULL)
&& (election_state(writer) != election_in_progress)
- && !attrd_shutting_down()) {
+ && !attrd_shutting_down(false)) {
crm_info("Starting an election to determine the writer");
election_vote(writer);
@@ -70,7 +72,7 @@ attrd_handle_election_op(const crm_node_t *peer, xmlNode *xml)
crm_xml_add(xml, F_CRM_HOST_FROM, peer->uname);
// Don't become writer if we're shutting down
- rc = election_count_vote(writer, xml, !attrd_shutting_down());
+ rc = election_count_vote(writer, xml, !attrd_shutting_down(false));
switch(rc) {
case election_start: