MySQL 8.0.39
Source Code Documentation
site_struct.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 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 SITE_STRUCT_H
25#define SITE_STRUCT_H
26
27#include "xcom/node_no.h"
28#include "xcom/server_struct.h"
29#include "xcom/synode_no.h"
30#include "xcom/xcom_detector.h"
31#include "xdr_gen/xcom_vp.h"
32
33/* Reserved value to signal that all nodes should be leaders */
34enum { active_leaders_all = 0 };
35
36typedef struct site_def site_def;
37typedef struct pax_msg pax_msg;
38typedef struct linkage linkage;
39
40typedef void (*msg_handler)(site_def const *site, pax_msg *p,
41 linkage *reply_queue);
42
43struct site_def {
44 synode_no start NULL_SYNODE; /* Config is active from this message number */
45 synode_no boot_key
46 NULL_SYNODE; /* The message number of the original unified_boot */
47 node_no nodeno{VOID_NODE_NO}; /* Node number of this node */
48 node_list nodes{0, nullptr}; /* Set of nodes in this config */
49 server *servers[NSERVERS]{nullptr}; /* Connections to other nodes */
51 0.0}; /* Time of last incoming message for each node */
52 node_no global_node_count{0}; /* Number of live nodes in global_node_set */
53 node_set global_node_set{0, nullptr}; /* The global view */
54 node_set local_node_set{0, nullptr}; /* The local view */
55 int detector_updated{0}; /* Has detector state been updated? */
56 xcom_proto x_proto{x_unknown_proto};
58 double install_time{0.0};
59 xcom_event_horizon event_horizon{EVENT_HORIZON_MIN};
60 node_no max_active_leaders{active_leaders_all}; /* How many leaders can there
61 be? >= 1 and <= number of nodes */
62 leader_array leaders{0, nullptr}; /* Leaders as defined by client */
63 msg_handler *dispatch_table{nullptr}; /* Per-config dispatch table */
64 bool cached_leaders{false}; /* Initialized leader cache ? */
65 bool active_leader[NSERVERS]{0}; /* Leader cache */
66 node_no found_leaders{0}; /* Number of leaders found */
67};
68#endif
const char * p
Definition: ctype-mb.cc:1237
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:177
#define VOID_NODE_NO
Definition: node_no.h:36
struct pax_msg pax_msg
Definition: site_struct.h:37
@ active_leaders_all
Definition: site_struct.h:34
void(* msg_handler)(site_def const *site, pax_msg *p, linkage *reply_queue)
Definition: site_struct.h:40
Definition: simset.h:36
Definition: server_struct.h:39
Definition: site_struct.h:43
double install_time
Definition: site_struct.h:58
synode_no boot_key NULL_SYNODE
Definition: site_struct.h:46
xcom_proto x_proto
Definition: site_struct.h:56
xcom_event_horizon event_horizon
Definition: site_struct.h:59
bool cached_leaders
Definition: site_struct.h:64
detector_state detected
Definition: site_struct.h:50
synode_no delivered_msg[NSERVERS]
Definition: site_struct.h:57
server * servers[NSERVERS]
Definition: site_struct.h:49
node_no found_leaders
Definition: site_struct.h:66
int detector_updated
Definition: site_struct.h:55
node_no global_node_count
Definition: site_struct.h:52
synode_no start NULL_SYNODE
Definition: site_struct.h:44
node_set global_node_set
Definition: site_struct.h:53
bool active_leader[NSERVERS]
Definition: site_struct.h:65
node_no nodeno
Definition: site_struct.h:47
leader_array leaders
Definition: site_struct.h:62
msg_handler * dispatch_table
Definition: site_struct.h:63
node_set local_node_set
Definition: site_struct.h:54
node_no max_active_leaders
Definition: site_struct.h:60
node_list nodes
Definition: site_struct.h:48
double detector_state[NSERVERS]
Definition: xcom_detector.h:32
#define NSERVERS
Definition: xcom_limits.h:27
@ EVENT_HORIZON_MIN
Definition: xcom_profile.h:69