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