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