MySQL 8.4.0
Source Code Documentation
group_partition_handling.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 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 GROUP_PARTITION_HANDLING_INCLUDE
25#define GROUP_PARTITION_HANDLING_INCLUDE
26
29
31 public:
32 Group_partition_handling(ulong unreachable_timeout);
33
34 /**
35 The class destructor
36 */
38
39 /**
40 The thread handler.
41
42 @retval 0 OK
43 @retval !=0 Error
44 */
46
47 /**
48 Launch the partition thread handler
49
50 @return the operation status
51 @retval 0 OK
52 @retval !=0 Error
53 */
55
56 /**
57 Terminate the partition thread handler
58
59 @return the operation status
60 @retval 0 OK
61 @retval !=0 Error
62 */
64
65 /**
66 Is the member currently/or was on a partition?
67
68 @note this flag is set to true whenever the partition handler is launched
69 and set to false whenever someone tries to abort it.
70
71 @return is member on partition, or was on one
72 @retval true yes
73 @retval false no
74 */
76
77 /**
78 Is the partition handler thread running
79 @return true if running, false otherwise
80 */
82
83 /**
84 Updates the timeout when the member becomes unreachable.
85
86 @param unreachable_timeout The timeout before going into error
87 */
88 void update_timeout_on_unreachable(ulong unreachable_timeout);
89
90 /**
91 @return the configured timeout
92 @retval 0 The partition thread won't run or timeout.
93 @retval >0 After this seconds the plugin will move to ERROR in a minority
94 */
96
97 /**
98 Signals the thread to abort the waiting process.
99
100 @return the operation status
101 @retval true It already killed pending transactions and left the group
102 @retval false The thread was not running, or was aborted in time.
103 */
105
106 /**
107 @return is the process finished
108 @retval true It already killed pending transactions and left the group
109 @retval false The thread was not running, or was aborted.
110 */
112
113 private:
114 // Group_partition_handling variables
115
116 /** Is member in partition */
118
119 /** Group partition thread state */
121
122 /** Should we abort the process that will kill pending transaction */
124
125 /** Did the partition handler terminate and killed pending transactions */
127
128 /** The number of seconds until the member goes into error state*/
130
131 /* Thread related structures */
132
134 // run conditions and locks
139};
140
141#endif /* GROUP_PARTITION_HANDLING_INCLUDE */
Definition: group_partition_handling.h:30
bool is_partition_handler_running()
Is the partition handler thread running.
Definition: group_partition_handling.cc:79
thread_state group_partition_thd_state
Group partition thread state.
Definition: group_partition_handling.h:120
my_thread_handle partition_trx_handler_pthd
Definition: group_partition_handling.h:133
int partition_thread_handler()
The thread handler.
Definition: group_partition_handling.cc:183
ulong get_timeout_on_unreachable()
Definition: group_partition_handling.cc:71
bool partition_handling_aborted
Should we abort the process that will kill pending transaction.
Definition: group_partition_handling.h:123
mysql_cond_t run_cond
Definition: group_partition_handling.h:136
void update_timeout_on_unreachable(ulong unreachable_timeout)
Updates the timeout when the member becomes unreachable.
Definition: group_partition_handling.cc:66
ulong timeout_on_unreachable
The number of seconds until the member goes into error state.
Definition: group_partition_handling.h:129
bool member_in_partition
Is member in partition.
Definition: group_partition_handling.h:117
Group_partition_handling(ulong unreachable_timeout)
Definition: group_partition_handling.cc:43
virtual ~Group_partition_handling()
The class destructor.
Definition: group_partition_handling.cc:59
bool is_member_on_partition()
Is the member currently/or was on a partition?
Definition: group_partition_handling.cc:75
bool abort_partition_handler_if_running()
Signals the thread to abort the waiting process.
Definition: group_partition_handling.cc:87
int terminate_partition_handler_thread()
Terminate the partition thread handler.
Definition: group_partition_handling.cc:136
mysql_mutex_t run_lock
Definition: group_partition_handling.h:135
mysql_cond_t trx_termination_aborted_cond
Definition: group_partition_handling.h:138
bool is_partition_handling_terminated()
Definition: group_partition_handling.cc:83
int launch_partition_handler_thread()
Launch the partition thread handler.
Definition: group_partition_handling.cc:103
mysql_mutex_t trx_termination_aborted_lock
Definition: group_partition_handling.h:137
bool partition_handling_terminated
Did the partition handler terminate and killed pending transactions.
Definition: group_partition_handling.h:126
Definition: my_thread_bits.h:58
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
Definition: plugin_utils.h:48