MySQL  8.0.19
Source Code Documentation
xcom_base.h
Go to the documentation of this file.
1 /* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef XCOM_BASE_H
24 #define XCOM_BASE_H
25 
26 #include <stdbool.h>
27 #include <stddef.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #ifndef _WIN32
34 #include <netdb.h>
35 #endif
36 
43 
44 #define XCOM_THREAD_DEBUG 1
45 
46 typedef unsigned long long synode_cnt;
47 
48 #define SET_EXECUTED_MSG(x) \
49  do { \
50  MAY_DBG(FN); \
51  set_executed_msg(x); \
52  } while (0)
53 
54 /* {{{ Constants */
55 
56 #ifdef XCOM_TRANSACTIONS
57 static trans_id const last_trans = {0xffffffff, 0xffffffff};
58 
59 #endif
60 
61 /* }}} */
62 
63 extern int ARBITRATOR_HACK;
64 extern task_arg null_arg;
65 
66 void *xcom_thread_main(void *cp);
67 
68 synode_no vp_count_to_synode(u_long high, u_long low, node_no nodeid,
69  uint32_t groupid);
70 
71 synode_no incr_synode(synode_no synode);
72 
73 synode_no decr_synode(synode_no synode);
74 
76 char *dbg_pax_msg(pax_msg const *p);
77 pax_msg *dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue);
78 synode_no set_executed_msg(synode_no msgno);
79 void request_values(synode_no find, synode_no end);
80 void set_group(uint32_t id);
81 void check_tasks();
82 int xcom_booted();
83 int iamthegreatest(site_def const *s);
84 void xcom_send(app_data_ptr a, pax_msg *msg);
85 void deliver_view_msg(site_def const *site);
88 synode_no get_max_synode();
89 void xcom_thread_deinit();
90 int taskmain(xcom_port listen_port);
91 void xcom_thread_init();
92 site_def *install_node_group(app_data_ptr a);
93 int xcom_taskmain(xcom_port listen_port);
94 int xcom_taskmain2(xcom_port listen_port);
95 void set_max_synode(synode_no synode);
96 synode_no set_current_message(synode_no msgno);
97 
98 void xcom_send_data(uint32_t size, char *data);
99 
102 int is_real_recover(app_data_ptr a);
103 
104 void init_xcom_base();
105 void set_force_recover(bool_t const x);
106 void add_to_cache(app_data_ptr a, synode_no synode);
107 uint32_t new_id();
108 synode_no get_boot_key();
109 site_def const *get_executor_site();
110 site_def const *get_proposer_site();
111 synode_no get_current_message();
112 void start_run_tasks();
113 
114 int is_node_v4_reachable(char *node_address);
115 int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info);
116 int are_we_allowed_to_upgrade_to_v6(app_data_ptr a);
117 struct addrinfo *does_node_have_v4_address(struct addrinfo *retrieved);
118 
119 #define RESET_CLIENT_MSG \
120  if (ep->client_msg) { \
121  msg_link_delete(&ep->client_msg); \
122  }
123 
124 #define APP ep->client_msg->p->a
125 
126 #define XAPP ep->p->learner.msg->a
127 
128 #define FIND_MAX (MIN_LENGTH / 10)
129 
130 /* Set type and object pointer */
131 #define PLP msg->payload.manager_message_payload_u
132 #define SET_REP_TYPE(quark, ptr) \
133  q = (quark); \
134  object = PLP.ptr
135 
136 #define x_state_list \
137  X(x_start) \
138  X(x_boot) X(x_recover) X(x_run) X(x_done) X(x_snapshot_wait) X(x_recover_wait)
139 #define x_actions \
140  X(xa_wait) \
141  X(xa_poll) \
142  X(xa_init) \
143  X(xa_u_boot) \
144  X(xa_add) \
145  X(xa_net_boot) \
146  X(xa_force_config) \
147  X(xa_snapshot) \
148  X(xa_snapshot_wait) \
149  X(xa_need_snapshot) X(xa_complete) X(xa_terminate) X(xa_exit) X(xa_timeout)
150 #define X(a) a,
152 typedef enum xcom_state xcom_state;
153 
156 #undef X
157 
158 extern const char *xcom_state_name[];
159 
160 extern const char *xcom_actions_name[];
161 
162 struct add_args {
163  char *addr;
165  node_list *nl;
166 };
167 typedef struct add_args add_args;
168 
170 
171 void xcom_add_node(char *addr, xcom_port port, node_list *nl);
172 
173 xcom_state xcom_fsm(xcom_actions action, task_arg fsmargs);
175 
176 void site_install_action(site_def *site, cargo_type operation);
177 void send_client_add_node(char *srv, xcom_port port, node_list *nl);
178 void send_client_remove_node(char *srv, xcom_port port, node_list *nl);
179 
180 typedef void (*xcom_data_receiver)(synode_no message_id, node_set nodes,
181  u_int size, synode_no last_removed,
182  char *data);
184 
185 typedef void (*xcom_local_view_receiver)(synode_no message_id, node_set nodes);
187 
188 typedef void (*xcom_global_view_receiver)(synode_no config_id,
189  synode_no message_id, node_set nodes,
190  xcom_event_horizon);
192 
196 
197 typedef void (*app_snap_handler)(blob *gcs_snap);
199 
200 typedef synode_no (*app_snap_getter)(blob *gcs_snap);
202 
203 typedef void (*xcom_state_change_cb)(int status);
208 
209 typedef int (*should_exit_getter)();
211 
212 app_data_ptr init_config_with_group(app_data *a, node_list *nl, cargo_type type,
213  uint32_t group_id);
214 app_data_ptr init_set_event_horizon_msg(app_data *a, uint32_t group_id,
215  xcom_event_horizon event_horizon);
216 app_data_ptr init_set_cache_size_msg(app_data *a, uint64_t cache_limit);
217 app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id);
218 app_data_ptr init_app_msg(app_data *a, char *payload, u_int payload_size);
219 app_data_ptr init_terminate_command(app_data *a);
220 
221 void terminate_and_exit();
222 
223 /* Hook the logic to pop from the input channel. */
226 /* Create a connection to the input channel's signalling socket. */
227 bool xcom_input_new_signal_connection(char const *address, xcom_port port);
228 /* Signal that the input channel has commands. */
229 bool xcom_input_signal(void);
230 /* Destroy the connection to the input channel's signalling socket. */
232 
233 /*
234  Registers a callback that is called right after
235  the accept routine returns.
236  */
237 typedef int (*xcom_socket_accept_cb)(int fd, site_def const *config);
239 
241  xcom_port port);
243 
246 int xcom_client_add_node(connection_descriptor *fd, node_list *nl,
247  uint32_t group_id);
248 int xcom_client_boot(connection_descriptor *fd, node_list *nl,
249  uint32_t group_id);
251  uint32_t group_id);
253  uint32_t group_id);
255  uint32_t group_id);
257  uint32_t group_id);
259 int64_t xcom_client_send_data(uint32_t size, char *data,
261 xcom_event_horizon xcom_get_minimum_event_horizon();
262 xcom_event_horizon xcom_get_maximum_event_horizon();
263 int xcom_client_get_event_horizon(connection_descriptor *fd, uint32_t group_id,
264  xcom_event_horizon *event_horizon);
265 int xcom_client_set_event_horizon(connection_descriptor *fd, uint32_t group_id,
266  xcom_event_horizon event_horizon);
269  uint64_t cache_limit);
271  uint32_t group_id,
272  synode_no_array *const synodes,
273  synode_app_data_array *const reply);
275 int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a,
276  int force);
277 
278 struct pax_machine;
279 typedef struct pax_machine pax_machine;
280 
281 /**
282  Copies app data @c source into @c target and checks if the copy
283  succeeded. Sets *target to NULL if the copy fails.
284 
285  @param[in, out] target The pax_msg to which the app_data will be copied.
286  @param source The app data that will be copied.
287  @retval TRUE if the copy was successful.
288  @retval FALSE if the copy failed, in which case *target is set to NULL;
289  a failed copy means that there was an error allocating memory for
290  the copy.
291 */
292 bool_t safe_app_data_copy(pax_msg **target, app_data_ptr source);
293 
294 /**
295  * Initializes the message @c msg to go through a 3-phase, regular Paxos.
296  * Executed by Proposers.
297  *
298  * @param site XCom configuration
299  * @param p Paxos instance
300  * @param msg Message to send
301  * @param msgno Synode where @c msg will be proposed
302  * @param msg_type The type of the message, e.g. normal or no_op
303  */
304 void prepare_push_3p(site_def const *site, pax_machine *p, pax_msg *msg,
305  synode_no msgno, pax_msg_type msg_type);
306 /**
307  * Initializes the message @c p as a Prepare message, as in the message for
308  * Phase 1 (a) of the Paxos protocol.
309  * Executed by Proposers.
310  *
311  * @param p The message to send
312  */
313 void init_prepare_msg(pax_msg *p);
314 /**
315  * Initializes the message @c p as a Prepare message for a no-op, as in the
316  * message for Phase 1 (a) of the Paxos protocol.
317  * Executed by Proposers.
318  *
319  * @param p The no-op message to send
320  * @retval created paxos message of type no_op
321  */
322 pax_msg *create_noop(pax_msg *p);
323 /**
324  * Process the incoming Prepare message from a Proposer, as in the message for
325  * Phase 1 (a) of the Paxos protocol.
326  * Executed by Acceptors.
327  *
328  * @param p Paxos instance
329  * @param pm Incoming Prepare message
330  * @param synode Synode of the Paxos instance/Accept message
331  * @retval pax_msg* the reply to send to the Proposer (as in the Phase 1 (b)
332  * message of the Paxos protocol) if the Acceptor accepts the Prepare
333  * @retval NULL otherwise
334  */
335 pax_msg *handle_simple_prepare(pax_machine *p, pax_msg *pm, synode_no synode);
336 /**
337  * Process the incoming acknowledge from an Acceptor to a sent Prepare, as in
338  * the message for Phase 1 (b) of the Paxos protocol.
339  * Executed by Proposers.
340  *
341  * @param site XCom configuration
342  * @param p Paxos instance
343  * @param m Incoming message
344  * @retval TRUE if a majority of Acceptors replied to the Proposer's Prepare
345  * @retval FALSE otherwise
346  */
348  pax_msg *m);
349 /**
350  * Initializes the proposer's message to go through a 2-phase Paxos on the
351  * proposer's reserved ballot (0,_).
352  * Executed by Proposers.
353  *
354  * @param site XCom configuration
355  * @param p Paxos instance
356  */
357 void prepare_push_2p(site_def const *site, pax_machine *p);
358 /**
359  * Initializes the message @c p as an Accept message, as in the message for
360  * Phase 2 (a) of the Paxos protocol.
361  * Executed by Proposers.
362  *
363  * @param p The message to send
364  */
365 void init_propose_msg(pax_msg *p);
366 /**
367  * Process the incoming Accept from a Proposer, as in the message for
368  * Phase 2 (a) of the Paxos protocol.
369  * Executed by Acceptors.
370  *
371  * @param p Paxos instance
372  * @param m Incoming Accept message
373  * @param synode Synode of the Paxos instance/Accept message
374  * @retval pax_msg* the reply to send to the Proposer (as in the Phase 2 (b)
375  * message of the Paxos protocol) if the Acceptor accepts the Accept
376  * @retval NULL otherwise
377  */
378 pax_msg *handle_simple_accept(pax_machine *p, pax_msg *m, synode_no synode);
379 /**
380  * Process the incoming acknowledge from an Acceptor to a sent Accept, as in the
381  * message for Phase 2 (b) of the Paxos protocol.
382  * Executed by Proposers.
383  *
384  * @param site XCom configuration
385  * @param p Paxos instance
386  * @param m Incoming message
387  * @retval pax_msg* the Learn message to send to Leaners if a majority of
388  * Acceptors replied to the Proposer's Accept
389  * @retval NULL otherwise
390  */
391 pax_msg *handle_simple_ack_accept(site_def const *site, pax_machine *p,
392  pax_msg *m);
393 /**
394  * Process the incoming tiny, i.e. without the learned value, Learn message.
395  * Executed by Learners.
396  *
397  * @param site XCom configuration
398  * @param pm Paxos instance
399  * @param p Incoming message
400  */
401 void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p);
402 /**
403  * Process the incoming Learn message.
404  * Executed by Learners.
405  *
406  * @param site XCom configuration
407  * @param p Paxos instance
408  * @param m Incoming message
409  */
410 void handle_learn(site_def const *site, pax_machine *p, pax_msg *m);
411 /**
412  * @retval 1 if the value for the Paxos instance @c *p has been learned
413  * @retval 0 otherwise
414  */
416 /** @return true if we should process the incoming need_boot_op message passed
417  * in parameter p. */
418 bool should_handle_boot(site_def const *site, pax_msg *p);
419 /**
420  * Initializes the message @c p as a need_boot_op message.
421  *
422  * @param p The message to send
423  * @param identity The unique incarnation identifier of this XCom instance
424  */
425 void init_need_boot_op(pax_msg *p, node_address *identity);
426 
427 static inline char *strerr_msg(char *buf, size_t len, int nr) {
428 #if defined(_WIN32)
429  strerror_s(buf, len, nr);
430 #else
431  snprintf(buf, len, "%s", strerror(nr));
432 #endif
433  return buf;
434 }
435 
436 #define XCOM_COMMS_ERROR 1
437 #define XCOM_COMMS_OTHER 2
438 #define XCOM_COMMS_OK 0
440 
441 synode_no get_delivered_msg();
442 void set_max_synode_from_unified_boot(synode_no unified_boot_synode);
443 
444 #define XCOM_FSM(action, arg) \
445  do { \
446  const char *s = xcom_state_name[xcom_fsm(action, arg)]; \
447  G_TRACE("%f %s:%d", seconds(), __FILE__, __LINE__); \
448  G_DEBUG("new state %s", s); \
449  } while (0)
450 
452 
453 #ifdef __cplusplus
454 }
455 #endif
456 
457 #endif
set_should_exit_getter
void set_should_exit_getter(should_exit_getter x)
Definition: task.c:1107
handle_simple_prepare
pax_msg * handle_simple_prepare(pax_machine *p, pax_msg *pm, synode_no synode)
Process the incoming Prepare message from a Proposer, as in the message for Phase 1 (a) of the Paxos ...
Definition: xcom_base.c:3556
get_max_synode
synode_no get_max_synode()
Definition: xcom_base.c:429
dbg_pax_msg
char * dbg_pax_msg(pax_msg const *p)
Definition: pax_msg.c:156
init_get_event_horizon_msg
app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id)
Definition: xcom_base.c:5263
xcom_data_receiver
void(* xcom_data_receiver)(synode_no message_id, node_set nodes, u_int size, synode_no last_removed, char *data)
Definition: xcom_base.h:180
app_snap_handler
void(* app_snap_handler)(blob *gcs_snap)
Definition: xcom_base.h:197
request_values
void request_values(synode_no find, synode_no end)
Definition: xcom_base.c:3426
xcom_client_force_config
int xcom_client_force_config(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.c:6802
set_max_synode_from_unified_boot
void set_max_synode_from_unified_boot(synode_no unified_boot_synode)
Definition: xcom_base.c:521
xcom_client_remove_node
int xcom_client_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.c:6686
xcom_global_view_receiver
void(* xcom_global_view_receiver)(synode_no config_id, synode_no message_id, node_set nodes, xcom_event_horizon)
Definition: xcom_base.h:188
xcom_input_signal
bool xcom_input_signal(void)
Definition: xcom_base.c:1174
acceptor_learner_task
int acceptor_learner_task(task_arg arg)
Definition: xcom_base.c:4795
msg
char msg[1024]
Definition: test_sql_9_sessions.cc:281
xcom_cache.h
add_args
Definition: xcom_base.h:162
xcom_send
void xcom_send(app_data_ptr a, pax_msg *msg)
Definition: xcom_base.c:1574
set_xcom_data_receiver
void set_xcom_data_receiver(xcom_data_receiver x)
Definition: xcom_interface.c:58
xdr_utils.h
set_xcom_comms_cb
void set_xcom_comms_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1082
xcom_debugger_check
int(* xcom_debugger_check)(const int64_t debug_options)
Definition: xcom_logger.h:81
set_xcom_logger
void set_xcom_logger(xcom_logger x)
Definition: xcom_interface.c:68
xcom_thread_main
void * xcom_thread_main(void *cp)
Definition: xcom_base.c:824
must_force_recover
bool_t must_force_recover()
Definition: xcom_base.c:929
xcom_open_client_connection
connection_descriptor * xcom_open_client_connection(const char *server, xcom_port port)
Definition: xcom_base.c:6194
pax_machine
Definition: xcom_cache.h:62
xcom_input_request.h
bool_t
int bool_t
Definition: types.h:35
x_actions
#define x_actions
Definition: xcom_base.h:139
xcom_os_layer.h
decr_synode
synode_no decr_synode(synode_no synode)
Definition: xcom_base.c:603
null_arg
task_arg null_arg
Definition: task.c:95
config
Definition: default_engine.h:52
set_app_snap_handler
void set_app_snap_handler(app_snap_handler x)
Definition: xcom_base.c:5760
is_node_v4_reachable_with_info
int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info)
Definition: xcom_base.c:6279
should_exit_getter
int(* should_exit_getter)()
Definition: xcom_base.h:209
handle_simple_ack_prepare
bool_t handle_simple_ack_prepare(site_def const *site, pax_machine *p, pax_msg *m)
Process the incoming acknowledge from an Acceptor to a sent Prepare, as in the message for Phase 1 (b...
Definition: xcom_base.c:3655
terminate_and_exit
void terminate_and_exit()
Definition: xcom_base.c:2762
xcom_input_try_pop_cb
xcom_input_request_ptr(* xcom_input_try_pop_cb)(void)
Definition: xcom_base.h:224
set_xcom_socket_accept_cb
int set_xcom_socket_accept_cb(xcom_socket_accept_cb x)
Definition: xcom_transport.c:100
xcom_send_client_app_data
int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a, int force)
Definition: xcom_base.c:6351
ARBITRATOR_HACK
int ARBITRATOR_HACK
Definition: xcom_base.c:330
set_current_message
synode_no set_current_message(synode_no msgno)
Definition: xcom_base.c:2336
xcom_actions
xcom_actions
Definition: xcom_base.h:154
xcom_state
xcom_state
Definition: xcom_base.h:151
xcom_local_view_receiver
void(* xcom_local_view_receiver)(synode_no message_id, node_set nodes)
Definition: xcom_base.h:185
get_executor_site
const site_def * get_executor_site()
Definition: xcom_base.c:838
xcom_fsm
xcom_state xcom_fsm(xcom_actions action, task_arg fsmargs)
Definition: xcom_base.c:5552
send_client_add_node
void send_client_add_node(char *srv, xcom_port port, node_list *nl)
Definition: xcom_base.c:5350
get_prop_input_queue
channel * get_prop_input_queue()
Definition: xcom_base.c:413
xcom_logger
void(* xcom_logger)(const int64_t level, const char *message)
Definition: xcom_logger.h:78
safe_app_data_copy
bool_t safe_app_data_copy(pax_msg **target, app_data_ptr source)
Copies app data source into target and checks if the copy succeeded.
Definition: xcom_base.c:3470
xcom_booted
int xcom_booted()
Definition: xcom_recover.c:112
set_app_snap_getter
void set_app_snap_getter(app_snap_getter x)
Definition: xcom_base.c:5762
xcom_get_maximum_event_horizon
xcom_event_horizon xcom_get_maximum_event_horizon()
Definition: xcom_base.c:4150
site_install_action
void site_install_action(site_def *site, cargo_type operation)
Definition: xcom_base.c:1628
xcom_port
unsigned short xcom_port
Definition: xcom_common.h:47
xcom_socket_accept_cb
int(* xcom_socket_accept_cb)(int fd, site_def const *config)
Definition: xcom_base.h:237
xcom_client_enable_arbitrator
int xcom_client_enable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.c:6807
xcom_get_last_removed_from_cache
synode_no xcom_get_last_removed_from_cache()
handle_tiny_learn
void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p)
Process the incoming tiny, i.e.
Definition: xcom_base.c:3780
xcom_client_terminate_and_exit
int xcom_client_terminate_and_exit(connection_descriptor *fd)
Definition: xcom_base.c:6827
add_to_cache
void add_to_cache(app_data_ptr a, synode_no synode)
Definition: xcom_base.c:4123
set_force_recover
void set_force_recover(bool_t const x)
Definition: xcom_base.c:931
xcom_client_get_event_horizon
int xcom_client_get_event_horizon(connection_descriptor *fd, uint32_t group_id, xcom_event_horizon *event_horizon)
Definition: xcom_base.c:6691
set_xcom_global_view_receiver
void set_xcom_global_view_receiver(xcom_global_view_receiver x)
Definition: xcom_interface.c:64
xcom_close_client_connection
int xcom_close_client_connection(connection_descriptor *connection)
Definition: xcom_base.c:6560
handle_simple_accept
pax_msg * handle_simple_accept(pax_machine *p, pax_msg *m, synode_no synode)
Process the incoming Accept from a Proposer, as in the message for Phase 2 (a) of the Paxos protocol.
Definition: xcom_base.c:3714
iamthegreatest
int iamthegreatest(site_def const *s)
Definition: xcom_base.c:2160
xcom_actions_name
const char * xcom_actions_name[]
Definition: xcom_base.c:5479
status
static STATUS status
Definition: mysql.cc:197
xcom_client_add_node
int xcom_client_add_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.c:6677
init_config_with_group
app_data_ptr init_config_with_group(app_data *a, node_list *nl, cargo_type type, uint32_t group_id)
Definition: xcom_base.c:5245
set_xcom_debugger
void set_xcom_debugger(xcom_debugger x)
Definition: xcom_interface.c:70
new_id
uint32_t new_id()
Create a new (hopefully unique) ID.
Definition: xcom_base.c:1600
init_app_msg
app_data_ptr init_app_msg(app_data *a, char *payload, u_int payload_size)
Definition: xcom_base.c:5270
x_platform.h
handle_simple_ack_accept
pax_msg * handle_simple_ack_accept(site_def const *site, pax_machine *p, pax_msg *m)
Process the incoming acknowledge from an Acceptor to a sent Accept, as in the message for Phase 2 (b)...
Definition: xcom_base.c:3743
dispatch_op
pax_msg * dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue)
Definition: xcom_base.c:4423
xcom_taskmain2
int xcom_taskmain2(xcom_port listen_port)
Definition: xcom_base.c:1330
xcom_thread_init
void xcom_thread_init()
Definition: xcom_base.c:883
linkage
Definition: simset.h:39
xcom_state_name
const char * xcom_state_name[]
Definition: xcom_base.c:5477
x_state_list
#define x_state_list
Definition: xcom_base.h:136
init_terminate_command
app_data_ptr init_terminate_command(app_data *a)
Definition: xcom_base.c:5278
are_we_allowed_to_upgrade_to_v6
int are_we_allowed_to_upgrade_to_v6(app_data_ptr a)
Definition: xcom_base.c:6316
site_post_install_action
void site_post_install_action(site_def *site)
xcom_get_minimum_event_horizon
xcom_event_horizon xcom_get_minimum_event_horizon()
Definition: xcom_base.c:4146
prepare_push_3p
void prepare_push_3p(site_def const *site, pax_machine *p, pax_msg *msg, synode_no msgno, pax_msg_type msg_type)
Initializes the message msg to go through a 3-phase, regular Paxos.
Definition: xcom_base.c:1502
xcom_taskmain
int xcom_taskmain(xcom_port listen_port)
Definition: xcom_base.c:1038
port
static in_port_t port
Definition: testapp.c:33
vp_count_to_synode
synode_no vp_count_to_synode(u_long high, u_long low, node_no nodeid, uint32_t groupid)
Definition: synode_no.c:65
init_xcom_base
void init_xcom_base()
Definition: xcom_base.c:844
xcom_client_force_add_node
int xcom_client_force_add_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
set_xcom_debugger_check
void set_xcom_debugger_check(xcom_debugger_check x)
Definition: xcom_interface.c:72
get_boot_key
synode_no get_boot_key()
Definition: site_def.c:371
deliver_view_msg
void deliver_view_msg(site_def const *site)
Deliver a view message.
Definition: xcom_interface.c:117
xcom_client_boot
int xcom_client_boot(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.c:6574
rules_table_service::end
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:188
broadcast_recover_end
void broadcast_recover_end()
stdx::impl::identity
std::decay_t< T > identity
Definition: string_view.h:176
add_args::port
xcom_port port
Definition: xcom_base.h:164
xcom_client_send_die
int64_t xcom_client_send_die(connection_descriptor *fd)
Definition: xcom_base.c:6428
xcom_add_node
void xcom_add_node(char *addr, xcom_port port, node_list *nl)
Definition: xcom_base.c:5723
reply_handler_task
int reply_handler_task(task_arg arg)
Definition: xcom_base.c:5085
create_noop
pax_msg * create_noop(pax_msg *p)
Initializes the message p as a Prepare message for a no-op, as in the message for Phase 1 (a) of the ...
Definition: xcom_base.c:1400
xcom_client_set_event_horizon
int xcom_client_set_event_horizon(connection_descriptor *fd, uint32_t group_id, xcom_event_horizon event_horizon)
Definition: xcom_base.c:6720
set_xcom_expel_cb
void set_xcom_expel_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1088
xcom_debugger
void(* xcom_debugger)(const char *format,...)
Definition: xcom_logger.h:79
init_set_cache_size_msg
app_data_ptr init_set_cache_size_msg(app_data *a, uint64_t cache_limit)
Definition: xcom_base.c:5294
is_node_v4_reachable
int is_node_v4_reachable(char *node_address)
Definition: xcom_base.c:6297
set_max_synode
void set_max_synode(synode_no synode)
Definition: xcom_base.c:1686
add_args::nl
node_list * nl
Definition: xcom_base.h:165
task_debug.h
u_long
__u_long u_long
Definition: types.h:74
get_delivered_msg
synode_no get_delivered_msg()
Definition: xcom_base.c:2849
init_need_boot_op
void init_need_boot_op(pax_msg *p, node_address *identity)
Initializes the message p as a need_boot_op message.
Definition: xcom_base.c:4042
does_node_have_v4_address
struct addrinfo * does_node_have_v4_address(struct addrinfo *retrieved)
Retreives a node IPv4 address, if it exists.
Definition: xcom_base.c:5905
xcom_thread_deinit
void xcom_thread_deinit()
Definition: xcom_base.c:910
site_def
Definition: site_struct.h:33
check_tasks
void check_tasks()
set_group
void set_group(uint32_t id)
Set node group.
Definition: xcom_base.c:533
xcom_client_convert_into_local_server
int xcom_client_convert_into_local_server(connection_descriptor *const fd)
Definition: xcom_base.c:6849
get_current_message
synode_no get_current_message()
Definition: xcom_base.c:408
set_xcom_local_view_receiver
void set_xcom_local_view_receiver(xcom_local_view_receiver x)
Definition: xcom_interface.c:60
task_arg
Definition: task_arg.h:45
HttpMethod::type
int type
Definition: http_common.h:411
server
Definition: server_struct.h:42
xcom_send_data
void xcom_send_data(uint32_t size, char *data)
Definition: xcom_base.c:5228
xcom_client_force_remove_node
int xcom_client_force_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
xcom_input_new_signal_connection
bool xcom_input_new_signal_connection(char const *address, xcom_port port)
Definition: xcom_base.c:1131
set_xcom_terminate_cb
void set_xcom_terminate_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1084
init_set_event_horizon_msg
app_data_ptr init_set_event_horizon_msg(app_data *a, uint32_t group_id, xcom_event_horizon event_horizon)
Definition: xcom_base.c:5254
set_xcom_input_try_pop_cb
void set_xcom_input_try_pop_cb(xcom_input_try_pop_cb pop)
Definition: xcom_base.c:1090
should_handle_boot
bool should_handle_boot(site_def const *site, pax_msg *p)
Definition: xcom_base.c:3992
handle_learn
void handle_learn(site_def const *site, pax_machine *p, pax_msg *m)
Process the incoming Learn message.
Definition: xcom_base.c:3852
xcom_client_disable_arbitrator
int xcom_client_disable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.c:6817
set_executed_msg
synode_no set_executed_msg(synode_no msgno)
Definition: xcom_base.c:2301
pax_machine::synode
synode_no synode
Definition: xcom_cache.h:66
add_args::addr
char * addr
Definition: xcom_base.h:163
taskmain
int taskmain(xcom_port listen_port)
Definition: xcom_base.c:984
incr_synode
synode_no incr_synode(synode_no synode)
Definition: xcom_base.c:592
init_prepare_msg
void init_prepare_msg(pax_msg *p)
Initializes the message p as a Prepare message, as in the message for Phase 1 (a) of the Paxos protoc...
Definition: xcom_base.c:1391
pm_finished
int pm_finished(pax_machine *p)
Definition: xcom_base.c:686
xcom_input_request_ptr
struct xcom_input_request * xcom_input_request_ptr
Definition: xcom_input_request.h:36
xcom_client_get_synode_app_data
int xcom_client_get_synode_app_data(connection_descriptor *const fd, uint32_t group_id, synode_no_array *const synodes, synode_app_data_array *const reply)
Definition: xcom_base.c:6730
connection_descriptor
Definition: node_connection.h:48
install_node_group
site_def * install_node_group(app_data_ptr a)
Definition: xcom_base.c:1670
set_xcom_exit_cb
void set_xcom_exit_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1086
u_int
__u_int u_int
Definition: types.h:73
channel
Definition: task.h:430
init_propose_msg
void init_propose_msg(pax_msg *p)
Initializes the message p as an Accept message, as in the message for Phase 2 (a) of the Paxos protoc...
Definition: xcom_base.c:1445
p
const char * p
Definition: ctype-mb.cc:1233
xcom_input_free_signal_connection
void xcom_input_free_signal_connection(void)
Definition: xcom_base.c:1183
is_real_recover
int is_real_recover(app_data_ptr a)
Definition: xcom_base.c:1680
prepare_push_2p
void prepare_push_2p(site_def const *site, pax_machine *p)
Initializes the proposer's message to go through a 2-phase Paxos on the proposer's reserved ballot (0...
Definition: xcom_base.c:1518
app_snap_getter
synode_no(* app_snap_getter)(blob *gcs_snap)
Definition: xcom_base.h:200
set_xcom_run_cb
void set_xcom_run_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1080
xcom_state_change_cb
void(* xcom_state_change_cb)(int status)
Definition: xcom_base.h:203
strerr_msg
static char * strerr_msg(char *buf, size_t len, int nr)
Definition: xcom_base.h:427
xcom_client_set_cache_limit
int xcom_client_set_cache_limit(connection_descriptor *fd, uint64_t cache_limit)
Definition: xcom_base.c:6837
start_run_tasks
void start_run_tasks()
Definition: xcom_base.c:1018
send_client_remove_node
void send_client_remove_node(char *srv, xcom_port port, node_list *nl)
Definition: xcom_base.c:5354
xcom_client_send_data
int64_t xcom_client_send_data(uint32_t size, char *data, connection_descriptor *fd)
Definition: xcom_base.c:6492
synode_cnt
unsigned long long synode_cnt
Definition: xcom_base.h:46
get_proposer_site
const site_def * get_proposer_site()
Definition: xcom_base.c:842
pm
static int pm(xcom_port port)
Definition: xcom_transport.c:97