corosync  2.3.6
Data Structures | Macros | Enumerations | Functions | Variables
exec/votequorum.c File Reference
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdint.h>
#include <unistd.h>
#include <qb/qbipc_common.h>
#include "quorum.h"
#include <corosync/corodefs.h>
#include <corosync/list.h>
#include <corosync/logsys.h>
#include <corosync/coroapi.h>
#include <corosync/icmap.h>
#include <corosync/votequorum.h>
#include <corosync/ipc_votequorum.h>
#include "service.h"
#include "util.h"
#include "votequorum.h"
Include dependency graph for exec/votequorum.c:

Go to the source code of this file.

Data Structures

struct  req_exec_quorum_nodeinfo
 
struct  req_exec_quorum_reconfigure
 
struct  req_exec_quorum_qdevice_reg
 
struct  req_exec_quorum_qdevice_reconfigure
 
struct  cluster_node
 
struct  quorum_pd
 

Macros

#define DEFAULT_LMS_WIN   10000
 
#define MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO   0
 
#define MESSAGE_REQ_EXEC_VOTEQUORUM_RECONFIGURE   1
 
#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG   2
 
#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_RECONFIGURE   3
 
#define VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES   1
 
#define VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES   2
 
#define VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA   3
 
#define VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER   0
 
#define VOTEQUORUM_QDEVICE_OPERATION_REGISTER   1
 
#define NODE_FLAGS_QUORATE   1
 
#define NODE_FLAGS_LEAVING   2
 
#define NODE_FLAGS_WFASTATUS   4
 
#define NODE_FLAGS_FIRST   8
 
#define NODE_FLAGS_QDEVICE_REGISTERED   16
 
#define NODE_FLAGS_QDEVICE_ALIVE   32
 
#define NODE_FLAGS_QDEVICE_CAST_VOTE   64
 
#define NODE_FLAGS_QDEVICE_MASTER_WINS   128
 
#define max(a, b)   (((a) > (b)) ? (a) : (b))
 
#define list_iterate(v, head)   for (v = (head)->next; v != head; v = v->next)
 
#define VOTEQUORUM_READCONFIG_STARTUP   0
 
#define VOTEQUORUM_READCONFIG_RUNTIME   1
 

Enumerations

enum  { ATB_NONE, ATB_LOWEST, ATB_HIGHEST, ATB_LIST }
 
enum  nodestate_t { NODESTATE_MEMBER =1, NODESTATE_DEAD, NODESTATE_LEAVING }
 

Functions

 LOGSYS_DECLARE_SUBSYS ("VOTEQ")
 
struct req_exec_quorum_nodeinfo __attribute__ ((packed))
 
struct qb_ipc_request_header header __attribute__ ((aligned(8)))
 
struct corosync_service_enginevotequorum_get_service_engine_ver0 (void)
 
char * votequorum_init (struct corosync_api_v1 *api, quorum_set_quorate_fn_t q_set_quorate_fn)
 

Variables

typedef __attribute__
 
uint32_t nodeid
 
uint32_t votes
 
uint32_t expected_votes
 
uint32_t flags
 
uint32_t value
 
uint8_t param
 
uint8_t _pad0
 
uint8_t _pad1
 
uint8_t _pad2
 
uint32_t operation
 
