MySQL 8.3.0
Source Code Documentation
plugin_group_replication.h
Go to the documentation of this file.
1/* Copyright (c) 2013, 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 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);
87 const char &value,
88 size_t length);
89};
90
91/*
92 Callbacks for get_group_member_stats_info function.
93
94 context field can have NULL value, plugin will always pass it
95 through all callbacks, independent of its value.
96 Its value will not be used by plugin.
97
98 All callbacks are mandatory.
99*/
101 void *const context;
102 void (*set_channel_name)(void *const context, const char &value,
103 size_t length);
104 void (*set_view_id)(void *const context, const char &value, size_t length);
105 void (*set_member_id)(void *const context, const char &value, size_t length);
106 void (*set_transactions_committed)(void *const context, const char &value,
107 size_t length);
109 const char &value, size_t length);
111 unsigned long long int value);
113 unsigned long long int value);
115 unsigned long long int value);
117 unsigned long long int value);
119 unsigned long long int value);
121 unsigned long long int value);
123 unsigned long long int value);
125 unsigned long long int value);
126};
127
130
131 /*
132 This function is used to start the group replication.
133 */
134 int (*start)(char **error_message);
135 /*
136 This function is used to stop the group replication.
137 */
138 int (*stop)(char **error_message);
139 /*
140 This function is used to get the current group replication running status.
141 */
142 bool (*is_running)();
143 /*
144 This function is used to get the current group replication status about
145 its internal cloning process for data provisioning.
146 */
147 bool (*is_cloning)();
148 /*
149 This function initializes conflict checking module with info received
150 from group on this member.
151
152 @param info View_change_log_event with conflict checking info.
153 */
155
156 /*
157 This function is used to fetch information for group replication kernel
158 stats.
159
160 @param callbacks The set of callbacks and its context used to set the
161 information on caller.
162
163 @note The caller is responsible to free memory from the info structure and
164 from all its fields.
165 */
168
169 /*
170 This function is used to fetch information for group replication members.
171
172 @param index Row index for which information needs to be fetched
173
174 @param callbacks The set of callbacks and its context used to set the
175 information on caller.
176
177 @note The caller is responsible to free memory from the info structure and
178 from all its fields.
179 */
181 unsigned int index,
183
184 /*
185 This function is used to fetch information for group replication members
186 statistics.
187
188 @param index Row index for which information needs to be fetched
189
190 @param callbacks The set of callbacks and its context used to set the
191 information on caller.
192
193 @note The caller is responsible to free memory from the info structure and
194 from all its fields.
195 */
197 unsigned int index,
199
200 /*
201 Get number of group replication members.
202 */
203 unsigned int (*get_members_number_info)();
204};
205
206#endif
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
enum_group_replication_consistency_level
Definition: plugin_group_replication.h:34
@ GROUP_REPLICATION_CONSISTENCY_AFTER
Definition: plugin_group_replication.h:40
@ GROUP_REPLICATION_CONSISTENCY_BEFORE
Definition: plugin_group_replication.h:39
@ GROUP_REPLICATION_CONSISTENCY_EVENTUAL
Definition: plugin_group_replication.h:36
@ GROUP_REPLICATION_CONSISTENCY_BEFORE_ON_PRIMARY_FAILOVER
Definition: plugin_group_replication.h:38
@ GROUP_REPLICATION_CONSISTENCY_BEFORE_AND_AFTER
Definition: plugin_group_replication.h:41
Definition: plugin_group_replication.h:53
void(* set_channel_name)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:55
void(* set_source_uuid)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:58
void(* set_group_name)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:57
void(* set_service_state)(void *const context, bool state)
Definition: plugin_group_replication.h:60
void *const context
Definition: plugin_group_replication.h:54
Definition: plugin_group_replication.h:72
void(* set_member_id)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:76
void(* set_member_role)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:82
void *const context
Definition: plugin_group_replication.h:73
void(* set_member_incoming_communication_protocol)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:86
void(* set_channel_name)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:74
void(* set_member_host)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:77
void(* set_member_port)(void *const context, unsigned int value)
Definition: plugin_group_replication.h:79
void(* set_member_version)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:84
void(* set_member_state)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:80
Definition: plugin_group_replication.h:100
void(* set_member_id)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:105
void(* set_transactions_remote_applier_queue)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:118
void(* set_channel_name)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:102
void *const context
Definition: plugin_group_replication.h:101
void(* set_transactions_certified)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:112
void(* set_transactions_rows_in_validation)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:116
void(* set_transactions_committed)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:106
void(* set_transactions_local_proposed)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:122
void(* set_transactions_local_rollback)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:124
void(* set_transactions_in_queue)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:110
void(* set_last_conflict_free_transaction)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:108
void(* set_transactions_conflicts_detected)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:114
void(* set_view_id)(void *const context, const char &value, size_t length)
Definition: plugin_group_replication.h:104
void(* set_transactions_remote_applied)(void *const context, unsigned long long int value)
Definition: plugin_group_replication.h:120
Definition: plugin_group_replication.h:128
bool(* get_connection_status_info)(const GROUP_REPLICATION_CONNECTION_STATUS_CALLBACKS &callbacks)
Definition: plugin_group_replication.h:166
int interface_version
Definition: plugin_group_replication.h:129
bool(* is_cloning)()
Definition: plugin_group_replication.h:147
bool(* get_group_member_stats_info)(unsigned int index, const GROUP_REPLICATION_GROUP_MEMBER_STATS_CALLBACKS &callbacks)
Definition: plugin_group_replication.h:196
int(* start)(char **error_message)
Definition: plugin_group_replication.h:134
bool(* get_group_members_info)(unsigned int index, const GROUP_REPLICATION_GROUP_MEMBERS_CALLBACKS &callbacks)
Definition: plugin_group_replication.h:180
int(* stop)(char **error_message)
Definition: plugin_group_replication.h:138
bool(* is_running)()
Definition: plugin_group_replication.h:142
int(* set_retrieved_certification_info)(void *info)
Definition: plugin_group_replication.h:154
unsigned int(* get_members_number_info)()
Definition: plugin_group_replication.h:203