MySQL  8.0.17
Source Code Documentation
plugin_group_replication.h
Go to the documentation of this file.
1 /* Copyright (c) 2013, 2019, 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  */
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  */
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  */
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  */
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
Definition: plugin_group_replication.h:41
void(* set_transactions_remote_applier_queue)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:115
unsigned int(* get_members_number_info)()
Definition: plugin_group_replication.h:200
void(* set_transactions_rows_in_validation)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:113
#define bool
Definition: config_static.h:42
void *const context
Definition: plugin_group_replication.h:73
Definition: plugin_group_replication.h:53
void(* set_transactions_conflicts_detected)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:111
Definition: plugin_group_replication.h:39
void(* set_member_id)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:102
void *const context
Definition: plugin_group_replication.h:98
int interface_version
Definition: plugin_group_replication.h:126
void(* set_transactions_in_queue)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:107
void(* set_transactions_certified)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:109
char * index(const char *, int c)
Definition: mysql.cc:2847
Definition: plugin_group_replication.h:125
Definition: plugin_group_replication.h:36
void(* set_member_role)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:82
void(* set_member_state)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:80
enum_group_replication_consistency_level
Definition: plugin_group_replication.h:34
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
int(* start)(char **error_message)
Definition: plugin_group_replication.h:131
bool(* is_running)()
Definition: plugin_group_replication.h:139
Definition: plugin_group_replication.h:72
Definition: plugin_group_replication.h:40
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
int(* stop)(char **error_message)
Definition: plugin_group_replication.h:135
void(* set_last_conflict_free_transaction)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:105
void(* set_channel_name)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:74
bool(* is_cloning)()
Definition: plugin_group_replication.h:144
bool(* get_group_members_info)(unsigned int index, const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS &callbacks)
Definition: plugin_group_replication.h:177
bool(* get_group_member_stats_info)(unsigned int index, const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS &callbacks)
Definition: plugin_group_replication.h:193
void(* set_member_version)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:84
void(* set_source_uuid)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:58
void(* set_member_port)(void *const context, unsigned int value)
Definition: plugin_group_replication.h:79
void(* set_transactions_remote_applied)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:117
void(* set_transactions_local_rollback)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:121
void(* set_transactions_local_proposed)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:119
void(* set_view_id)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:101
int(* set_retrieved_certification_info)(void *info)
Definition: plugin_group_replication.h:151
void(* set_service_state)(void *const context, bool state)
Definition: plugin_group_replication.h:60
void(* set_member_id)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:76
const string value("\alue\)
void(* set_channel_name)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:99
Log info(cout, "NOTE")
static const sasl_callback_t callbacks[]
Definition: auth_ldap_sasl_client.h:40
void(* set_transactions_committed)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:103
bool(* get_connection_status_info)(const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS &callbacks)
Definition: plugin_group_replication.h:163
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
void(* set_member_host)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:77