MySQL  8.0.20
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  */
415 int pm_finished(pax_machine *p);
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 
451 int pm_finished(pax_machine *p);
452 
453 #ifdef __cplusplus
454 }
455 #endif
456 
457 #endif
void set_xcom_input_try_pop_cb(xcom_input_try_pop_cb pop)
Definition: xcom_base.c:1088
void(* xcom_global_view_receiver)(synode_no config_id, synode_no message_id, node_set nodes, xcom_event_horizon)
Definition: xcom_base.h:188
Definition: xcom_base.h:162
static char * strerr_msg(char *buf, size_t len, int nr)
Definition: xcom_base.h:427
struct xcom_input_request * xcom_input_request_ptr
Definition: xcom_input_request.h:36
int xcom_taskmain(xcom_port listen_port)
Definition: xcom_base.c:1036
void start_run_tasks()
Definition: xcom_base.c:1016
int xcom_client_disable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.c:6813
void set_xcom_terminate_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1082
xcom_state
Definition: xcom_base.h:151
Definition: site_struct.h:33
void terminate_and_exit()
Definition: xcom_base.c:2760
void xcom_send_data(uint32_t size, char *data)
Definition: xcom_base.c:5224
void set_should_exit_getter(should_exit_getter x)
Definition: task.c:1107
synode_no incr_synode(synode_no synode)
Definition: xcom_base.c:592
Definition: default_engine.h:52
Definition: task_arg.h:45
xcom_event_horizon xcom_get_minimum_event_horizon()
Definition: xcom_base.c:4144
void set_xcom_expel_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1086
void request_values(synode_no find, synode_no end)
Definition: xcom_base.c:3424
void init_xcom_base()
Definition: xcom_base.c:842
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
site_def const * get_proposer_site()
Definition: xcom_base.c:840
int(* should_exit_getter)()
Definition: xcom_base.h:209
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:1398
node_list * nl
Definition: xcom_base.h:165
void(* app_snap_handler)(blob *gcs_snap)
Definition: xcom_base.h:197
void set_max_synode(synode_no synode)
Definition: xcom_base.c:1684
bool xcom_input_new_signal_connection(char const *address, xcom_port port)
Definition: xcom_base.c:1129
xcom_port port
Definition: xcom_base.h:164
void xcom_thread_init()
Definition: xcom_base.c:881
int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a, int force)
Definition: xcom_base.c:6347
int xcom_client_boot(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.c:6570
void(* xcom_debugger)(const char *format,...)
Definition: xcom_logger.h:79
void(* xcom_state_change_cb)(int status)
Definition: xcom_base.h:203
int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info)
Definition: xcom_base.c:6275
int xcom_client_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.c:6682
bool xcom_input_signal(void)
Definition: xcom_base.c:1172
task_arg null_arg
Definition: task.c:95
int xcom_client_force_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
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:3468
int set_xcom_socket_accept_cb(xcom_socket_accept_cb x)
Definition: xcom_transport.c:100
int xcom_client_force_config(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.c:6798
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:3554
site_def * install_node_group(app_data_ptr a)
Definition: xcom_base.c:1668
void xcom_add_node(char *addr, xcom_port port, node_list *nl)
Definition: xcom_base.c:5719
void check_tasks()
Definition: task.h:430
synode_no set_executed_msg(synode_no msgno)
Definition: xcom_base.c:2299
int(* xcom_socket_accept_cb)(int fd, site_def const *config)
Definition: xcom_base.h:237
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:1389
void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p)
Process the incoming tiny, i.e.
Definition: xcom_base.c:3778
void(* xcom_local_view_receiver)(synode_no message_id, node_set nodes)
Definition: xcom_base.h:185
char * dbg_pax_msg(pax_msg const *p)
Definition: pax_msg.c:156
app_data_ptr init_set_event_horizon_msg(app_data *a, uint32_t group_id, xcom_event_horizon event_horizon)
Definition: xcom_base.c:5250
app_data_ptr init_config_with_group(app_data *a, node_list *nl, cargo_type type, uint32_t group_id)
Definition: xcom_base.c:5241
unsigned short xcom_port
Definition: xcom_common.h:47
#define x_state_list
Definition: xcom_base.h:136
const char * xcom_actions_name[]
Definition: xcom_base.c:5475
void set_max_synode_from_unified_boot(synode_no unified_boot_synode)
Definition: xcom_base.c:521
int xcom_client_set_cache_limit(connection_descriptor *fd, uint64_t cache_limit)
Definition: xcom_base.c:6833
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:1443
xcom_event_horizon xcom_get_maximum_event_horizon()
Definition: xcom_base.c:4148
int xcom_client_set_event_horizon(connection_descriptor *fd, uint32_t group_id, xcom_event_horizon event_horizon)
Definition: xcom_base.c:6716
bool_t must_force_recover()
Definition: xcom_base.c:927
bool should_handle_boot(site_def const *site, pax_msg *p)
Definition: xcom_base.c:3990
int64_t xcom_client_send_die(connection_descriptor *fd)
Definition: xcom_base.c:6424
void add_to_cache(app_data_ptr a, synode_no synode)
Definition: xcom_base.c:4121
void xcom_thread_deinit()
Definition: xcom_base.c:908
void deliver_view_msg(site_def const *site)
Deliver a view message.
Definition: xcom_interface.c:128
void set_xcom_global_view_receiver(xcom_global_view_receiver x)
Definition: xcom_interface.c:64
char * addr
Definition: xcom_base.h:163
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:3712
connection_descriptor * xcom_open_client_connection(const char *server, xcom_port port)
Definition: xcom_base.c:6190
int xcom_close_client_connection(connection_descriptor *connection)
Definition: xcom_base.c:6556
Definition: simset.h:39
int reply_handler_task(task_arg arg)
Definition: xcom_base.c:5081
app_data_ptr init_terminate_command(app_data *a)
Definition: xcom_base.c:5274
int ARBITRATOR_HACK
Definition: xcom_base.c:330
int is_node_v4_reachable(char *node_address)
Definition: xcom_base.c:6293
int xcom_client_enable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.c:6803
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:188
synode_no get_boot_key()
Definition: site_def.c:371
app_data_ptr init_set_cache_size_msg(app_data *a, uint64_t cache_limit)
Definition: xcom_base.c:5290
int xcom_booted()
Definition: xcom_recover.c:112
Definition: node_connection.h:48
void handle_learn(site_def const *site, pax_machine *p, pax_msg *m)
Process the incoming Learn message.
Definition: xcom_base.c:3850
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:3653
void send_client_add_node(char *srv, xcom_port port, node_list *nl)
Definition: xcom_base.c:5346
unsigned long long synode_cnt
Definition: xcom_base.h:46
int iamthegreatest(site_def const *s)
Definition: xcom_base.c:2158
app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id)
Definition: xcom_base.c:5259
Definition: server_struct.h:42
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:6726
void xcom_input_free_signal_connection(void)
Definition: xcom_base.c:1181
char msg[1024]
Definition: test_sql_9_sessions.cc:281
uint32_t new_id()
Create a new (hopefully unique) ID.
Definition: xcom_base.c:1598
void set_xcom_local_view_receiver(xcom_local_view_receiver x)
Definition: xcom_interface.c:60
void site_post_install_action(site_def *site)
site_def const * get_executor_site()
Definition: xcom_base.c:836
void set_xcom_exit_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1084
xcom_input_request_ptr(* xcom_input_try_pop_cb)(void)
Definition: xcom_base.h:224
void site_install_action(site_def *site, cargo_type operation)
Definition: xcom_base.c:1626
synode_no decr_synode(synode_no synode)
Definition: xcom_base.c:603
__u_int u_int
Definition: types.h:73
void set_app_snap_handler(app_snap_handler x)
Definition: xcom_base.c:5756
synode_no xcom_get_last_removed_from_cache()
void broadcast_recover_end()
void set_group(uint32_t id)
Set node group.
Definition: xcom_base.c:533
int(* xcom_debugger_check)(const int64_t debug_options)
Definition: xcom_logger.h:81
void set_xcom_comms_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1080
static int pm(xcom_port port)
Definition: xcom_transport.c:97
int bool_t
Definition: types.h:35
void(* xcom_logger)(const int64_t level, const char *message)
Definition: xcom_logger.h:78
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:3741
synode_no get_max_synode()
Definition: xcom_base.c:429
Definition: xcom_cache.h:62
void set_xcom_run_cb(xcom_state_change_cb x)
Definition: xcom_base.c:1078
void xcom_send(app_data_ptr a, pax_msg *msg)
Definition: xcom_base.c:1572
#define x_actions
Definition: xcom_base.h:139
struct addrinfo * does_node_have_v4_address(struct addrinfo *retrieved)
Retreives a node IPv4 address, if it exists.
Definition: xcom_base.c:5901
void prepare_push_2p(site_def const *site, pax_machine *p)
Initializes the proposer&#39;s message to go through a 2-phase Paxos on the proposer&#39;s reserved ballot (0...
Definition: xcom_base.c:1516
xcom_actions
Definition: xcom_base.h:154
void send_client_remove_node(char *srv, xcom_port port, node_list *nl)
Definition: xcom_base.c:5350
int are_we_allowed_to_upgrade_to_v6(app_data_ptr a)
Definition: xcom_base.c:6312
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:4040
int acceptor_learner_task(task_arg arg)
Definition: xcom_base.c:4791
app_data_ptr init_app_msg(app_data *a, char *payload, u_int payload_size)
Definition: xcom_base.c:5266
channel * get_prop_input_queue()
Definition: xcom_base.c:413
synode_no set_current_message(synode_no msgno)
Definition: xcom_base.c:2334
void set_xcom_data_receiver(xcom_data_receiver x)
Definition: xcom_interface.c:58
void set_xcom_logger(xcom_logger x)
Definition: xcom_interface.c:68
int xcom_client_force_add_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
int pm_finished(pax_machine *p)
Definition: xcom_base.c:684
int64_t xcom_client_send_data(uint32_t size, char *data, connection_descriptor *fd)
Definition: xcom_base.c:6488
const char * p
Definition: ctype-mb.cc:1235
int xcom_client_add_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.c:6673
__u_long u_long
Definition: types.h:74
int xcom_client_get_event_horizon(connection_descriptor *fd, uint32_t group_id, xcom_event_horizon *event_horizon)
Definition: xcom_base.c:6687
synode_no get_delivered_msg()
Definition: xcom_base.c:2847
std::decay_t< T > identity
Definition: string_view.h:176
xcom_state xcom_fsm(xcom_actions action, task_arg fsmargs)
Definition: xcom_base.c:5548
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:1500
static STATUS status
Definition: mysql.cc:198
void * xcom_thread_main(void *cp)
Definition: xcom_base.c:822
synode_no vp_count_to_synode(u_long high, u_long low, node_no nodeid, uint32_t groupid)
Definition: synode_no.c:65
int is_real_recover(app_data_ptr a)
Definition: xcom_base.c:1678
pax_msg * dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue)
Definition: xcom_base.c:4419
void set_force_recover(bool_t const x)
Definition: xcom_base.c:929
const char * xcom_state_name[]
Definition: xcom_base.c:5473
int xcom_client_terminate_and_exit(connection_descriptor *fd)
Definition: xcom_base.c:6823
int xcom_client_convert_into_local_server(connection_descriptor *const fd)
Definition: xcom_base.c:6845
synode_no get_current_message()
Definition: xcom_base.c:408
void set_app_snap_getter(app_snap_getter x)
Definition: xcom_base.c:5758
int xcom_taskmain2(xcom_port listen_port)
Definition: xcom_base.c:1328
int taskmain(xcom_port listen_port)
Definition: xcom_base.c:982
void set_xcom_debugger(xcom_debugger x)
Definition: xcom_interface.c:70
const byte * find(const Pages *pages, const page_id_t &page_id) noexcept
Find a doublewrite copy of a page.
Definition: buf0dblwr.cc:2211
void set_xcom_debugger_check(xcom_debugger_check x)
Definition: xcom_interface.c:72
synode_no(* app_snap_getter)(blob *gcs_snap)
Definition: xcom_base.h:200