MySQL 8.1.0
Source Code Documentation
xcom_base.h
Go to the documentation of this file.
1/* Copyright (c) 2012, 2023, 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
50typedef 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
61static trans_id const last_trans = {0xffffffff, 0xffffffff};
62
63#endif
64
65extern int ARBITRATOR_HACK;
66extern task_arg null_arg;
67
68void *xcom_thread_main(void *cp);
69
70synode_no incr_synode(synode_no synode);
71
72synode_no decr_synode(synode_no synode);
73
74char *dbg_pax_msg(pax_msg const *p);
75pax_msg *dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue);
76synode_no set_executed_msg(synode_no msgno);
77void request_values(synode_no find, synode_no end);
78void set_group(uint32_t id);
80int xcom_booted();
81int iamthegreatest(site_def const *s);
82void xcom_send(app_data_ptr a, pax_msg *msg);
85synode_no get_max_synode();
87int taskmain(xcom_port listen_port);
88void xcom_thread_init();
89site_def *install_node_group(app_data_ptr a);
90int xcom_taskmain2(xcom_port listen_port);
91void set_max_synode(synode_no synode);
92synode_no set_current_message(synode_no msgno);
93
94int is_real_recover(app_data_ptr a);
95
96void init_xcom_base();
97uint32_t new_id();
98synode_no get_boot_key();
102synode_no get_current_message();
104
105int is_node_v4_reachable(char *node_address);
106int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info);
107int 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 */
140int pre_process_incoming_ping(site_def const *site, pax_msg const *pm,
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#define x_actions \
154 X(x_fsm_wait) \
155 , X(x_fsm_poll), X(x_fsm_init), X(x_fsm_u_boot), X(x_fsm_add), \
156 X(x_fsm_net_boot), X(x_fsm_force_config), X(x_fsm_snapshot), \
157 X(x_fsm_local_snapshot), X(x_fsm_snapshot_wait), X(x_fsm_need_snapshot), \
158 X(x_fsm_complete), X(x_fsm_terminate), X(x_fsm_exit), X(x_fsm_timeout)
159#define X(a) a
160
163#undef X
164
165extern const char *xcom_actions_name[];
166
167struct add_args {
168 char *addr;
170 node_list *nl;
171};
172typedef struct add_args add_args;
173
175
176char const *xcom_fsm(xcom_actions action, task_arg fsmargs);
178
179void site_install_action(site_def *site, cargo_type operation);
180void send_client_add_node(char *srv, xcom_port port, node_list *nl);
181void send_client_remove_node(char *srv, xcom_port port, node_list *nl);
182
183typedef void (*xcom_full_data_receiver)(site_def const *site, pax_machine *pma,
184 app_data_ptr app,
185 delivery_status app_status);
187
188typedef void (*xcom_full_local_view_receiver)(site_def const *site,
189 node_set nodes);
191
192typedef void (*xcom_full_global_view_receiver)(site_def const *site,
193 synode_no message_id,
194 node_set nodes);
196
197typedef void (*xcom_data_receiver)(synode_no message_id, synode_no origin,
198 site_def const *site, node_set nodes,
199 u_int size, synode_no last_removed,
200 char *data);
202
203typedef void (*xcom_local_view_receiver)(synode_no message_id, node_set nodes);
205
206typedef void (*xcom_global_view_receiver)(synode_no config_id,
207 synode_no message_id, node_set nodes,
208 xcom_event_horizon);
210
211typedef void (*xcom_config_receiver)(app_data *a);
212
214
218
219typedef void (*app_snap_handler)(blob *gcs_snap, synode_no log_start,
220 synode_no log_end);
222
223typedef synode_no (*app_snap_getter)(blob *gcs_snap);
225
226typedef void (*xcom_state_change_cb)(int status);
231
232typedef int (*should_exit_getter)();
234
235typedef void (*xcom_recovery_cb)();
236
238
240
242
244
245app_data_ptr init_config_with_group(app_data *a, node_list *nl, cargo_type type,
246 uint32_t group_id);
247app_data_ptr init_set_event_horizon_msg(app_data *a, uint32_t group_id,
248 xcom_event_horizon event_horizon);
249app_data_ptr init_get_leaders_msg(app_data *a, uint32_t group_id);
250app_data_ptr init_set_cache_size_msg(app_data *a, uint64_t cache_limit);
251app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id);
252app_data_ptr init_app_msg(app_data *a, char *payload, u_int payload_size);
253app_data_ptr init_terminate_command(app_data *a);
254
255void terminate_and_exit();
256
257/* Hook the logic to pop from the input channel. */
260/* Create a connection to the input channel's signalling socket. */
262/* Signal that the input channel has commands. */
264/* Destroy the connection to the input channel's signalling socket. */
266
267/*
268 Registers a callback that is called right after
269 the accept routine returns.
270 */
271typedef int (*xcom_socket_accept_cb)(int fd, site_def const *config);
273
277 uint32_t group_id);
279 uint32_t group_id);
281 uint32_t group_id);
283 uint32_t group_id);
285 uint32_t group_id);
287 uint32_t group_id);
289int64_t xcom_client_send_data(uint32_t size, char *data,
291xcom_event_horizon xcom_get_minimum_event_horizon();
292xcom_event_horizon xcom_get_maximum_event_horizon();
294 xcom_event_horizon *event_horizon);
296 xcom_event_horizon event_horizon);
299 uint64_t cache_limit);
301 uint32_t group_id,
302 synode_no_array *const synodes,
303 synode_app_data_array *const reply);
305int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a,
306 int force);
307
308std::unique_ptr<Network_provider_management_interface>
310
311std::unique_ptr<Network_provider_operations_interface>
313
314/**
315 Copies app data @c source into @c target and checks if the copy
316 succeeded. Sets *target to NULL if the copy fails.
317
318 @param[in, out] target The pax_msg to which the app_data will be copied.
319 @param source The app data that will be copied.
320 @retval TRUE if the copy was successful.
321 @retval FALSE if the copy failed, in which case *target is set to NULL;
322 a failed copy means that there was an error allocating memory for
323 the copy.
324*/
325bool_t safe_app_data_copy(pax_msg **target, app_data_ptr source);
326
327/**
328 * Initializes the message @c msg to go through a 3-phase, regular Paxos.
329 * Executed by Proposers.
330 *
331 * @param site XCom configuration
332 * @param p Paxos instance
333 * @param msg Message to send
334 * @param msgno Synode where @c msg will be proposed
335 * @param msg_type The type of the message, e.g. normal or no_op
336 */
337void prepare_push_3p(site_def const *site, pax_machine *p, pax_msg *msg,
338 synode_no msgno, pax_msg_type msg_type);
339/**
340 * Initializes the message @c p as a Prepare message, as in the message for
341 * Phase 1 (a) of the Paxos protocol.
342 * Executed by Proposers.
343 *
344 * @param p The message to send
345 */
347/**
348 * Initializes the message @c p as a Prepare message for a no-op, as in the
349 * message for Phase 1 (a) of the Paxos protocol.
350 * Executed by Proposers.
351 *
352 * @param p The no-op message to send
353 * @retval created paxos message of type no_op
354 */
356/**
357 * Process the incoming Prepare message from a Proposer, as in the message for
358 * Phase 1 (a) of the Paxos protocol.
359 * Executed by Acceptors.
360 *
361 * @param p Paxos instance
362 * @param pm Incoming Prepare message
363 * @param synode Synode of the Paxos instance/Accept message
364 * @retval pax_msg* the reply to send to the Proposer (as in the Phase 1 (b)
365 * message of the Paxos protocol) if the Acceptor accepts the Prepare
366 * @retval NULL otherwise
367 */
368pax_msg *handle_simple_prepare(pax_machine *p, pax_msg *pm, synode_no synode);
369/**
370 * Process the incoming acknowledge from an Acceptor to a sent Prepare, as in
371 * the message for Phase 1 (b) of the Paxos protocol.
372 * Executed by Proposers.
373 *
374 * @param site XCom configuration
375 * @param p Paxos instance
376 * @param m Incoming message
377 * @retval TRUE if a majority of Acceptors replied to the Proposer's Prepare
378 * @retval FALSE otherwise
379 */
381 pax_msg *m);
382/**
383 * Initializes the proposer's message to go through a 2-phase Paxos on the
384 * proposer's reserved ballot (0,_).
385 * Executed by Proposers.
386 *
387 * @param site XCom configuration
388 * @param p Paxos instance
389 */
390void prepare_push_2p(site_def const *site, pax_machine *p);
391/**
392 * Initializes the message @c p as an Accept message, as in the message for
393 * Phase 2 (a) of the Paxos protocol.
394 * Executed by Proposers.
395 *
396 * @param p The message to send
397 */
399/**
400 * Process the incoming Accept from a Proposer, as in the message for
401 * Phase 2 (a) of the Paxos protocol.
402 * Executed by Acceptors.
403 *
404 * @param p Paxos instance
405 * @param m Incoming Accept message
406 * @param synode Synode of the Paxos instance/Accept message
407 * @retval pax_msg* the reply to send to the Proposer (as in the Phase 2 (b)
408 * message of the Paxos protocol) if the Acceptor accepts the Accept
409 * @retval NULL otherwise
410 */
411pax_msg *handle_simple_accept(pax_machine *p, pax_msg *m, synode_no synode);
412/**
413 * Process the incoming acknowledge from an Acceptor to a sent Accept, as in
414 * the message for Phase 2 (b) of the Paxos protocol. Executed by Proposers.
415 *
416 * @param site XCom configuration
417 * @param p Paxos instance
418 * @param m Incoming message
419 * @retval pax_msg* the Learn message to send to Leaners if a majority of
420 * Acceptors replied to the Proposer's Accept
421 * @retval NULL otherwise
422 */
424 pax_msg *m);
425/**
426 * Process the incoming tiny, i.e. without the learned value, Learn message.
427 * Executed by Learners.
428 *
429 * @param site XCom configuration
430 * @param pm Paxos instance
431 * @param p Incoming message
432 */
433void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p);
434/**
435 * Process the incoming Learn message.
436 * Executed by Learners.
437 *
438 * @param site XCom configuration
439 * @param p Paxos instance
440 * @param m Incoming message
441 */
442void handle_learn(site_def const *site, pax_machine *p, pax_msg *m);
443/**
444 * @retval 1 if the value for the Paxos instance @c *p has been learned
445 * @retval 0 otherwise
446 */
448/** @return true if we should process the incoming need_boot_op message passed
449 * in parameter p. */
451/**
452 * Initializes the message @c p as a need_boot_op message.
453 *
454 * @param p The message to send
455 * @param identity The unique incarnation identifier of this XCom instance
456 */
457void init_need_boot_op(pax_msg *p, node_address *identity);
458
459int xcom_client_set_max_leaders(connection_descriptor *fd, node_no max_leaders,
460 uint32_t group_id);
461
462void init_set_max_leaders(uint32_t group_id, app_data *a, node_no max_leaders);
463void init_set_leaders(uint32_t group_id, app_data *a,
464 leader_array const leaders);
465void init_set_leaders(uint32_t group_id, app_data *a, u_int n,
466 char const *names[]);
467void init_set_leaders(uint32_t group_id, app_data *leader_app,
468 leader_array const leaders, app_data *max_app,
469 node_no max_leaders);
470void init_set_leaders(uint32_t group_id, app_data *leader_app, u_int n,
471 char const *names[], app_data *max_app,
472 node_no max_leaders);
473
475 leader_array const leaders, uint32_t group_id);
477 char const *names[], uint32_t group_id);
479 leader_array const leaders, node_no max_leaders,
480 uint32_t group_id);
482 char const *names[], node_no max_leaders,
483 uint32_t group_id);
484
485int xcom_client_get_leaders(connection_descriptor *fd, uint32_t group_id,
486 leader_info_data *leaders);
487
488typedef void (*xcom_election_cb)(leader_array leaders);
490
491static inline char *strerr_msg(char *buf, size_t len, int nr) {
492#if defined(_WIN32)
493 strerror_s(buf, len, nr);
494#else
495 snprintf(buf, len, "%s", strerror(nr));
496#endif
497 return buf;
498}
499
500void xcom_sleep(unsigned int seconds);
501
502#define XCOM_COMMS_ERROR 1
503#define XCOM_COMMS_OTHER 2
504#define XCOM_COMMS_OK 0
506
507extern "C" synode_no get_delivered_msg();
508void set_max_synode_from_unified_boot(synode_no unified_boot_synode);
510synode_no get_default_start(app_data_ptr a);
511synode_no get_last_delivered_msg();
512void set_log_end(gcs_snapshot *gcs);
513
514extern "C" void synthesize_leaders(leader_array *leaders);
515
516#define XCOM_FSM(action, arg) \
517 do { \
518 const char *s = xcom_fsm(action, arg); \
519 G_TRACE("%f %s:%d", seconds(), __FILE__, __LINE__); \
520 G_DEBUG("new state %s", s); \
521 } while (0)
522
524bool_t handle_max_leaders(app_data_ptr a);
525
526#endif
static char buf[MAX_BUF]
Definition: conf_to_src.cc:72
const char * p
Definition: ctype-mb.cc:1234
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:709
Definition: buf0block_hint.cc:29
constexpr value_type blob
Definition: classic_protocol_constants.h:271
const byte * find(const Pages *pages, const page_id_t &page_id) noexcept
Find a doublewrite copy of a page.
Definition: buf0dblwr.cc:3574
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:191
Definition: srv0dynamic_procedures.h:47
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:167
char * addr
Definition: xcom_base.h:168
xcom_port port
Definition: xcom_base.h:169
node_list * nl
Definition: xcom_base.h:170
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:508
xcom_actions
Definition: xcom_base.h:161
void set_xcom_logger(xcom_logger x)
Definition: xcom_interface.cc:105
const char * xcom_actions_name[]
Definition: xcom_base.cc:7183
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:3846
void(* xcom_global_view_receiver)(synode_no config_id, synode_no message_id, node_set nodes, xcom_event_horizon)
Definition: xcom_base.h:206
void init_xcom_base()
Definition: xcom_base.cc:891
int taskmain(xcom_port listen_port)
void set_xcom_comms_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1083
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:6863
int xcom_client_get_leaders(connection_descriptor *fd, uint32_t group_id, leader_info_data *leaders)
Definition: xcom_base.cc:8680
site_def const * get_proposer_site()
Definition: xcom_base.cc:879
synode_no get_default_start(app_data_ptr a)
site_def * get_executor_site_rw()
Definition: xcom_base.cc:875
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:8446
void set_xcom_run_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1081
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:2971
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:5355
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:4809
void send_x_fsm_complete()
Definition: xcom_base.cc:7162
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:6898
synode_no get_delivered_msg()
Definition: xcom_base.cc:885
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:197
int(* should_exit_getter)()
Definition: xcom_base.h:232
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:271
app_data_ptr init_get_event_horizon_msg(app_data *a, uint32_t group_id)
Definition: xcom_base.cc:6927
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:219
synode_no get_max_synode()
Definition: xcom_base.cc:512
void set_app_snap_handler(app_snap_handler x)
Definition: xcom_base.cc:7746
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:8387
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:235
void xcom_send(app_data_ptr a, pax_msg *msg)
Definition: xcom_base.cc:1759
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:6907
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:5084
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:5041
task_arg null_arg
Definition: task.cc:106
synode_no(* app_snap_getter)(blob *gcs_snap)
Definition: xcom_base.h:223
void init_set_max_leaders(uint32_t group_id, app_data *a, node_no max_leaders)
Definition: xcom_base.cc:8576
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:6504
synode_no set_current_message(synode_no msgno)
Definition: xcom_base.cc:3014
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:1785
void handle_tiny_learn(site_def const *site, pax_machine *pm, pax_msg *p)
Process the incoming tiny, i.e.
Definition: xcom_base.cc:5126
void init_set_leaders(uint32_t group_id, app_data *a, leader_array const leaders)
Definition: xcom_base.cc:8604
void site_install_action(site_def *site, cargo_type operation)
Definition: xcom_base.cc:1868
int64_t xcom_send_client_app_data(connection_descriptor *fd, app_data_ptr a, int force)
Definition: xcom_base.cc:7980
int xcom_client_enable_arbitrator(connection_descriptor *fd)
Definition: xcom_base.cc:8525
xcom_event_horizon xcom_get_maximum_event_horizon()
Definition: xcom_base.cc:5530
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:5417
void(* xcom_state_change_cb)(int status)
Definition: xcom_base.h:226
int xcom_client_convert_into_local_server(connection_descriptor *const fd)
Definition: xcom_base.cc:8565
void synthesize_leaders(leader_array *leaders)
Definition: xcom_base.cc:1926
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:8538
site_def * install_node_group(app_data_ptr a)
Definition: xcom_base.cc:1980
void set_xcom_expel_cb(xcom_state_change_cb x)
Definition: xcom_base.cc:1084
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:1176
void set_max_synode(synode_no synode)
Definition: xcom_base.cc:1989
int is_node_v4_reachable(char *node_address)
Definition: xcom_base.cc:7926
void xcom_thread_deinit()
Definition: xcom_base.cc:969
synode_no get_current_message()
Definition: xcom_base.cc:447
int is_node_v4_reachable_with_info(struct addrinfo *retrieved_addr_info)
Definition: xcom_base.cc:7908
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:188
void set_group(uint32_t id)
Set node group.
Definition: xcom_base.cc:625
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:7945
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:4985
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:192
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:488
synode_no incr_synode(synode_no synode)
Definition: xcom_base.cc:675
int iamthegreatest(site_def const *s)
Definition: xcom_base.cc:2691
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:1082
bool_t xcom_input_signal(void)
Definition: xcom_base.cc:1240
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:491
void set_max_synode_from_unified_boot(synode_no unified_boot_synode)
void set_should_exit_getter(should_exit_getter x)
Definition: task.cc:1153
void(* xcom_local_view_receiver)(synode_no message_id, node_set nodes)
Definition: xcom_base.h:203
app_data_ptr init_terminate_command(app_data *a)
void set_app_snap_getter(app_snap_getter x)
Definition: xcom_base.cc:7749
int pm_finished(pax_machine *p)
Definition: xcom_base.cc:738
int xcom_client_set_max_leaders(connection_descriptor *fd, node_no max_leaders, uint32_t group_id)
Definition: xcom_base.cc:8584
xcom_event_horizon xcom_get_minimum_event_horizon()
Definition: xcom_base.cc:5526
synode_no get_last_delivered_msg()
Definition: xcom_base.cc:889
site_def const * get_executor_site()
Definition: xcom_base.cc:874
void(* xcom_config_receiver)(app_data *a)
Definition: xcom_base.h:211
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:6931
int xcom_client_set_leaders(connection_descriptor *fd, leader_array const leaders, uint32_t group_id)
#define x_actions
Definition: xcom_base.h:153
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:5200
char const * xcom_fsm(xcom_actions action, task_arg fsmargs)
Definition: xcom_base.cc:7733
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:5405
std::unique_ptr< Network_provider_operations_interface > get_network_operations_interface()
Definition: xcom_base.cc:8657
int xcom_client_remove_node(connection_descriptor *fd, node_list *nl, uint32_t group_id)
Definition: xcom_base.cc:8397
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:258
int xcom_client_set_cache_limit(connection_descriptor *fd, uint64_t cache_limit)
Definition: xcom_base.cc:8551
int ARBITRATOR_HACK
Definition: xcom_base.cc:349
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:8058
pax_msg * dispatch_op(site_def const *site, pax_msg *p, linkage *reply_queue)
Definition: xcom_base.cc:6389
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:82
std::unique_ptr< Network_provider_management_interface > get_network_management_interface()
Definition: xcom_base.cc:8652
void xcom_input_free_signal_connection(void)
Definition: xcom_base.cc:1256
app_data_ptr init_get_leaders_msg(app_data *a, uint32_t group_id)
Definition: xcom_base.cc:6923
void set_xcom_full_data_receiver(xcom_full_data_receiver x)
void set_log_end(gcs_snapshot *gcs)
Definition: xcom_base.cc:7281
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:4868
void set_xcom_input_try_pop_cb(xcom_input_try_pop_cb pop)
Definition: xcom_base.cc:1086
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:183
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:6947
int reply_handler_task(task_arg arg)
Definition: xcom_base.cc:6768
bool_t handle_max_leaders(app_data_ptr a)
Definition: xcom_base.cc:3775
void set_xcom_config_receiver(xcom_config_receiver x)
Definition: xcom_interface.cc:95
void xcom_thread_init()
Definition: xcom_base.cc:936
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