MySQL 8.4.2
Source Code Documentation
pipeline_handlers.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 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 PIPELINE_HANDLERS_INCLUDED
25#define PIPELINE_HANDLERS_INCLUDED
26
27#include <assert.h>
29
34
35/*
36 @enum Event modifier
37 Enumeration type for the different kinds of pipeline event modifiers.
38*/
40 TRANSACTION_BEGIN = 1, ///< transaction start event
41 TRANSACTION_END = 2, ///< transaction end event
42 UNMARKED_EVENT = 3, ///< transaction regular event
43 SINGLE_VIEW_EVENT = 4, ///< the current Pipeline_event only contains
44 ///< a single view event injected from GCS
45};
46
47/**
48 @enum enum_handler_role
49 Enumeration type for the different roles of the used handlers.
50*/
55 QUEUER = 3,
56 ROLE_NUMBER = 4 // The number of roles
57};
58
59/**
60 @enum enum_group_replication_handler_actions
61
62 Enumeration of all actions sent to the plugin handlers.
63*/
65 HANDLER_START_ACTION = 0, // Action that signals the handlers to start
66 HANDLER_STOP_ACTION = 1, // Action that signals the handlers to stop
67 HANDLER_APPLIER_CONF_ACTION = 2, // Configuration for applier handlers
68 HANDLER_CERT_CONF_ACTION = 3, // Configuration for certification handlers
69 HANDLER_CERT_INFO_ACTION = 4, // Certification info for the certifier
70 HANDLER_VIEW_CHANGE_ACTION = 5, // Certification notification on view change
71 HANDLER_GCS_INTERFACE_ACTION = 6, // Action with GCS interfaces to be used.
72 HANDLER_THD_ACTION = 7, // Configuration action that carries a THD obj
73 HANDLER_ACTION_NUMBER = 8 // The number of roles
75
76/**
77 @class Handler_start_action
78
79 Action to signal the handler to start existing routines
80*/
82 public:
84
85 ~Handler_start_action() override = default;
86};
87
88/**
89 @class Handler_stop_action
90
91 Action to signal the handler to stop existing routines
92*/
94 public:
96
97 ~Handler_stop_action() override = default;
98};
99
100/**
101 @class Handler_applier_configuration_action
102
103 Action to configure existing applier handlers
104*/
106 public:
107 /**
108 Configuration for applier handlers
109
110 @param applier_name the applier's channel name
111 @param reset_logs if a reset was executed in the server
112 @param plugin_shutdown_timeout the plugin's timeout for component shutdown
113 @param group_sidno the group configured sidno
114 */
116 ulong plugin_shutdown_timeout,
121 applier_shutdown_timeout(plugin_shutdown_timeout),
123 initialization_conf(true) {
124 assert(applier_name != nullptr);
125 }
126
127 /**
128 Configuration for applier handlers
129
130 @param plugin_shutdown_timeout the plugin's timeout for component shutdown
131 */
132 Handler_applier_configuration_action(ulong plugin_shutdown_timeout)
135 reset_logs(false),
136 applier_shutdown_timeout(plugin_shutdown_timeout),
137 group_sidno(0),
138 initialization_conf(false) {}
139
141
142 /**
143 @return the applier's name
144 @retval NULL if not defined
145 @retval !=NULL if defined
146 */
147 char *get_applier_name() { return applier_name; }
148
150
152
154
155 /**
156 Informs if this is a action with configurations for initialization or just
157 timeout configurations.
158
159 @retval true if initialization action
160 @retval false if timeout configuration action
161 */
163
164 private:
165 /*The applier's name, used for channel naming*/
167 /*If a reset was executed in the server */
169 /*The plugin's timeout for component shutdown set in the applier*/
171 /*The configured group sidno*/
173
174 // Internal fields
175
176 /*If this is a initialization packet or not*/
178};
179
180/**
181 @class Handler_certifier_configuration_action
182
183 Action to configure existing certification handlers
184*/
186 public:
187 /**
188 Configuration for certification handlers
189
190 @param group_sidno the group sidno
191 @param gtid_assignment_block_size the group gtid assignment block size
192 */
198
200
203 }
204
205 private:
208};
209
210/**
211 @class Handler_certifier_information_action
212
213 Action that carries a certification info to be
214 applied on certification handlers.
215*/
217 public:
218 /**
219 Create an action to communicate certification info to a certifier
220
221 @param cert_info A certification info
222 */
224 std::map<std::string, std::string> *cert_info)
226 certification_info(cert_info) {}
227
228 std::map<std::string, std::string> *get_certification_info() {
229 return certification_info;
230 }
231
232 private:
233 std::map<std::string, std::string> *certification_info;
234};
235
236/**
237 @class View_change_pipeline_action
238
239 Action to signal any interested handler that a VC happened
240*/
242 public:
243 /**
244 Creates an action to inform handler of a View Change
245
246 @param is_leaving informs if the member is leaving
247 */
250
251 bool is_leaving() { return leaving; }
252
253 private:
254 /*If this member is leaving the group on this view change*/
256};
257
258/**
259 @class Handler_THD_setup_action
260
261 Action that gives handlers access to the a THD object.
262 This THD would usually belong to the caller avoiding the current_thd macro
263*/
265 public:
266 /**
267 An action that a THD object
268
269 @param given_thread a pointer to a THD object
270 */
273
275
276 private:
278};
279
280#endif /* PIPELINE_HANDLERS_INCLUDED */
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Action that gives handlers access to the a THD object.
Definition: pipeline_handlers.h:264
THD * get_THD_object()
Definition: pipeline_handlers.h:274
THD * shared_thd_object
Definition: pipeline_handlers.h:277
Handler_THD_setup_action(THD *given_thread)
An action that a THD object.
Definition: pipeline_handlers.h:271
Action to configure existing applier handlers.
Definition: pipeline_handlers.h:105
ulong get_applier_shutdown_timeout()
Definition: pipeline_handlers.h:149
char * get_applier_name()
Definition: pipeline_handlers.h:147
Handler_applier_configuration_action(char *applier_name, bool reset_logs, ulong plugin_shutdown_timeout, rpl_sidno group_sidno)
Configuration for applier handlers.
Definition: pipeline_handlers.h:115
bool initialization_conf
Definition: pipeline_handlers.h:177
bool is_initialization_conf()
Informs if this is a action with configurations for initialization or just timeout configurations.
Definition: pipeline_handlers.h:162
ulong applier_shutdown_timeout
Definition: pipeline_handlers.h:170
rpl_sidno group_sidno
Definition: pipeline_handlers.h:172
bool reset_logs
Definition: pipeline_handlers.h:168
bool is_reset_logs_planned()
Definition: pipeline_handlers.h:151
char * applier_name
Definition: pipeline_handlers.h:166
~Handler_applier_configuration_action() override=default
rpl_sidno get_sidno()
Definition: pipeline_handlers.h:153
Handler_applier_configuration_action(ulong plugin_shutdown_timeout)
Configuration for applier handlers.
Definition: pipeline_handlers.h:132
Action to configure existing certification handlers.
Definition: pipeline_handlers.h:185
ulonglong gtid_assignment_block_size
Definition: pipeline_handlers.h:207
rpl_sidno group_sidno
Definition: pipeline_handlers.h:206
ulonglong get_gtid_assignment_block_size()
Definition: pipeline_handlers.h:201
Handler_certifier_configuration_action(rpl_sidno group_sidno, ulonglong gtid_assignment_block_size)
Configuration for certification handlers.
Definition: pipeline_handlers.h:193
rpl_sidno get_group_sidno()
Definition: pipeline_handlers.h:199
Action that carries a certification info to be applied on certification handlers.
Definition: pipeline_handlers.h:216
std::map< std::string, std::string > * certification_info
Definition: pipeline_handlers.h:233
std::map< std::string, std::string > * get_certification_info()
Definition: pipeline_handlers.h:228
Handler_certifier_information_action(std::map< std::string, std::string > *cert_info)
Create an action to communicate certification info to a certifier.
Definition: pipeline_handlers.h:223
Action to signal the handler to start existing routines.
Definition: pipeline_handlers.h:81
~Handler_start_action() override=default
Handler_start_action()
Definition: pipeline_handlers.h:83
Action to signal the handler to stop existing routines.
Definition: pipeline_handlers.h:93
~Handler_stop_action() override=default
Handler_stop_action()
Definition: pipeline_handlers.h:95
A wrapper for pipeline actions.
Definition: pipeline_interfaces.h:631
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Action to signal any interested handler that a VC happened.
Definition: pipeline_handlers.h:241
View_change_pipeline_action(bool is_leaving)
Creates an action to inform handler of a View Change.
Definition: pipeline_handlers.h:248
bool is_leaving()
Definition: pipeline_handlers.h:251
bool leaving
Definition: pipeline_handlers.h:255
unsigned long long int ulonglong
Definition: my_inttypes.h:56
enum enum_group_replication_handler_actions Plugin_handler_action
enum_event_modifier
Definition: pipeline_handlers.h:39
@ TRANSACTION_END
transaction end event
Definition: pipeline_handlers.h:41
@ TRANSACTION_BEGIN
transaction start event
Definition: pipeline_handlers.h:40
@ UNMARKED_EVENT
transaction regular event
Definition: pipeline_handlers.h:42
@ SINGLE_VIEW_EVENT
the current Pipeline_event only contains a single view event injected from GCS
Definition: pipeline_handlers.h:43
enum_handler_role
Enumeration type for the different roles of the used handlers.
Definition: pipeline_handlers.h:51
@ ROLE_NUMBER
Definition: pipeline_handlers.h:56
@ EVENT_CATALOGER
Definition: pipeline_handlers.h:52
@ QUEUER
Definition: pipeline_handlers.h:55
@ CERTIFIER
Definition: pipeline_handlers.h:54
@ APPLIER
Definition: pipeline_handlers.h:53
enum_group_replication_handler_actions
Enumeration of all actions sent to the plugin handlers.
Definition: pipeline_handlers.h:64
@ HANDLER_CERT_INFO_ACTION
Definition: pipeline_handlers.h:69
@ HANDLER_VIEW_CHANGE_ACTION
Definition: pipeline_handlers.h:70
@ HANDLER_CERT_CONF_ACTION
Definition: pipeline_handlers.h:68
@ HANDLER_STOP_ACTION
Definition: pipeline_handlers.h:66
@ HANDLER_START_ACTION
Definition: pipeline_handlers.h:65
@ HANDLER_APPLIER_CONF_ACTION
Definition: pipeline_handlers.h:67
@ HANDLER_ACTION_NUMBER
Definition: pipeline_handlers.h:73
@ HANDLER_GCS_INTERFACE_ACTION
Definition: pipeline_handlers.h:71
@ HANDLER_THD_ACTION
Definition: pipeline_handlers.h:72
cs::index::rpl_sidno rpl_sidno
Type of SIDNO (source ID number, first component of GTID)
Definition: rpl_gtid.h:108