char oldname [VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
 
char newname [VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
 

Macro Definition Documentation

#define DEFAULT_LMS_WIN   10000

Definition at line 88 of file exec/votequorum.c.

#define list_iterate (   v,
  head 
)    for (v = (head)->next; v != head; v = v->next)

Definition at line 433 of file exec/votequorum.c.

Referenced by votequorum_init().

#define max (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 431 of file exec/votequorum.c.

Referenced by corosync_service_link_and_init(), and votequorum_init().

#define MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO   0

Definition at line 143 of file exec/votequorum.c.

#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_RECONFIGURE   3

Definition at line 146 of file exec/votequorum.c.

#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG   2

Definition at line 145 of file exec/votequorum.c.

#define MESSAGE_REQ_EXEC_VOTEQUORUM_RECONFIGURE   1

Definition at line 144 of file exec/votequorum.c.

#define NODE_FLAGS_FIRST   8

Definition at line 170 of file exec/votequorum.c.

#define NODE_FLAGS_LEAVING   2

Definition at line 168 of file exec/votequorum.c.

#define NODE_FLAGS_QDEVICE_ALIVE   32

Definition at line 172 of file exec/votequorum.c.

Referenced by votequorum_init().

#define NODE_FLAGS_QDEVICE_CAST_VOTE   64

Definition at line 173 of file exec/votequorum.c.

Referenced by votequorum_init().

#define NODE_FLAGS_QDEVICE_MASTER_WINS   128

Definition at line 174 of file exec/votequorum.c.

Referenced by votequorum_init().

#define NODE_FLAGS_QDEVICE_REGISTERED   16

Definition at line 171 of file exec/votequorum.c.

Referenced by votequorum_init().

#define NODE_FLAGS_QUORATE   1

Definition at line 167 of file exec/votequorum.c.

#define NODE_FLAGS_WFASTATUS   4

Definition at line 169 of file exec/votequorum.c.

#define VOTEQUORUM_QDEVICE_OPERATION_REGISTER   1

Definition at line 161 of file exec/votequorum.c.

Referenced by votequorum_init().

#define VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER   0

Definition at line 160 of file exec/votequorum.c.

Referenced by votequorum_init().

#define VOTEQUORUM_READCONFIG_RUNTIME   1

Definition at line 1224 of file exec/votequorum.c.

#define VOTEQUORUM_READCONFIG_STARTUP   0

Definition at line 1223 of file exec/votequorum.c.

#define VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA   3

Definition at line 153 of file exec/votequorum.c.

#define VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES   1

Definition at line 151 of file exec/votequorum.c.

Referenced by votequorum_init().

#define VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES   2

Definition at line 152 of file exec/votequorum.c.

Referenced by votequorum_init().

Enumeration Type Documentation

anonymous enum
Enumerator
ATB_NONE 
ATB_LOWEST 
ATB_HIGHEST 
ATB_LIST 

Definition at line 84 of file exec/votequorum.c.

Enumerator
NODESTATE_MEMBER 
NODESTATE_DEAD 
NODESTATE_LEAVING 

Definition at line 176 of file exec/votequorum.c.

Function Documentation

struct req_exec_quorum_nodeinfo __attribute__ ( (packed)  )
struct qb_ipc_request_header header __attribute__::__attribute__ ( (aligned(8))  )
LOGSYS_DECLARE_SUBSYS ( "VOTEQ"  )
struct corosync_service_engine* votequorum_get_service_engine_ver0 ( void  )

Definition at line 414 of file exec/votequorum.c.

References default_service::name.

char* votequorum_init ( struct corosync_api_v1 api,
quorum_set_quorate_fn_t  q_set_quorate_fn 
)

Definition at line 2392 of file exec/votequorum.c.

References req_lib_votequorum_qdevice_master_wins::allow, ATB_NONE, req_lib_votequorum_qdevice_poll::cast_vote, quorum_pd::conn, req_lib_votequorum_trackstart::context, corosync_service_link_and_init(), CS_ERR_ACCESS, CS_ERR_EXIST, CS_ERR_INVALID_PARAM, CS_ERR_MESSAGE_ERROR, CS_ERR_NAME_NOT_FOUND, CS_ERR_NOT_EXIST, CS_ERR_TRY_AGAIN, CS_OK, CS_TRACK_CHANGES, CS_TRACK_CHANGES_ONLY, CS_TRACK_CURRENT, ENTER, req_lib_votequorum_setexpected::expected_votes, cluster_node::expected_votes, res_lib_votequorum_getinfo::expected_votes, cluster_node::flags, res_lib_votequorum_getinfo::flags, res_lib_votequorum_getinfo::highest_expected, corosync_api_v1::ipc_private_data_get, corosync_api_v1::ipc_response_send, LEAVE, quorum_pd::list, list_entry, list_iterate, log_printf, LOGSYS_LEVEL_DEBUG, LOGSYS_LEVEL_INFO, LOGSYS_LEVEL_WARNING, max, MESSAGE_RES_VOTEQUORUM_GETINFO, MESSAGE_RES_VOTEQUORUM_STATUS, req_lib_votequorum_qdevice_register::name, req_lib_votequorum_qdevice_unregister::name, req_lib_votequorum_qdevice_poll::name, req_lib_votequorum_qdevice_master_wins::name, req_lib_votequorum_qdevice_update::newname, NODE_FLAGS_QDEVICE_ALIVE, NODE_FLAGS_QDEVICE_CAST_VOTE, NODE_FLAGS_QDEVICE_MASTER_WINS, NODE_FLAGS_QDEVICE_REGISTERED, cluster_node::node_id, req_exec_quorum_nodeinfo::nodeid, totem_ip_address::nodeid, req_lib_votequorum_setvotes::nodeid, req_lib_votequorum_getinfo::nodeid, res_lib_votequorum_getinfo::nodeid, NODESTATE_DEAD, NODESTATE_LEAVING, NODESTATE_MEMBER, req_lib_votequorum_qdevice_update::oldname, res_lib_votequorum_getinfo::qdevice_name, res_lib_votequorum_getinfo::qdevice_votes, res_lib_votequorum_getinfo::quorum, memb_ring_id::rep, memb_ring_id::seq, cluster_node::state, res_lib_votequorum_getinfo::state, corosync_api_v1::timer_add_duration, corosync_api_v1::timer_delete, res_lib_votequorum_getinfo::total_votes, req_lib_votequorum_trackstart::track_flags, quorum_pd::track_flags, quorum_pd::tracking_context, quorum_pd::tracking_enabled, VOTEQUORUM_INFO_ALLOW_DOWNSCALE, VOTEQUORUM_INFO_AUTO_TIE_BREAKER, VOTEQUORUM_INFO_LAST_MAN_STANDING, VOTEQUORUM_INFO_QDEVICE_ALIVE, VOTEQUORUM_INFO_QDEVICE_CAST_VOTE, VOTEQUORUM_INFO_QDEVICE_MASTER_WINS, VOTEQUORUM_INFO_QDEVICE_REGISTERED, VOTEQUORUM_INFO_QUORATE, VOTEQUORUM_INFO_TWONODE, VOTEQUORUM_INFO_WAIT_FOR_ALL, VOTEQUORUM_NODESTATE_DEAD, VOTEQUORUM_NODESTATE_LEAVING, VOTEQUORUM_NODESTATE_MEMBER, VOTEQUORUM_QDEVICE_MAX_NAME_LEN, VOTEQUORUM_QDEVICE_NODEID, VOTEQUORUM_QDEVICE_OPERATION_REGISTER, VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER, VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES, VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES, req_lib_votequorum_setvotes::votes, cluster_node::votes, and res_lib_votequorum_getinfo::votes.

Referenced by vsf_quorum_get_service_engine_ver0().

Variable Documentation

struct qb_ipc_request_header header __attribute__
uint8_t _pad0

Definition at line 102 of file exec/votequorum.c.

uint8_t _pad1

Definition at line 103 of file exec/votequorum.c.

uint8_t _pad2

Definition at line 104 of file exec/votequorum.c.

uint32_t expected_votes

Definition at line 101 of file exec/votequorum.c.

Referenced by votequorum_setexpected().

uint32_t flags

Definition at line 100 of file exec/votequorum.c.

uint32_t nodeid

Definition at line 99 of file exec/votequorum.c.

Definition at line 99 of file exec/votequorum.c.

uint32_t operation

Definition at line 99 of file exec/votequorum.c.

uint8_t param

Definition at line 101 of file exec/votequorum.c.

Referenced by totem_config_keyread().

uint32_t value

Definition at line 100 of file exec/votequorum.c.

Referenced by cmap_get(), and totemsrp_avail().

uint32_t votes

Definition at line 100 of file exec/votequorum.c.

Referenced by votequorum_setvotes().