MySQL 8.0.40
Source Code Documentation
mysql_transaction_delegate_control.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 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_TRANSACTION_DELEGATE_CONTROL_H
25#define MYSQL_TRANSACTION_DELEGATE_CONTROL_H
27
28/**
29 A service to manage transactions execution.
30 The service will stop new incoming transactions to execute.
31
32 @note Some management related queries are allowed.
33
34 @sa @ref mysql_new_transaction_control_imp
35*/
36BEGIN_SERVICE_DEFINITION(mysql_new_transaction_control)
37
38/**
39 Method to stop new incoming transactions allowing some management queries
40 to run. New incoming transactions are rolled back.
41
42 @sa mysql_new_transaction_control_imp
43*/
44DECLARE_METHOD(void, stop, ());
45
46/**
47 Method that allows the transactions which were earlier stopped by
48 stop method.
49
50 @sa mysql_new_transaction_control_imp
51*/
52DECLARE_METHOD(void, allow, ());
53
54END_SERVICE_DEFINITION(mysql_new_transaction_control)
55
56/**
57 A service to manage transactions execution.
58 This service rollbacks the transactions that reach the before_commit state.
59 This service does not impact transactions that are already in the commit
60 stage.
61
62 @sa @ref mysql_before_commit_transaction_control_imp
63*/
64BEGIN_SERVICE_DEFINITION(mysql_before_commit_transaction_control)
65
66/**
67 This method rollback any transaction that reaches the commit stage.
68
69 @sa mysql_before_commit_transaction_control_imp
70*/
71DECLARE_METHOD(void, stop, ());
72
73/**
74 Method re-allows the commit, earlier stopped in stop function.
75
76 @note Flag set in stop function to rollback the transactions in commit is
77 unset.
78
79 @sa mysql_before_commit_transaction_control_imp
80*/
81DECLARE_METHOD(void, allow, ());
82
83END_SERVICE_DEFINITION(mysql_before_commit_transaction_control)
84
85/**
86 This service will gracefully close all the client connections which are
87 running a binloggable transaction that did not reach the commit stage.
88 The term `bingloggable transactions` is used to identify transactions that
89 will be written to the binary log once they do commit.
90 At present when binlog cache is initialized by a transaction, the transaction
91 is marked as `bingloggable`.
92
93 @sa @ref
94 mysql_close_connection_of_binloggable_transaction_not_reached_commit_imp
95*/
97 mysql_close_connection_of_binloggable_transaction_not_reached_commit)
98
99/**
100 Method that gracefully closes all the client connections which are running a
101 binloggable transaction that did not reach the commit stage.
102
103 @note method sets the killed flag with value THD::KILL_CONNECTION in the THD
104 to gracefully KILL the transaction and client connection.
105
106 @sa mysql_close_connection_of_binloggable_transaction_not_reached_commit_imp
107*/
109
111 mysql_close_connection_of_binloggable_transaction_not_reached_commit)
112
113#endif /* MYSQL_TRANSACTION_DELEGATE_CONTROL_H */
stdx::expected< void, std::error_code > close(file_handle_type native_handle)
close file handle.
Definition: file.h:239
#define DECLARE_METHOD(retval, name, args)
Declares a method as a part of the Service definition.
Definition: service.h:103
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86