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