1VOTEQUORUM_INITIALICZoEr(o3s)ync Cluster Engine Programmer'sVMOaTnEuQaUlORUM_INITIALIZE(3)
2
3
4

NAME

6       votequorum_initialize  - Create a new connection to the VoteQuorum ser‐
7       vice
8

SYNOPSIS

10       #include <corosync/votequorum.h>
11
12       int votequorum_initialize(votequorum_handle_t *handle, votequorum_call‐
13       backs_t *callbacks);
14

DESCRIPTION

16       The  votequorum_initialize  function is used to initialize a connection
17       to the vote-based quorum database API.
18
19       Each application may have several connections to  the  votequorum  API.
20       Each application uses the handle argument to uniquely identify the con‐
21       nection.  The handle argument is then used in other function  calls  to
22       identify  the connection to be used for communication with the votequo‐
23       rum service.
24
25       Every time the voting configuration is about to change (eg a node joins
26       or  leave  the cluster), the callback is called.  The callback function
27       is described by the following type definitions:
28
29       typedef void (*votequorum_nodelist_notification_fn_t) (
30            votequorum_handle_t handle,
31            uint64_t context,
32            uint32_t node_list_entries,
33            uint32_t node_list[]
34            );
35
36
37       Current ring_id (one get in votequorum_quorum_notification_fn) must  be
38       passed to votequorum_qdevice_poll to make qdevice voting valid.
39
40
41       Every time the quorum state changes (eg a node joins or leave the clus‐
42       ter), the callback is called.  The callback function  is  described  by
43       the following type definitions:
44
45       typedef void (*votequorum_quorum_notification_fn_t) (
46            votequorum_handle_t handle,
47            uint64_t context,
48            uint32_t quorate,
49            uint32_t node_list_entries,
50            votequorum_node_t node_list[]
51            );
52
53
54       The  difference between votequorum_nodelist_notification_t and votequo‐
55       rum_quorum_notification_t is  subtle  but  important.   The  'nodelist'
56       callback  is  sent  at the start of a cluster state transition and con‐
57       tains the new ring_id and only the list of nodes that are  included  in
58       the  sync  state  -  ie  only  active  nodes.  No quorum information is
59       included this callback because it is not available at that  time.   The
60       'quorum'  callback  is sent after the cluster state transition has com‐
61       pleted and does contain quorum information.  In addition, the  nodelist
62       contains  a  list of all nodes known to votequorum (whether up or down)
63       and their state as well as information about the quorum device attached
64       (if  any).  Quorum  callbacks  will not be sent for qdevice up and down
65       events unless they affect quorum.
66
67
68       Every time the expected votes are changed, the callback is called.  The
69       expected  votes  callback  function  is described by the following type
70       definitions:
71
72       typedef void (*votequorum_expectedvotes_notification_fn_t) (
73               votequorum_handle_t handle,
74               uint64_t context,
75               uint32_t expected_votes);
76
77       The callbacks argument is of the type:
78
79       typedef struct {
80            votequorum_quorum_notification_fn_t votequorum_quorum_notify_fn;
81            votequorum_expectedvotes_notification_fn_t votequorum_expectedvotes_notify_fn;
82            votequorum_nodelist_notification_fn_t votequorum_nodelist_notify_fn;
83       } votequorum_callbacks_t;
84
85       When a configuration change occurs, the callback  is  called  from  the
86       votequorum_dispatch() function.
87

RETURN VALUE

89       This  call returns the CS_OK value if successful, otherwise an error is
90       returned.
91

ERRORS

93       CS_ERR_TRY_AGAIN Resource temporarily unavailable
94
95       CS_ERR_INVALID_PARAM Invalid argument
96
97       CS_ERR_ACCESS Permission denied
98
99       CS_ERR_LIBRARY The connection failed
100
101       CS_ERR_INTERRUPT System call interrupted by a signal
102
103       CS_ERR_NOT_SUPPORTED The requested protocol/functionality not supported
104
105       CS_ERR_MESSAGE_ERROR Incorrect auth message received
106
107       CS_ERR_NO_MEMORY Not enough memory to complete the requested task
108
109

SEE ALSO

111       votequorum_overview(8), votequorum_finalize(3),  votequorum_getinfo(3),
112       votequorum_trackstart(3),       votequorum_trackstop(3),       votequo‐
113       rum_fd_get(3), votequorum_dispatch(3), votequorum_context_set(3), vote‐
114       quorum_context_get(3),        votequorum_setexpected(3),       votequo‐
115       rum_setvotes(3)
116
117corosync Man Page                 2018-10-30          VOTEQUORUM_INITIALIZE(3)
Impressum