MySQL  8.0.27
Source Code Documentation
xcom_base.h
Go to the documentation of this file.
1 /* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
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 <stddef.h>
27 #ifdef __APPLE__
28 #include <stdio.h>
29 #endif
30 
31 #ifndef _WIN32
32 #include <netdb.h>
33 #endif
34 
35 #include <memory>
36 
39 #include "xcom/site_struct.h"
40 #include "xcom/task_arg.h"
41 #include "xcom/task_debug.h"
42 #include "xcom/x_platform.h"
43 #include "xcom/xcom_cache.h"
45 #include "xcom/xcom_os_layer.h"
46 #include "xcom/xdr_utils.h"
47 
48 #define XCOM_THREAD_DEBUG 1
49 
50 typedef unsigned long long synode_cnt;
51 
52 #define SET_EXECUTED_MSG(x) \
53  do { \
54  IFDBG(D_NONE, FN); \
55  set_executed_msg(x); \
56  } while (0)
57 
58 /* Constants */
59 
60 #ifdef XCOM_TRANSACTIONS
61 static trans_id const last_trans = {0xffffffff, 0xffffffff};
62 
63 #endif
64 
65 extern int ARBITRATOR_HACK;
66 extern task_arg null_arg;
67 
68 void *xcom_thread_main(void *cp);
69 
70 synode_no incr_synode(synode_no synode);
71 
72 synode_no decr_synode(synode_no synode);
73 
74 char *dbg_pax_msg(pax_msg const *p);
75 pax_msg *dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue);
76 synode_no set_executed_msg(synode_no msgno);
77 void request_values(synode_no find, synode_no end);
78 void set_group(uint32_t id);
79 void check_tasks();
80 int xcom_booted();
81 int iamthegreatest(site_def const *s);
82 void xcom_send(app_data_ptr a, pax_msg *msg);
85 synode_no get_max_synode();
86 void xcom_thread_deinit();
87 int taskmain(xcom_port listen_port);
88 void xcom_thread_init();
89 site_def *install_node_group(app_data_ptr a);
90 int xcom_taskmain2(xcom_port listen_port);
91 void set_max_synode(synode_no synode);
92 synode_no set_current_message(synode_no msgno);
93 
94 int is_real_recover(app_data_ptr a);
95 
96 void init_xcom_base();
97 uint32_t new_id();
98 synode_no get_boot_key();
101 site_def const *get_proposer_site();
102 synode_no get_current_message();
104 
105 int is_node_v4_reachable(char *node_address);
106 int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info);
107 int are_we_allowed_to_upgrade_to_v6(app_data_ptr a);
108 
109 /**
110  * @brief Process incoming are_you_alive (i.e.: ping) messages and act
111  * accordingly
112  *
113  * GCS/XCom has a full mesh of connections between all nodes. A connects to B
114  * and B connects back to A.
115  *
116  * If we cut out B with, for instance, a firewall, we have the A->B connection
117  * silently dead, but we have the B->A connection alive. Since we only do
118  * monitoring on one half of the connection (the incoming messages), we will
119  * consider that B is alive, although we can't contact it. In the same way, B
120  * will consider that A is dead, since it does not receive any message from it.
121  *
122  * We must be able to break the outgoing connection if we detect that something
123  * is wrong, in order to make the bi-directional connection state consistent and
124  * report that node as unreachable. That can be done if we start receiving
125  * pings from a node that we consider that it is alive. After some pings,
126  * we just kill the outgoing connection, thus creating a consistent state.
127  *
128  * Breaking this connection should only occur if the node has already booted,
129  * meaning that the whole joining process is complete and the node is up and
130  * running. This is due to the fact that we receive pings as part of the
131  * process of joining a group.
132  *
133  * @param site current site definitions
134  * @param pm a possible ping message:
135  * @param has_client_already_booted check if this node has already booted
136  * @param current_time current XCom time
137  *
138  * @return int 1 if the node connection is closed. 0, otherwise.
139  */
141  int has_client_already_booted,
142  double current_time);
143 
144 #define RESET_CLIENT_MSG \
145  if (ep->client_msg) { \
146  msg_link_delete(&ep->client_msg); \
147  }
148 
149 #define APP ep->client_msg->p->a
150 
151 #define FIND_MAX (MIN_LENGTH / 10)
152 
153 /* Set type and object pointer */
154 #define PLP msg->payload.manager_message_payload_u
155 #define SET_REP_TYPE(quark, ptr) \
156  q = (quark); \
157  object = PLP.ptr
158 
159 #define x_actions \
160  X(x_fsm_wait) \
161  , X(x_fsm_poll), X(x_fsm_init), X(x_fsm_u_boot), X(x_fsm_add), \
162  X(x_fsm_net_boot), X(x_fsm_force_config), X(x_fsm_snapshot), \
163  X(x_fsm_local_snapshot), X(x_fsm_snapshot_wait), X(x_fsm_need_snapshot), \
164  X(x_fsm_complete), X(x_fsm_terminate), X(x_fsm_exit), X(x_fsm_timeout)
165 #define X(a) a
166 
168 typedef enum xcom_actions xcom_actions;
169 #undef X
170 
171 extern const char *xcom_actions_name[];
172 
173 struct add_args {
174  char *addr;
176  node_list *nl;
177 };
178 typedef struct add_args add_args;
179 
181 
182 char const *xcom_fsm(xcom_actions action, task_arg fsmargs);
184 
185 void site_install_action(site_def *site, cargo_type operation);
186 void send_client_add_node(char *srv, xcom_port port, node_list *nl);
187 void send_client_remove_node(char *srv, xcom_port port, node_list *nl);
188 
189 typedef void (*xcom_full_data_receiver)(site_def const *site, pax_machine *pma,
190  app_data_ptr app,
191  delivery_status app_status);
193 
194 typedef void (*xcom_full_local_view_receiver)(site_def const *site,
195  node_set nodes);
197 
198 typedef void (*xcom_full_global_view_receiver)(site_def const *site,
199  synode_no message_id,
200  node_set nodes);
202 
203 typedef void (*xcom_data_receiver)(synode_no message_id, synode_no origin,
204  site_def const *site, node_set nodes,
205  u_int size, synode_no last_removed,
206  char *data);
208 
209 typedef void (*xcom_local_view_receiver)(synode_no message_id, node_set nodes);
211 
212 typedef void (*xcom_global_view_receiver)(synode_no config_id,
213  synode_no message_id, node_set nodes,
214  xcom_event_horizon);
216 
217 typedef void (*xcom_config_receiver)(app_data *a);
218 
220 
224 
225 typedef void (*app_snap_handler)(blob *gcs_snap, synode_no log_start,
226  synode_no log_end);
228 
229 typedef synode_no (*app_snap_getter)(blob *gcs_snap);
231 
232 typedef void (*xcom_state_change_cb)(int status);
237 
238 typedef int (*should_exit_getter)();
240 
241 typedef void (*xcom_recovery_cb)();
242 
244 
246 
248 
250 
251 app_data_ptr init_config_with_group(app_data *a, node_list *nl, cargo_type type,
252  uint32_t group_id);
253 app_data_ptr init_set_event_horizon_msg(app_data *a, uint32_t group_id,
254  xcom_event_horizon event_horizon);
255 app_data_ptr init_get_leaders_msg(app_data *a, uint32_t group_id);
256 app_data_ptr init_set_cache_size_msg(app_data *a, uint64_t cache_limit);
257 app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id);
258 app_data_ptr init_app_msg(app_data *a, char *payload, u_int payload_size);
259 app_data_ptr init_terminate_command(app_data *a);
260 
261 void terminate_and_exit();
262 
263 /* Hook the logic to pop from the input channel. */
266 /* Create a connection to the input channel's signalling socket. */
268 /* Signal that the input channel has commands. */
270 /* Destroy the connection to the input channel's signalling socket. */
272 
273 /*
274  Registers a callback that is called right after
275  the accept routine returns.
276  */
277 typedef int (*xcom_socket_accept_cb)(int fd, site_def const *config);
279 
282 int xcom_client_add_node(connection_descriptor *fd, node_list *nl,
283  uint32_t group_id);
285  uint32_t group_id);
287  uint32_t group_id);
289  uint32_t group_id);
291  uint32_t group_id);
293  uint32_t group_id);
295 int64_t xcom_client_send_data(uint32_t size, char *data,
297 xcom_event_horizon xcom_get_minimum_event_horizon();
298 xcom_event_horizon xcom_get_maximum_event_horizon();
300  xcom_event_horizon *event_horizon);
302  xcom_event_horizon event_horizon);
305  uint64_t cache_limit);
307  uint32_t group_id,
308  synode_no_array *const synodes,
309  synode_app_data_array *const reply);
311 int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a,
312  int force);
313 
314 std::unique_ptr<Network_provider_management_interface>
316 
317 std::unique_ptr<Network_provider_operations_interface>
319 
320 /**
321  Copies app data @c source into @c target and checks if the copy
322  succeeded. Sets *target to NULL if the copy fails.
323 
324  @param[in, out] target The pax_msg to which the app_data will be copied.
325  @param source The app data that will be copied.
326  @retval TRUE if the copy was successful.
327  @retval FALSE if the copy failed, in which case *target is set to NULL;
328  a failed copy means that there was an error allocating memory for
329  the copy.
330 */
331 bool_t safe_app_data_copy(pax_msg **target, app_data_ptr source);
332 
333 /**
334  * Initializes the message @c msg to go through a 3-phase, regular Paxos.
335  * Executed by Proposers.
336  *
337  * @param site XCom configuration
338  * @param p Paxos instance
339  * @param msg Message to send
340  * @param msgno Synode where @c msg will be proposed
341  * @param msg_type The type of the message, e.g. normal or no_op
342  */
343 void prepare_push_3p(site_def const *site, pax_machine *p, pax_msg *msg,
344  synode_no msgno, pax_msg_type msg_type);
345 /**
346  * Initializes the message @c p as a Prepare message, as in the message for
347  * Phase 1 (a) of the Paxos protocol.
348  * Executed by Proposers.
349  *
350  * @param p The message to send
351  */
352 void init_prepare_msg(pax_msg *p);
353 /**
354  * Initializes the message @c p as a Prepare message for a no-op, as in the
355  * message for Phase 1 (a) of the Paxos protocol.
356  * Executed by Proposers.
357  *
358  * @param p The no-op message to send
359  * @retval created paxos message of type no_op
360  */
362 /**
363  * Process the incoming Prepare message from a Proposer, as in the message for
364  * Phase 1 (a) of the Paxos protocol.
365  * Executed by Acceptors.
366  *
367  * @param p Paxos instance
368  * @param pm Incoming Prepare message
369  * @param synode Synode of the Paxos instance/Accept message
370  * @retval pax_msg* the reply to send to the Proposer (as in the Phase 1 (b)
371  * message of the Paxos protocol) if the Acceptor accepts the Prepare
372  * @retval NULL otherwise
373  */
374 pax_msg *handle_simple_prepare(pax_machine *p, pax_msg *pm, synode_no synode);
375 /**
376  * Process the incoming acknowledge from an Acceptor to a sent Prepare, as in
377  * the message for Phase 1 (b) of the Paxos protocol.
378  * Executed by Proposers.
379  *
380  * @param site XCom configuration
381  * @param p Paxos instance
382  * @param m Incoming message
383  * @retval TRUE if a majority of Acceptors replied to the Proposer's Prepare
384  * @retval FALSE otherwise
385  */
387  pax_msg *m);
388 /**
389  * Initializes the proposer's message to go through a 2-phase Paxos on the
390  * proposer's reserved ballot (0,_).
391  * Executed by Proposers.
392  *
393  * @param site XCom configuration
394  * @param p Paxos instance
395  */
396 void prepare_push_2p(site_def const *site, pax_machine *p);
397 /**
398  * Initializes the message @c p as an Accept message, as in the message for
399  * Phase 2 (a) of the Paxos protocol.
400  * Executed by Proposers.
401  *
402  * @param p The message to send
403  */
404 void init_propose_msg(pax_msg *p);
405 /**
406  * Process the incoming Accept from a Proposer, as in the message for
407  * Phase 2 (a) of the Paxos protocol.
408  * Executed by Acceptors.
409  *
410  * @param p Paxos instance
411  * @param m Incoming Accept message
412  * @param synode Synode of the Paxos instance/Accept message
413  * @retval pax_msg* the reply to send to the Proposer (as in the Phase 2 (b)
414  * message of the Paxos protocol) if the Acceptor accepts the Accept
415  * @retval NULL otherwise
416  */
417 pax_msg *handle_simple_accept(pax_machine *p, pax_msg *m, synode_no synode);
418 /**
419  * Process the incoming acknowledge from an Acceptor to a sent Accept, as in
420  * the message for Phase 2 (b) of the Paxos protocol. Executed by Proposers.
421  *
422  * @param site XCom configuration
423  * @param p Paxos instance
424  * @param m Incoming message
425  * @retval pax_msg* the Learn message to send to Leaners if a majority of
426  * Acceptors replied to the Proposer's Accept
427  * @retval NULL otherwise
428  */
430  pax_msg *m);
431 /**
432  * Process the incoming tiny, i.e. without the learned value, Learn message.
433  * Executed by Learners.
434  *
435  * @param site XCom configuration
436  * @param pm Paxos instance
437  * @param p Incoming message
438  */
439 void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p);
440 /**
441  * Process the incoming Learn message.
442  * Executed by Learners.
443  *
444  * @param site XCom configuration
445  * @param p Paxos instance
446  * @param m Incoming message
447  */
448 void handle_learn(site_def const *site, pax_machine *p, pax_msg *m);
449 /**
450  * @retval 1 if the value for the Paxos instance @c *p has been learned
451  * @retval 0 otherwise
452  */
454 /** @return true if we should process the incoming need_boot_op message passed
455  * in parameter p. */
457 /**
458  * Initializes the message @c p as a need_boot_op message.
459  *
460  * @param p The message to send
461  * @param identity The unique incarnation identifier of this XCom instance
462  */
463 void init_need_boot_op(pax_msg *p, node_address *identity);
464 
465 int xcom_client_set_max_leaders(connection_descriptor *fd, node_no max_leaders,
466  uint32_t group_id);
467 
468 void init_set_max_leaders(uint32_t group_id, app_data *a, node_no max_leaders);
469 void init_set_leaders(uint32_t group_id, app_data *a,
470  leader_array const leaders);
471 void init_set_leaders(uint32_t group_id, app_data *a, u_int n,
472  char const *names[]);
473 void init_set_leaders(uint32_t group_id, app_data *leader_app,
474  leader_array const leaders, app_data *max_app,
475  node_no max_leaders);
476 void init_set_leaders(uint32_t group_id, app_data *leader_app, u_int n,
477  char const *names[], app_data *max_app,
478  node_no max_leaders);
479 
481  leader_array const leaders, uint32_t group_id);
483  char const *names[], uint32_t group_id);
485  leader_array const leaders, node_no max_leaders,
486  uint32_t group_id);
488  char const *names[], node_no max_leaders,
489  uint32_t group_id);
490 
491 int xcom_client_get_leaders(connection_descriptor *fd, uint32_t group_id,
492  leader_info_data *leaders);
493 
494 typedef void (*xcom_election_cb)(leader_array leaders);
496 
497 static inline char *strerr_msg(char *buf, size_t len, int nr) {
498 #if defined(_WIN32)
499  strerror_s(buf, len, nr);
500 #else
501  snprintf(buf, len, "%s", strerror(nr));
502 #endif
503  return buf;
504 }
505 
506 void xcom_sleep(unsigned int seconds);
507 
508 #define XCOM_COMMS_ERROR 1
509 #define XCOM_COMMS_OTHER 2
510 #define XCOM_COMMS_OK 0
512 
513 extern "C" synode_no get_delivered_msg();
514 void set_max_synode_from_unified_boot(synode_no unified_boot_synode);
515 void send_x_fsm_complete();
516 synode_no get_default_start(app_data_ptr a);
517 synode_no get_last_delivered_msg();
518 void set_log_end(gcs_snapshot *gcs);
519 
520 extern "C" void synthesize_leaders(leader_array *leaders);
521 
522 #define XCOM_FSM(action, arg) \
523  do { \
524  const char *s = xcom_fsm(action, arg); \
525  G_TRACE("%f %s:%d", seconds(), __FILE__, __LINE__); \
526  G_DEBUG("new state %s", s); \
527  } while (0)
528 
530 bool_t handle_max_leaders(app_data_ptr a);
531 
532 #endif
const char * p
Definition: ctype-mb.cc:1236
void log_start(log_t &log, checkpoint_no_t checkpoint_no, lsn_t checkpoint_lsn, lsn_t start_lsn, bool allow_checkpoints=true)
Starts the initialized redo log system using a provided checkpoint_lsn and current lsn.
Definition: log0log.cc:599
Definition: buf0block_hint.cc:29
constexpr value_type blob
Definition: classic_protocol_constants.h:267
const byte * find(const Pages *pages, const page_id_t &page_id) noexcept
Find a doublewrite copy of a page.
Definition: buf0dblwr.cc:2519
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:191
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:32
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:60
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:41
required string type
Definition: replication_group_member_actions.proto:33
repeated Action action
Definition: replication_group_member_actions.proto:42
struct pax_msg pax_msg
Definition: site_struct.h:36
Definition: xcom_base.h:173
char * addr
Definition: xcom_base.h:174
xcom_port port
Definition: xcom_base.h:175
node_list * nl
Definition: xcom_base.h:176
Definition: node_connection.h:46
Definition: simset.h:35
Definition: xcom_cache.h:94
Definition: site_struct.h:42
Definition: task_arg.h:41
double seconds()
Definition: task.cc:309
__u_int u_int
Definition: types.h:72
int bool_t
Definition: types.h:34
int n
Definition: xcom_base.cc:505
xcom_actions
Definition: xcom_base.h:167
void set_xcom_logger(xcom_logger x)
Definition: xcom_interface.cc:105
const char * xcom_actions_name[]
Definition: xcom_base.cc:7098
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.cc:1586
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.cc:1703
void set_xcom_recovery_begin_cb(xcom_recovery_cb x)
void terminate_and_exit()
Definition: xcom_base.cc:3789
void(* xcom_global_view_receiver)(synode_no config_id, synode_no message_id, node_set nodes, xcom_event_horizon)
Definition: xcom_base.h:212
char const * xcom_fsm(xcom_actions action, task_arg fsmargs)
Definition: xcom_base.cc:7643
void init_xcom_base()
Definition: xcom_base.cc:887
int taskmain(xcom_port listen_port)
void set_xcom_comms_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1079
int xcom_client_force_config(connection_descriptor *fd, node_list *nl, uint32_t group_id)
void xcom_sleep(unsigned int seconds)
Definition: xcom_base.cc:6783
int xcom_client_get_leaders(connection_descriptor *fd, uint32_t group_id, leader_info_data *leaders)
Definition: xcom_base.cc:8571
synode_no get_default_start(app_data_ptr a)
int is_real_recover(app_data_ptr a)
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.cc:8338
void set_xcom_run_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1077
void set_xcom_recovery_init_cb(xcom_recovery_cb x)
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.cc:4807
synode_no set_executed_msg(synode_no msgno)
Definition: xcom_base.cc:2919
int xcom_client_get_event_horizon(connection_descriptor *fd, uint32_t group_id, xcom_event_horizon *event_horizon)
bool_t should_handle_need_boot(site_def const *site, pax_msg *p)
Definition: xcom_base.cc:5294
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.cc:4748
void send_x_fsm_complete()
Definition: xcom_base.cc:7079
void set_xcom_global_view_receiver(xcom_global_view_receiver x)
Definition: xcom_interface.cc:88
app_data_ptr init_config_with_group(app_data *a, node_list *nl, cargo_type type, uint32_t group_id)
Definition: xcom_base.cc:6818
synode_no get_delivered_msg()
Definition: xcom_base.cc:881
void(* xcom_data_receiver)(synode_no message_id, synode_no origin, site_def const *site, node_set nodes, u_int size, synode_no last_removed, char *data)
Definition: xcom_base.h:203
int(* should_exit_getter)()
Definition: xcom_base.h:238
void set_xcom_recovery_end_cb(xcom_recovery_cb x)
int(* xcom_socket_accept_cb)(int fd, site_def const *config)
Definition: xcom_base.h:277
app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id)
Definition: xcom_base.cc:6847
void set_xcom_debugger_check(xcom_debugger_check x)
Definition: xcom_interface.cc:109
void(* app_snap_handler)(blob *gcs_snap, synode_no log_start, synode_no log_end)
Definition: xcom_base.h:225
synode_no get_max_synode()
Definition: xcom_base.cc:509
void set_app_snap_handler(app_snap_handler x)
Definition: xcom_base.cc:7656
int set_xcom_socket_accept_cb(xcom_socket_accept_cb x)
Definition: xcom_network_provider_native_lib.cc:60
void set_xcom_full_global_view_receiver(xcom_full_global_view_receiver x)
int xcom_client_add_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.cc:8279
int xcom_client_boot(connection_descriptor *fd, node_list *nl, uint32_t group_id)
void(* xcom_recovery_cb)()
Definition: xcom_base.h:241
std::unique_ptr< Network_provider_operations_interface > get_network_operations_interface()
Definition: xcom_base.cc:8548
void xcom_send(app_data_ptr a, pax_msg *msg)
Definition: xcom_base.cc:1740
synode_no get_boot_key()
void check_tasks()
void start_run_tasks()
app_data_ptr init_set_event_horizon_msg(app_data *a, uint32_t group_id, xcom_event_horizon event_horizon)
Definition: xcom_base.cc:6827
char * dbg_pax_msg(pax_msg const *p)
task_arg null_arg
Definition: task.cc:106
synode_no(* app_snap_getter)(blob *gcs_snap)
Definition: xcom_base.h:229
void init_set_max_leaders(uint32_t group_id, app_data *a, node_no max_leaders)
Definition: xcom_base.cc:8467
void set_xcom_debugger(xcom_debugger x)
Definition: xcom_interface.cc:107
void request_values(synode_no find, synode_no end)
int acceptor_learner_task(task_arg arg)
Definition: xcom_base.cc:6428
synode_no set_current_message(synode_no msgno)
Definition: xcom_base.cc:2962
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.cc:1577
uint32_t new_id()
Create a new (hopefully unique) ID.
Definition: xcom_base.cc:1766
void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p)
Process the incoming tiny, i.e.
Definition: xcom_base.cc:5065
void init_set_leaders(uint32_t group_id, app_data *a, leader_array const leaders)
Definition: xcom_base.cc:8495
void site_install_action(site_def *site, cargo_type operation)
Definition: xcom_base.cc:1849
int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a, int force)
Definition: xcom_base.cc:7890
int xcom_client_enable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.cc:8417
xcom_event_horizon xcom_get_maximum_event_horizon()
Definition: xcom_base.cc:5465
int pre_process_incoming_ping(site_def const *site, pax_msg const *pm, int has_client_already_booted, double current_time)
Process incoming are_you_alive (i.e.
Definition: xcom_base.cc:5356
site_def const * get_executor_site()
Definition: xcom_base.cc:870
void(* xcom_state_change_cb)(int status)
Definition: xcom_base.h:232
int xcom_client_convert_into_local_server(connection_descriptor *const fd)
Definition: xcom_base.cc:8457
void synthesize_leaders(leader_array *leaders)
Definition: xcom_base.cc:1906
int xcom_client_force_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
int xcom_booted()
Definition: xcom_recover.cc:64
int xcom_client_disable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.cc:8430
void set_xcom_expel_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1080
void send_client_add_node(char *srv, xcom_port port, node_list *nl)
bool_t xcom_input_new_signal_connection(char const *address, xcom_port port)
Definition: xcom_base.cc:1172
void set_max_synode(synode_no synode)
Definition: xcom_base.cc:1969
int is_node_v4_reachable(char *node_address)
Definition: xcom_base.cc:7836
void xcom_thread_deinit()
Definition: xcom_base.cc:965
synode_no get_current_message()
Definition: xcom_base.cc:444
int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info)
Definition: xcom_base.cc:7818
void set_xcom_terminate_cb(xcom_state_change_cb x)
int xcom_client_set_event_horizon(connection_descriptor *fd, uint32_t group_id, xcom_event_horizon event_horizon)
void(* xcom_full_local_view_receiver)(site_def const *site, node_set nodes)
Definition: xcom_base.h:194
void set_group(uint32_t id)
Set node group.
Definition: xcom_base.cc:621
void set_xcom_full_local_view_receiver(xcom_full_local_view_receiver x)
int are_we_allowed_to_upgrade_to_v6(app_data_ptr a)
Definition: xcom_base.cc:7855
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.cc:4924
void send_client_remove_node(char *srv, xcom_port port, node_list *nl)
void(* xcom_full_global_view_receiver)(site_def const *site, synode_no message_id, node_set nodes)
Definition: xcom_base.h:198
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.cc:4980
int xcom_client_terminate_and_exit(connection_descriptor *fd)
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.cc:1635
void(* xcom_election_cb)(leader_array leaders)
Definition: xcom_base.h:494
synode_no incr_synode(synode_no synode)
Definition: xcom_base.cc:671
int iamthegreatest(site_def const *s)
Definition: xcom_base.cc:2643
synode_no xcom_get_last_removed_from_cache()
void set_xcom_election_cb(xcom_election_cb x)
pax_msg * dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue)
Definition: xcom_base.cc:6315
void set_xcom_exit_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1078
bool_t xcom_input_signal(void)
Definition: xcom_base.cc:1233
int64_t xcom_client_send_data(uint32_t size, char *data, connection_descriptor *fd)
void set_max_synode_from_unified_boot(synode_no unified_boot_synode)
void set_should_exit_getter(should_exit_getter x)
Definition: task.cc:1131
void(* xcom_local_view_receiver)(synode_no message_id, node_set nodes)
Definition: xcom_base.h:209
app_data_ptr init_terminate_command(app_data *a)
void set_app_snap_getter(app_snap_getter x)
Definition: xcom_base.cc:7659
int pm_finished(pax_machine *p)
Definition: xcom_base.cc:734
site_def * get_executor_site_rw()
Definition: xcom_base.cc:871
int xcom_client_set_max_leaders(connection_descriptor *fd, node_no max_leaders, uint32_t group_id)
Definition: xcom_base.cc:8475
xcom_event_horizon xcom_get_minimum_event_horizon()
Definition: xcom_base.cc:5461
synode_no get_last_delivered_msg()
Definition: xcom_base.cc:885
void(* xcom_config_receiver)(app_data *a)
Definition: xcom_base.h:217
unsigned long long synode_cnt
Definition: xcom_base.h:50
app_data_ptr init_app_msg(app_data *a, char *payload, u_int payload_size)
Definition: xcom_base.cc:6851
int xcom_client_set_leaders(connection_descriptor *fd, leader_array const leaders, uint32_t group_id)
#define x_actions
Definition: xcom_base.h:159
void set_xcom_local_view_receiver(xcom_local_view_receiver x)
Definition: xcom_interface.cc:84
void handle_learn(site_def const *site, pax_machine *p, pax_msg *m)
Process the incoming Learn message.
Definition: xcom_base.cc:5139
void init_need_boot_op(pax_msg *p, node_address *identity)
Initializes the message p as a need_boot_op message.
Definition: xcom_base.cc:5344
int xcom_client_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.cc:8289
int xcom_client_force_add_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
xcom_input_request_ptr(* xcom_input_try_pop_cb)(void)
Definition: xcom_base.h:264
int xcom_client_set_cache_limit(connection_descriptor *fd, uint64_t cache_limit)
Definition: xcom_base.cc:8443
static char * strerr_msg(char *buf, size_t len, int nr)
Definition: xcom_base.h:497
int ARBITRATOR_HACK
Definition: xcom_base.cc:346
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.cc:1687
void * xcom_thread_main(void *cp)
int64_t xcom_client_send_die(connection_descriptor *fd)
Definition: xcom_base.cc:7968
int xcom_taskmain2(xcom_port listen_port)
Definition: xcom_base.cc:1442
std::unique_ptr< Network_provider_management_interface > get_network_management_interface()
Definition: xcom_base.cc:8543
void set_xcom_data_receiver(xcom_data_receiver x)
Definition: xcom_interface.cc:82
void xcom_input_free_signal_connection(void)
Definition: xcom_base.cc:1249
app_data_ptr init_get_leaders_msg(app_data *a, uint32_t group_id)
Definition: xcom_base.cc:6843
void set_xcom_full_data_receiver(xcom_full_data_receiver x)
void set_log_end(gcs_snapshot *gcs)
Definition: xcom_base.cc:7191
void set_xcom_input_try_pop_cb(xcom_input_try_pop_cb pop)
Definition: xcom_base.cc:1082
synode_no decr_synode(synode_no synode)
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.cc:5023
void set_xcom_recovery_restart_cb(xcom_recovery_cb x)
void(* xcom_full_data_receiver)(site_def const *site, pax_machine *pma, app_data_ptr app, delivery_status app_status)
Definition: xcom_base.h:189
site_def * install_node_group(app_data_ptr a)
Definition: xcom_base.cc:1960
void site_post_install_action(site_def *site)
app_data_ptr init_set_cache_size_msg(app_data *a, uint64_t cache_limit)
Definition: xcom_base.cc:6867
site_def const * get_proposer_site()
Definition: xcom_base.cc:875
int reply_handler_task(task_arg arg)
Definition: xcom_base.cc:6690
bool_t handle_max_leaders(app_data_ptr a)
Definition: xcom_base.cc:3718
void set_xcom_config_receiver(xcom_config_receiver x)
Definition: xcom_interface.cc:95
void xcom_thread_init()
Definition: xcom_base.cc:932
unsigned short xcom_port
Definition: xcom_common.h:45
struct xcom_input_request * xcom_input_request_ptr
Definition: xcom_input_request.h:32
int(* xcom_debugger_check)(const int64_t debug_options)
Definition: xcom_logger.h:78
void(* xcom_debugger)(const char *format,...)
Definition: xcom_logger.h:76
void(* xcom_logger)(const int64_t level, const char *message)
Definition: xcom_logger.h:75
static int pm(xcom_port port)
Definition: xcom_transport.cc:98