MySQL  8.0.22
Source Code Documentation
plugin_group_replication.h
Go to the documentation of this file.
1 /* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
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 MYSQL_PLUGIN_GROUP_REPLICATION_INCLUDED
24 #define MYSQL_PLUGIN_GROUP_REPLICATION_INCLUDED
25 
26 /**
27  @file include/mysql/plugin_group_replication.h
28  API for Group Replication plugin. (MYSQL_GROUP_REPLICATION_PLUGIN)
29 */
30 
31 #include <mysql/plugin.h>
32 #define MYSQL_GROUP_REPLICATION_INTERFACE_VERSION 0x0104
33 
35  // allow executing reads from newer primary even when backlog isn't applied
37  // hold data reads and writes on the new primary until applies all the backlog
42 };
43 
44 /*
45  Callbacks for get_connection_status_info function.
46 
47  context field can have NULL value, plugin will always pass it
48  through all callbacks, independent of its value.
49  Its value will not be used by plugin.
50 
51  All callbacks are mandatory.
52 */
54  void *const context;
55  void (*set_channel_name)(void *const context, const char &value,
56  size_t length);
57  void (*set_group_name)(void *const context, const char &value, size_t length);
58  void (*set_source_uuid)(void *const context, const char &value,
59  size_t length);
60  void (*set_service_state)(void *const context, bool state);
61 };
62 
63 /*
64  Callbacks for get_group_members_info function.
65 
66  context field can have NULL value, plugin will always pass it
67  through all callbacks, independent of its value.
68  Its value will not be used by plugin.
69 
70  All callbacks are mandatory.
71 */
73  void *const context;
74  void (*set_channel_name)(void *const context, const char &value,
75  size_t length);
76  void (*set_member_id)(void *const context, const char &value, size_t length);
77  void (*set_member_host)(void *const context, const char &value,
78  size_t length);
79  void (*set_member_port)(void *const context, unsigned int value);
80  void (*set_member_state)(void *const context, const char &value,
81  size_t length);
82  void (*set_member_role)(void *const context, const char &value,
83  size_t length);
84  void (*set_member_version)(void *const context, const char &value,
85  size_t length);
86 };
87 
88 /*
89  Callbacks for get_group_member_stats_info function.
90 
91  context field can have NULL value, plugin will always pass it
92  through all callbacks, independent of its value.
93  Its value will not be used by plugin.
94 
95  All callbacks are mandatory.
96 */
98  void *const context;
99  void (*set_channel_name)(void *const context, const char &value,
100  size_t length);
101  void (*set_view_id)(void *const context, const char &value, size_t length);
102  void (*set_member_id)(void *const context, const char &value, size_t length);
103  void (*set_transactions_committed)(void *const context, const char &value,
104  size_t length);
106  const char &value, size_t length);
107  void (*set_transactions_in_queue)(void *const context,
108  unsigned long long int value);
109  void (*set_transactions_certified)(void *const context,
110  unsigned long long int value);
112  unsigned long long int value);
114  unsigned long long int value);
116  unsigned long long int value);
118  unsigned long long int value);
120  unsigned long long int value);
122  unsigned long long int value);
123 };
124 
127 
128  /*
129  This function is used to start the group replication.
130  */
131  int (*start)(char **error_message);
132  /*
133  This function is used to stop the group replication.
134  */
135  int (*stop)(char **error_message);
136  /*
137  This function is used to get the current group replication running status.
138  */
140  /*
141  This function is used to get the current group replication status about
142  its internal cloning process for data provisioning.
143  */
144  bool (*is_cloning)();
145  /*
146  This function initializes conflict checking module with info received
147  from group on this member.
148 
149  @param info View_change_log_event with conflict checking info.
150  */
151  int (*set_retrieved_certification_info)(void *info);
152 
153  /*
154  This function is used to fetch information for group replication kernel
155  stats.
156 
157  @param callbacks The set of callbacks and its context used to set the
158  information on caller.
159 
160  @note The caller is responsible to free memory from the info structure and
161  from all its fields.
162  */
163  bool (*get_connection_status_info)(
165 
166  /*
167  This function is used to fetch information for group replication members.
168 
169  @param index Row index for which information needs to be fetched
170 
171  @param callbacks The set of callbacks and its context used to set the
172  information on caller.
173 
174  @note The caller is responsible to free memory from the info structure and
175  from all its fields.
176  */
178  unsigned int index,
180 
181  /*
182  This function is used to fetch information for group replication members
183  statistics.
184 
185  @param index Row index for which information needs to be fetched
186 
187  @param callbacks The set of callbacks and its context used to set the
188  information on caller.
189 
190  @note The caller is responsible to free memory from the info structure and
191  from all its fields.
192  */
193  bool (*get_group_member_stats_info)(
194  unsigned int index,
196 
197  /*
198  Get number of group replication members.
199  */
200  unsigned int (*get_members_number_info)();
201 };
202 
203 #endif
static void set_member_host(void *const context, const char &value, size_t length)
Definition: table_replication_group_members.cc:72
static void set_member_role(void *const context, const char &value, size_t length)
Definition: table_replication_group_members.cc:111
static void set_transactions_in_queue(void *const context, unsigned long long int value)
Definition: table_replication_group_member_stats.cc:107
Definition: plugin_group_replication.h:41
#define bool
Definition: config_static.h:42
static void set_transactions_remote_applier_queue(void *const context, unsigned long long int value)
Definition: table_replication_group_member_stats.cc:135
static void set_transactions_rows_in_validation(void *const context, unsigned long long int value)
Definition: table_replication_group_member_stats.cc:128
void *const context
Definition: plugin_group_replication.h:73
Definition: plugin_group_replication.h:53
static void set_member_version(void *const context, const char &value, size_t length)
Definition: table_replication_group_members.cc:100
Definition: plugin_group_replication.h:39
static void set_transactions_certified(void *const context, unsigned long long int value)
Definition: table_replication_group_member_stats.cc:114
void *const context
Definition: plugin_group_replication.h:98
int interface_version
Definition: plugin_group_replication.h:126
static void set_transactions_remote_applied(void *const context, unsigned long long int value)
Definition: table_replication_group_member_stats.cc:142
Definition: plugin_group_replication.h:125
Definition: plugin_group_replication.h:36
enum_group_replication_consistency_level
Definition: plugin_group_replication.h:34
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:161
static void set_transactions_conflicts_detected(void *const context, unsigned long long int value)
Definition: table_replication_group_member_stats.cc:121
Definition: plugin_group_replication.h:38
void(* set_channel_name)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:55
Definition: plugin_group_replication.h:72
static void set_transactions_committed(void *const context, const char &value, size_t length)
Definition: table_replication_group_member_stats.cc:81
Definition: plugin_group_replication.h:40
static void set_member_id(void *const context, const char &value, size_t length)
Definition: table_replication_group_member_stats.cc:70
bool get_group_members_info(uint index, const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS &callbacks, Group_member_info_manager_interface *group_member_manager, char *channel_name)
Definition: ps_information.cc:31
Definition: plugin_group_replication.h:97
void(* set_group_name)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:57
static void set_transactions_local_proposed(void *const context, unsigned long long int value)
Definition: table_replication_group_member_stats.cc:149
static void set_member_state(void *const context, const char &value, size_t length)
Definition: table_replication_group_members.cc:89
bool is_running(const PluginFuncEnv *env) noexcept
Definition: loader.cc:370
static void stop(mysql_harness::PluginFuncEnv *)
Definition: rest_mock_server.cc:276
void(* set_source_uuid)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:58
void(* set_service_state)(void *const context, bool state)
Definition: plugin_group_replication.h:60
const string value("\alue\)
Log info(cout, "NOTE")
static void set_view_id(void *const context, const char &value, size_t length)
Definition: table_replication_group_member_stats.cc:60
static void set_transactions_local_rollback(void *const context, unsigned long long int value)
Definition: table_replication_group_member_stats.cc:156
static const sasl_callback_t callbacks[]
Definition: auth_ldap_sasl_client.h:44
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
void *const context
Definition: plugin_group_replication.h:54
static void set_member_port(void *const context, unsigned int value)
Definition: table_replication_group_members.cc:83
static void set_last_conflict_free_transaction(void *const context, const char &value, size_t length)
Definition: table_replication_group_member_stats.cc:95