pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
election_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2024 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#ifndef PCMK__CRM_CLUSTER_ELECTION_INTERNAL__H
11#define PCMK__CRM_CLUSTER_ELECTION_INTERNAL__H
12
13#include <stdbool.h> // bool
14
15#include <glib.h> // guint, GSourceFunc
16#include <libxml/tree.h> // xmlNode
17
18#include <crm/common/ipc.h> // enum pcmk_ipc_server
19#include <crm/cluster.h> // pcmk_cluster_t
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
64// Possible election results
66 election_start = 0, // New election needed
67 election_in_progress, // Election started but not all peers have voted
68 election_lost, // Local node lost most recent election
69 election_won, // Local node won most recent election
70 election_error, // Election message or object invalid
71};
72
73void election_reset(pcmk_cluster_t *cluster);
74void election_init(pcmk_cluster_t *cluster, void (*cb)(pcmk_cluster_t *));
75
76void election_timeout_set_period(pcmk_cluster_t *cluster, guint period_ms);
78
79void election_vote(pcmk_cluster_t *cluster);
80bool election_check(pcmk_cluster_t *cluster);
81void election_remove(pcmk_cluster_t *cluster, const char *uname);
84 const xmlNode *message, bool can_win);
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif // PCMK__CRM_CLUSTER_ELECTION_INTERNAL__H
char uname[MAX_NAME]
Definition cpg.c:5
void election_vote(pcmk_cluster_t *cluster)
Definition election.c:278
election_result
@ election_won
@ election_error
@ election_lost
@ election_in_progress
@ election_start
void election_init(pcmk_cluster_t *cluster, void(*cb)(pcmk_cluster_t *))
Definition election.c:92
bool election_check(pcmk_cluster_t *cluster)
Definition election.c:344
void election_reset(pcmk_cluster_t *cluster)
Definition election.c:134
enum election_result election_state(const pcmk_cluster_t *cluster)
Definition election.c:67
void election_clear_dampening(pcmk_cluster_t *cluster)
Definition election.c:734
enum election_result election_count_vote(pcmk_cluster_t *cluster, const xmlNode *message, bool can_win)
Definition election.c:524
void election_timeout_set_period(pcmk_cluster_t *cluster, guint period_ms)
Definition election.c:195
void election_timeout_stop(pcmk_cluster_t *cluster)
Definition election.c:180
void election_remove(pcmk_cluster_t *cluster, const char *uname)
Definition election.c:118
IPC interface to Pacemaker daemons.