MySQL 8.0.39
Source Code Documentation
applier_handler.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 SQL_THREAD_APPLIER_INCLUDE
25#define SQL_THREAD_APPLIER_INCLUDE
26
28
29#include "my_inttypes.h"
32
34 public:
36 int handle_event(Pipeline_event *ev, Continuation *cont) override;
38 int initialize() override;
39 int terminate() override;
40 bool is_unique() override;
41 int get_role() override;
42
43 /**
44 Initializes the SQL thread when receiving a configuration package
45
46 @param reset_logs if a reset was executed in the server
47 @param plugin_shutdown_timeout the plugin's timeout for component shutdown
48
49 @return the operation status
50 @retval 0 OK
51 @retval !=0 Error
52 */
53 int initialize_repositories(bool reset_logs, ulong plugin_shutdown_timeout);
54
55 /**
56 Starts the SQL thread when receiving a action package
57
58 @return the operation status
59 @retval 0 OK
60 @retval !=0 Error
61 */
63
64 /**
65 Stops the SQL thread when receiving a action package
66
67 @return the operation status
68 @retval 0 OK
69 @retval !=0 Error
70 */
72
73 /**
74 Checks if the applier, and its workers when parallel applier is
75 enabled, has already consumed all relay log, that is, applier is
76 waiting for transactions to be queued.
77
78 @return the applier status
79 @retval true the applier is waiting
80 @retval false otherwise
81 */
83
84 /**
85 Checks if all the queued transactions were executed.
86
87 @param timeout the time (seconds) after which the method returns if the
88 above condition was not satisfied
89
90 @return the operation status
91 @retval 0 All transactions were executed
92 @retval -1 A timeout occurred
93 @retval -2 An error occurred
94 */
96
97 /**
98 Checks if all the given transactions were executed.
99
100 @param retrieved_set the set in string format of transaction to wait for
101 @param timeout the time (seconds) after which the method returns if the
102 above condition was not satisfied
103 @param update_THD_status Shall the method update the THD stage
104
105 @return the operation status
106 @retval 0 All transactions were executed
107 @retval -1 A timeout occurred
108 @retval -2 An error occurred
109*/
110 int wait_for_gtid_execution(std::string &retrieved_set, double timeout,
111 bool update_THD_status = true);
112
113 /**
114 Checks if the channel's relay log contains partial transaction.
115
116 @retval true If relaylog contains partial transaction.
117 @retval false If relaylog does not contain partial transaction.
118 */
120
121 private:
123};
124
125#endif /* SQL_THREAD_APPLIER_INCLUDE */
Definition: applier_handler.h:33
bool is_applier_thread_waiting()
Checks if the applier, and its workers when parallel applier is enabled, has already consumed all rel...
Definition: applier_handler.cc:188
int handle_action(Pipeline_action *action) override
Handling of an action as defined in the handler implementation.
Definition: applier_handler.cc:146
int stop_applier_thread()
Stops the SQL thread when receiving a action package.
Definition: applier_handler.cc:95
int terminate() override
Terminate the execution as defined in the handler implementation.
Definition: applier_handler.cc:39
int is_partial_transaction_on_relay_log()
Checks if the channel's relay log contains partial transaction.
Definition: applier_handler.cc:215
int initialize() override
Initialization as defined in the handler implementation.
Definition: applier_handler.cc:34
int handle_event(Pipeline_event *ev, Continuation *cont) override
Handling of an event as defined in the handler implementation.
Definition: applier_handler.cc:110
int start_applier_thread()
Starts the SQL thread when receiving a action package.
Definition: applier_handler.cc:84
Replication_thread_api channel_interface
Definition: applier_handler.h:122
int get_role() override
This method returns the handler role.
Definition: applier_handler.cc:186
int wait_for_gtid_execution(double timeout)
Checks if all the queued transactions were executed.
Definition: applier_handler.cc:196
int initialize_repositories(bool reset_logs, ulong plugin_shutdown_timeout)
Initializes the SQL thread when receiving a configuration package.
Definition: applier_handler.cc:44
bool is_unique() override
This method identifies the handler as being unique.
Definition: applier_handler.cc:184
Class used to wait on the execution of some action.
Definition: pipeline_interfaces.h:462
Interface for the application of events, them being packets or log events.
Definition: pipeline_interfaces.h:587
A wrapper for pipeline actions.
Definition: pipeline_interfaces.h:557
A wrapper for log events/packets.
Definition: pipeline_interfaces.h:128
Definition: replication_threads_api.h:37
Some integer typedefs for easier portability.
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:496
repeated Action action
Definition: replication_group_member_actions.proto:43