MySQL 8.0.40
Source Code Documentation
xcom_base.h
Go to the documentation of this file.
1/* Copyright (c) 2012, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef XCOM_BASE_H
25#define XCOM_BASE_H
26
27#include <stddef.h>
28#ifdef __APPLE__
29#include <stdio.h>
30#endif
31
32#ifndef _WIN32
33#include <netdb.h>
34#endif
35
36#include <memory>
37
40#include "xcom/site_struct.h"
41#include "xcom/task_arg.h"
42#include "xcom/task_debug.h"
43#include "xcom/x_platform.h"
44#include "xcom/xcom_cache.h"
46#include "xcom/xcom_os_layer.h"
47#include "xcom/xdr_utils.h"
48
49#define XCOM_THREAD_DEBUG 1
50
51typedef unsigned long long synode_cnt;
52
53#define SET_EXECUTED_MSG(x) \
54 do { \
55 IFDBG(D_NONE, FN); \
56 set_executed_msg(x); \
57 } while (0)
58
59/* Constants */
60
61#ifdef XCOM_TRANSACTIONS
62static trans_id const last_trans = {0xffffffff, 0xffffffff};
63
64#endif
65
66extern int ARBITRATOR_HACK;
67extern task_arg null_arg;
68
69void *xcom_thread_main(void *cp);
70
71synode_no incr_synode(synode_no synode);
72
73synode_no decr_synode(synode_no synode);
74
75char *dbg_pax_msg(pax_msg const *p);
76pax_msg *dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue);
77synode_no set_executed_msg(synode_no msgno);
78void request_values(synode_no find, synode_no end);
79void set_group(uint32_t id);
81int xcom_booted();
82int iamthegreatest(site_def const *s);
83void xcom_send(app_data_ptr a, pax_msg *msg);
86synode_no get_max_synode();
88int taskmain(xcom_port listen_port);
89void xcom_thread_init();
90site_def *install_node_group(app_data_ptr a);
91int xcom_taskmain2(xcom_port listen_port);
92void set_max_synode(synode_no synode);
93synode_no set_current_message(synode_no msgno);
94
95int is_real_recover(app_data_ptr a);
96
97void init_xcom_base();
98uint32_t new_id();
99synode_no get_boot_key();
103synode_no get_current_message();
105
106int is_node_v4_reachable(char *node_address);
107int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info);
108int are_we_allowed_to_upgrade_to_v6(app_data_ptr a);
109
110/**
111 * @brief Process incoming are_you_alive (i.e.: ping) messages and act
112 * accordingly
113 *
114 * GCS/XCom has a full mesh of connections between all nodes. A connects to B
115 * and B connects back to A.
116 *
117 * If we cut out B with, for instance, a firewall, we have the A->B connection
118 * silently dead, but we have the B->A connection alive. Since we only do
119 * monitoring on one half of the connection (the incoming messages), we will
120 * consider that B is alive, although we can't contact it. In the same way, B
121 * will consider that A is dead, since it does not receive any message from it.
122 *
123 * We must be able to break the outgoing connection if we detect that something
124 * is wrong, in order to make the bi-directional connection state consistent and
125 * report that node as unreachable. That can be done if we start receiving
126 * pings from a node that we consider that it is alive. After some pings,
127 * we just kill the outgoing connection, thus creating a consistent state.
128 *
129 * Breaking this connection should only occur if the node has already booted,
130 * meaning that the whole joining process is complete and the node is up and
131 * running. This is due to the fact that we receive pings as part of the
132 * process of joining a group.
133 *
134 * @param site current site definitions
135 * @param pm a possible ping message:
136 * @param has_client_already_booted check if this node has already booted
137 * @param current_time current XCom time
138 *
139 * @return int 1 if the node connection is closed. 0, otherwise.
140 */
141int pre_process_incoming_ping(site_def const *site, pax_msg const *pm,
142 int has_client_already_booted,
143 double current_time);
144
145#define RESET_CLIENT_MSG \
146 if (ep->client_msg) { \
147 msg_link_delete(&ep->client_msg); \
148 }
149
150#define APP ep->client_msg->p->a
151
152#define FIND_MAX (MIN_LENGTH / 10)
153
154#define x_actions \
155 X(x_fsm_wait) \
156 , X(x_fsm_poll), X(x_fsm_init), X(x_fsm_u_boot), X(x_fsm_add), \
157 X(x_fsm_net_boot), X(x_fsm_force_config), X(x_fsm_snapshot), \
158 X(x_fsm_local_snapshot), X(x_fsm_snapshot_wait), X(x_fsm_need_snapshot), \
159 X(x_fsm_complete), X(x_fsm_terminate), X(x_fsm_exit), X(x_fsm_timeout)
160#define X(a) a
161
164#undef X
165
166extern const char *xcom_actions_name[];
167
168struct add_args {
169 char *addr;
171 node_list *nl;
172};
173typedef struct add_args add_args;
174
176
177char const *xcom_fsm(xcom_actions action, task_arg fsmargs);
179
180void site_install_action(site_def *site, cargo_type operation);
181void send_client_add_node(char *srv, xcom_port port, node_list *nl);
182void send_client_remove_node(char *srv, xcom_port port, node_list *nl);
183
184typedef void (*xcom_full_data_receiver)(site_def const *site, pax_machine *pma,
185 app_data_ptr app,
186 delivery_status app_status);
188
189typedef void (*xcom_full_local_view_receiver)(site_def const *site,
190 node_set nodes);
192
193typedef void (*xcom_full_global_view_receiver)(site_def const *site,
194 synode_no message_id,
195 node_set nodes);
197
198typedef void (*xcom_data_receiver)(synode_no message_id, synode_no origin,
199 site_def const *site, node_set nodes,
200 u_int size, synode_no last_removed,
201 char *data);
203
204typedef void (*xcom_local_view_receiver)(synode_no message_id, node_set nodes);
206
207typedef void (*xcom_global_view_receiver)(synode_no config_id,
208 synode_no message_id, node_set nodes,
209 xcom_event_horizon);
211
212typedef void (*xcom_config_receiver)(app_data *a);
213
215
219
220typedef void (*app_snap_handler)(blob *gcs_snap, synode_no log_start,
221 synode_no log_end);
223
224typedef synode_no (*app_snap_getter)(blob *gcs_snap);
226
227typedef void (*xcom_state_change_cb)(int status);
232
233typedef int (*should_exit_getter)();
235
236typedef void (*xcom_recovery_cb)();
237
239
241
243
245
246app_data_ptr init_config_with_group(app_data *a, node_list *nl, cargo_type type,
247 uint32_t group_id);
248app_data_ptr init_set_event_horizon_msg(app_data *a, uint32_t group_id,
249 xcom_event_horizon event_horizon);
250app_data_ptr init_get_leaders_msg(app_data *a, uint32_t group_id);
251app_data_ptr init_set_cache_size_msg(app_data *a, uint64_t cache_limit);
252app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id);
253app_data_ptr init_app_msg(app_data *a, char *payload, u_int payload_size);
254app_data_ptr init_terminate_command(app_data *a);
255
256void terminate_and_exit();
257
258/* Hook the logic to pop from the input channel. */
261/* Create a connection to the input channel's signalling socket. */
263/* Signal that the input channel has commands. */
265/* Destroy the connection to the input channel's signalling socket. */
267
268/*
269 Registers a callback that is called right after
270 the accept routine returns.
271 */
272typedef int (*xcom_socket_accept_cb)(int fd, site_def const *config);
274
278 uint32_t group_id);
280 uint32_t group_id);
282 uint32_t group_id);
284 uint32_t group_id);
286 uint32_t group_id);
288 uint32_t group_id);
290int64_t xcom_client_send_data(uint32_t size, char *data,
292xcom_event_horizon xcom_get_minimum_event_horizon();
293xcom_event_horizon xcom_get_maximum_event_horizon();
295 xcom_event_horizon *event_horizon);
297 xcom_event_horizon event_horizon);
300 uint64_t cache_limit);
302 uint32_t group_id,
303 synode_no_array *const synodes,
304 synode_app_data_array *const reply);
306int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a,
307 int force);
308
309std::unique_ptr<Network_provider_management_interface>
311
312std::unique_ptr<Network_provider_operations_interface>
314
315/**
316 Copies app data @c source into @c target and checks if the copy
317 succeeded. Sets *target to NULL if the copy fails.
318
319 @param[in, out] target The pax_msg to which the app_data will be copied.
320 @param source The app data that will be copied.
321 @retval TRUE if the copy was successful.
322 @retval FALSE if the copy failed, in which case *target is set to NULL;
323 a failed copy means that there was an error allocating memory for
324 the copy.
325*/
326bool_t safe_app_data_copy(pax_msg **target, app_data_ptr source);
327
328/**
329 * Initializes the message @c msg to go through a 3-phase, regular Paxos.
330 * Executed by Proposers.
331 *
332 * @param site XCom configuration
333 * @param p Paxos instance
334 * @param msg Message to send
335 * @param msgno Synode where @c msg will be proposed
336 * @param msg_type The type of the message, e.g. normal or no_op
337 */
338void prepare_push_3p(site_def const *site, pax_machine *p, pax_msg *msg,
339 synode_no msgno, pax_msg_type msg_type);
340/**
341 * Initializes the message @c p as a Prepare message, as in the message for
342 * Phase 1 (a) of the Paxos protocol.
343 * Executed by Proposers.
344 *
345 * @param p The message to send
346 */
348/**
349 * Initializes the message @c p as a Prepare message for a no-op, as in the
350 * message for Phase 1 (a) of the Paxos protocol.
351 * Executed by Proposers.
352 *
353 * @param p The no-op message to send
354 * @retval created paxos message of type no_op
355 */
357/**
358 * Process the incoming Prepare message from a Proposer, as in the message for
359 * Phase 1 (a) of the Paxos protocol.
360 * Executed by Acceptors.
361 *
362 * @param p Paxos instance
363 * @param pm Incoming Prepare message
364 * @param synode Synode of the Paxos instance/Accept message
365 * @retval pax_msg* the reply to send to the Proposer (as in the Phase 1 (b)
366 * message of the Paxos protocol) if the Acceptor accepts the Prepare
367 * @retval NULL otherwise
368 */
369pax_msg *handle_simple_prepare(pax_machine *p, pax_msg *pm, synode_no synode);
370/**
371 * Process the incoming acknowledge from an Acceptor to a sent Prepare, as in
372 * the message for Phase 1 (b) of the Paxos protocol.
373 * Executed by Proposers.
374 *
375 * @param site XCom configuration
376 * @param p Paxos instance
377 * @param m Incoming message
378 * @retval TRUE if a majority of Acceptors replied to the Proposer's Prepare
379 * @retval FALSE otherwise
380 */
382 pax_msg *m);
383/**
384 * Initializes the proposer's message to go through a 2-phase Paxos on the
385 * proposer's reserved ballot (0,_).
386 * Executed by Proposers.
387 *
388 * @param site XCom configuration
389 * @param p Paxos instance
390 */
391void prepare_push_2p(site_def const *site, pax_machine *p);
392/**
393 * Initializes the message @c p as an Accept message, as in the message for
394 * Phase 2 (a) of the Paxos protocol.
395 * Executed by Proposers.
396 *
397 * @param p The message to send
398 */
400/**
401 * Process the incoming Accept from a Proposer, as in the message for
402 * Phase 2 (a) of the Paxos protocol.
403 * Executed by Acceptors.
404 *
405 * @param p Paxos instance
406 * @param m Incoming Accept message
407 * @param synode Synode of the Paxos instance/Accept message
408 * @retval pax_msg* the reply to send to the Proposer (as in the Phase 2 (b)
409 * message of the Paxos protocol) if the Acceptor accepts the Accept
410 * @retval NULL otherwise
411 */
412pax_msg *handle_simple_accept(pax_machine *p, pax_msg *m, synode_no synode);
413/**
414 * Process the incoming acknowledge from an Acceptor to a sent Accept, as in
415 * the message for Phase 2 (b) of the Paxos protocol. Executed by Proposers.
416 *
417 * @param site XCom configuration
418 * @param p Paxos instance
419 * @param m Incoming message
420 * @retval pax_msg* the Learn message to send to Leaners if a majority of
421 * Acceptors replied to the Proposer's Accept
422 * @retval NULL otherwise
423 */
425 pax_msg *m);
426/**
427 * Process the incoming tiny, i.e. without the learned value, Learn message.
428 * Executed by Learners.
429 *
430 * @param site XCom configuration
431 * @param pm Paxos instance
432 * @param p Incoming message
433 */
434void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p);
435/**
436 * Process the incoming Learn message.
437 * Executed by Learners.
438 *
439 * @param site XCom configuration
440 * @param p Paxos instance
441 * @param m Incoming message
442 */
443void handle_learn(site_def const *site, pax_machine *p, pax_msg *m);
444/**
445 * @retval 1 if the value for the Paxos instance @c *p has been learned
446 * @retval 0 otherwise
447 */
449/** @return true if we should process the incoming need_boot_op message passed
450 * in parameter p. */
452/**
453 * Initializes the message @c p as a need_boot_op message.
454 *
455 * @param p The message to send
456 * @param identity The unique incarnation identifier of this XCom instance
457 */
458void init_need_boot_op(pax_msg *p, node_address *identity);
459
460int xcom_client_set_max_leaders(connection_descriptor *fd, node_no max_leaders,
461 uint32_t group_id);
462
463void init_set_max_leaders(uint32_t group_id, app_data *a, node_no max_leaders);
464void init_set_leaders(uint32_t group_id, app_data *a,
465 leader_array const leaders);
466void init_set_leaders(uint32_t group_id, app_data *a, u_int n,
467 char const *names[]);
468void init_set_leaders(uint32_t group_id, app_data *leader_app,
469 leader_array const leaders, app_data *max_app,
470 node_no max_leaders);
471void init_set_leaders(uint32_t group_id, app_data *leader_app, u_int n,
472 char const *names[], app_data *max_app,
473 node_no max_leaders);
474
476 leader_array const leaders, uint32_t group_id);
478 char const *names[], uint32_t group_id);
480 leader_array const leaders, node_no max_leaders,
481 uint32_t group_id);
483 char const *names[], node_no max_leaders,
484 uint32_t group_id);
485
486int xcom_client_get_leaders(connection_descriptor *fd, uint32_t group_id,
487 leader_info_data *leaders);
488
489typedef void (*xcom_election_cb)(leader_array leaders);
491
492static inline char *strerr_msg(char *buf, size_t len, int nr) {
493#if defined(_WIN32)
494 strerror_s(buf, len, nr);
495#else
496 snprintf(buf, len, "%s", strerror(nr));
497#endif
498 return buf;
499}
500
501void xcom_sleep(unsigned int seconds);
502
503#define XCOM_COMMS_ERROR 1
504#define XCOM_COMMS_OTHER 2
505#define XCOM_COMMS_OK 0
507
508extern "C" synode_no get_delivered_msg();
509void set_max_synode_from_unified_boot(synode_no unified_boot_synode);
511synode_no get_default_start(app_data_ptr a);
512synode_no get_last_delivered_msg();
513void set_log_end(gcs_snapshot *gcs);
514
515extern "C" void synthesize_leaders(leader_array *leaders);
516
517#define XCOM_FSM(action, arg) \
518 do { \
519 const char *s = xcom_fsm(action, arg); \
520 G_TRACE("%f %s:%d", seconds(), __FILE__, __LINE__); \
521 G_DEBUG("new state %s", s); \
522 } while (0)
523
525bool_t handle_max_leaders(app_data_ptr a);
526
527#endif
const char * p
Definition: ctype-mb.cc:1237
dberr_t log_start(log_t &log, 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:710
Definition: buf0block_hint.cc:30
constexpr value_type blob
Definition: classic_protocol_constants.h:272
const byte * find(const Pages *pages, const page_id_t &page_id) noexcept
Find a doublewrite copy of a page.
Definition: buf0dblwr.cc:3563
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
Definition: srv0dynamic_procedures.h:48
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:61
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42
required string type
Definition: replication_group_member_actions.proto:34
repeated Action action
Definition: replication_group_member_actions.proto:43
struct pax_msg pax_msg
Definition: site_struct.h:37
Definition: xcom_base.h:168
char * addr
Definition: xcom_base.h:169
xcom_port port
Definition: xcom_base.h:170
node_list * nl
Definition: xcom_base.h:171
Definition: node_connection.h:47
Definition: simset.h:36
Definition: xcom_cache.h:95
Definition: site_struct.h:43
Definition: task_arg.h:42
double seconds()
Definition: task.cc:310
__u_int u_int
Definition: types.h:73
int bool_t
Definition: types.h:35
int n
Definition: xcom_base.cc:509
xcom_actions
Definition: xcom_base.h:162
void set_xcom_logger(xcom_logger x)
Definition: xcom_interface.cc:106
const char * xcom_actions_name[]
Definition: xcom_base.cc:7157
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:1719
void set_xcom_recovery_begin_cb(xcom_recovery_cb x)
void terminate_and_exit()
Definition: xcom_base.cc:3820
void(* xcom_global_view_receiver)(synode_no config_id, synode_no message_id, node_set nodes, xcom_event_horizon)
Definition: xcom_base.h:207
void init_xcom_base()
Definition: xcom_base.cc:892
int taskmain(xcom_port listen_port)
void set_xcom_comms_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1084
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:6837
int xcom_client_get_leaders(connection_descriptor *fd, uint32_t group_id, leader_info_data *leaders)
Definition: xcom_base.cc:8654
site_def const * get_proposer_site()
Definition: xcom_base.cc:880
synode_no get_default_start(app_data_ptr a)
site_def * get_executor_site_rw()
Definition: xcom_base.cc:876
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:8420
void set_xcom_run_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1082
void set_xcom_recovery_init_cb(xcom_recovery_cb x)
void * xcom_thread_main(void *cp)
synode_no set_executed_msg(synode_no msgno)
Definition: xcom_base.cc:2945
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:5329
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:4783
void send_x_fsm_complete()
Definition: xcom_base.cc:7136
void set_xcom_global_view_receiver(xcom_global_view_receiver x)
Definition: xcom_interface.cc:89
app_data_ptr init_config_with_group(app_data *a, node_list *nl, cargo_type type, uint32_t group_id)
Definition: xcom_base.cc:6872
synode_no get_delivered_msg()
Definition: xcom_base.cc:886
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:198
int(* should_exit_getter)()
Definition: xcom_base.h:233
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:272
app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id)
Definition: xcom_base.cc:6901
void set_xcom_debugger_check(xcom_debugger_check x)
Definition: xcom_interface.cc:110
void(* app_snap_handler)(blob *gcs_snap, synode_no log_start, synode_no log_end)
Definition: xcom_base.h:220
synode_no get_max_synode()
Definition: xcom_base.cc:513
void set_app_snap_handler(app_snap_handler x)
Definition: xcom_base.cc:7720
int set_xcom_socket_accept_cb(xcom_socket_accept_cb x)
Definition: xcom_network_provider_native_lib.cc:61
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:8361
char * dbg_pax_msg(pax_msg const *p)
int xcom_client_boot(connection_descriptor *fd, node_list *nl, uint32_t group_id)
void(* xcom_recovery_cb)()
Definition: xcom_base.h:236
void xcom_send(app_data_ptr a, pax_msg *msg)
Definition: xcom_base.cc:1756
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:6881
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:5058
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:5015
task_arg null_arg
Definition: task.cc:107
synode_no(* app_snap_getter)(blob *gcs_snap)
Definition: xcom_base.h:224
void init_set_max_leaders(uint32_t group_id, app_data *a, node_no max_leaders)
Definition: xcom_base.cc:8550
void set_xcom_debugger(xcom_debugger x)
Definition: xcom_interface.cc:108
void request_values(synode_no find, synode_no end)
int acceptor_learner_task(task_arg arg)
Definition: xcom_base.cc:6478
synode_no set_current_message(synode_no msgno)
Definition: xcom_base.cc:2988
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:1593
uint32_t new_id()
Create a new (hopefully unique) ID.
Definition: xcom_base.cc:1782
void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p)
Process the incoming tiny, i.e.
Definition: xcom_base.cc:5100
void init_set_leaders(uint32_t group_id, app_data *a, leader_array const leaders)
Definition: xcom_base.cc:8578
void site_install_action(site_def *site, cargo_type operation)
Definition: xcom_base.cc:1865
int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a, int force)
Definition: xcom_base.cc:7954
int xcom_client_enable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.cc:8499
xcom_event_horizon xcom_get_maximum_event_horizon()
Definition: xcom_base.cc:5504
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:5391
void(* xcom_state_change_cb)(int status)
Definition: xcom_base.h:227
int xcom_client_convert_into_local_server(connection_descriptor *const fd)
Definition: xcom_base.cc:8539
void synthesize_leaders(leader_array *leaders)
Definition: xcom_base.cc:1923
int xcom_client_force_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
int xcom_booted()
Definition: xcom_recover.cc:65
int xcom_client_disable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.cc:8512
site_def * install_node_group(app_data_ptr a)
Definition: xcom_base.cc:1977
void set_xcom_expel_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1085
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:1177
void set_max_synode(synode_no synode)
Definition: xcom_base.cc:1986
int is_node_v4_reachable(char *node_address)
Definition: xcom_base.cc:7900
void xcom_thread_deinit()
Definition: xcom_base.cc:970
synode_no get_current_message()
Definition: xcom_base.cc:448
int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info)
Definition: xcom_base.cc:7882
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:189
void set_group(uint32_t id)
Set node group.
Definition: xcom_base.cc:626
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:7919
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:4959
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:193
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:1651
void(* xcom_election_cb)(leader_array leaders)
Definition: xcom_base.h:489
synode_no incr_synode(synode_no synode)
Definition: xcom_base.cc:676
int iamthegreatest(site_def const *s)
Definition: xcom_base.cc:2665
synode_no xcom_get_last_removed_from_cache()
void set_xcom_election_cb(xcom_election_cb x)
void set_xcom_exit_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1083
bool_t xcom_input_signal(void)
Definition: xcom_base.cc:1241
int64_t xcom_client_send_data(uint32_t size, char *data, connection_descriptor *fd)
static char * strerr_msg(char *buf, size_t len, int nr)
Definition: xcom_base.h:492
void set_max_synode_from_unified_boot(synode_no unified_boot_synode)
void set_should_exit_getter(should_exit_getter x)
Definition: task.cc:1136
void(* xcom_local_view_receiver)(synode_no message_id, node_set nodes)
Definition: xcom_base.h:204
app_data_ptr init_terminate_command(app_data *a)
void set_app_snap_getter(app_snap_getter x)
Definition: xcom_base.cc:7723
int pm_finished(pax_machine *p)
Definition: xcom_base.cc:739
int xcom_client_set_max_leaders(connection_descriptor *fd, node_no max_leaders, uint32_t group_id)
Definition: xcom_base.cc:8558
xcom_event_horizon xcom_get_minimum_event_horizon()
Definition: xcom_base.cc:5500
synode_no get_last_delivered_msg()
Definition: xcom_base.cc:890
site_def const * get_executor_site()
Definition: xcom_base.cc:875
void(* xcom_config_receiver)(app_data *a)
Definition: xcom_base.h:212
unsigned long long synode_cnt
Definition: xcom_base.h:51
app_data_ptr init_app_msg(app_data *a, char *payload, u_int payload_size)
Definition: xcom_base.cc:6905
int xcom_client_set_leaders(connection_descriptor *fd, leader_array const leaders, uint32_t group_id)
#define x_actions
Definition: xcom_base.h:154
void set_xcom_local_view_receiver(xcom_local_view_receiver x)
Definition: xcom_interface.cc:85
void handle_learn(site_def const *site, pax_machine *p, pax_msg *m)
Process the incoming Learn message.
Definition: xcom_base.cc:5174
char const * xcom_fsm(xcom_actions action, task_arg fsmargs)
Definition: xcom_base.cc:7707
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:5379
std::unique_ptr< Network_provider_operations_interface > get_network_operations_interface()
Definition: xcom_base.cc:8631
int xcom_client_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.cc:8371
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:259
int xcom_client_set_cache_limit(connection_descriptor *fd, uint64_t cache_limit)
Definition: xcom_base.cc:8525
int ARBITRATOR_HACK
Definition: xcom_base.cc:350
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:1703
int64_t xcom_client_send_die(connection_descriptor *fd)
Definition: xcom_base.cc:8032
pax_msg * dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue)
Definition: xcom_base.cc:6363
int xcom_taskmain2(xcom_port listen_port)
Definition: xcom_base.cc:1458
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:1602
void set_xcom_data_receiver(xcom_data_receiver x)
Definition: xcom_interface.cc:83
std::unique_ptr< Network_provider_management_interface > get_network_management_interface()
Definition: xcom_base.cc:8626
void xcom_input_free_signal_connection(void)
Definition: xcom_base.cc:1257
app_data_ptr init_get_leaders_msg(app_data *a, uint32_t group_id)
Definition: xcom_base.cc:6897
void set_xcom_full_data_receiver(xcom_full_data_receiver x)
void set_log_end(gcs_snapshot *gcs)
Definition: xcom_base.cc:7255
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:4842
void set_xcom_input_try_pop_cb(xcom_input_try_pop_cb pop)
Definition: xcom_base.cc:1087
synode_no decr_synode(synode_no synode)
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:184
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:6921
int reply_handler_task(task_arg arg)
Definition: xcom_base.cc:6742
bool_t handle_max_leaders(app_data_ptr a)
Definition: xcom_base.cc:3749
void set_xcom_config_receiver(xcom_config_receiver x)
Definition: xcom_interface.cc:96
void xcom_thread_init()
Definition: xcom_base.cc:937
unsigned short xcom_port
Definition: xcom_common.h:46
struct xcom_input_request * xcom_input_request_ptr
Definition: xcom_input_request.h:33
int(* xcom_debugger_check)(const int64_t debug_options)
Definition: xcom_logger.h:79
void(* xcom_debugger)(const char *format,...)
Definition: xcom_logger.h:77
void(* xcom_logger)(const int64_t level, const char *message)
Definition: xcom_logger.h:76
static int pm(xcom_port port)
Definition: xcom_transport.cc:99