MySQL 9.1.0
Source Code Documentation
|
Class for creating a new thread that allows to stop the new transactions allowing some management queries to run. More...
#include <group_actions_transaction_controller.h>
Public Member Functions | |
Transaction_monitor_thread (const Transaction_monitor_thread &)=delete | |
Deleted copy constructor. More... | |
Transaction_monitor_thread (const Transaction_monitor_thread &&)=delete | |
Deleted move constructor. More... | |
Transaction_monitor_thread & | operator= (const Transaction_monitor_thread &)=delete |
Deleted assignment operator. More... | |
Transaction_monitor_thread & | operator= (const Transaction_monitor_thread &&)=delete |
Deleted move operator. More... | |
Transaction_monitor_thread (uint32 timeout_arg) | |
Initializes the synchronization primitives of the thread. More... | |
~Transaction_monitor_thread () | |
The destructor for the thread will destroy the mutex and cond_var. More... | |
bool | terminate () |
Terminates the thread. More... | |
int | start () |
Starts the process of monitoring transactions. More... | |
Private Member Functions | |
void | transaction_thread_handle () |
The thread handle, i.e. More... | |
bool | acquire_services () |
This function acquires the below services: mysql_new_transaction_control mysql_before_commit_transaction_control mysql_close_connection_of_binloggable_transaction_not_reached_commit. More... | |
bool | release_services () |
This function releases the services. More... | |
Static Private Member Functions | |
static void * | launch_thread (void *arg) |
The thread callback passed onto mysql_thread_create. More... | |
Private Attributes | |
thread_state | m_transaction_monitor_thd_state |
the state of the thread. More... | |
my_thread_handle | m_handle |
the thread handle. More... | |
mysql_mutex_t | m_run_lock |
the mutex for controlling access to the thread itself. More... | |
mysql_cond_t | m_run_cond |
the cond_var used to signal the thread. More... | |
bool | m_abort |
flag to indicate whether or not the thread is to be aborted. More... | |
int32 | m_transaction_timeout {-1} |
The number of seconds to wait before setting the THD::KILL_CONNECTION flag for the transactions that did not reach commit stage. More... | |
std::chrono::time_point< std::chrono::steady_clock > | m_time_start_of_operation |
Stores operation start time. More... | |
mysql_service_mysql_new_transaction_control_t * | m_mysql_new_transaction_control {nullptr} |
Pointer to the mysql_new_transaction_control_imp service. More... | |
mysql_service_mysql_before_commit_transaction_control_t * | m_mysql_before_commit_transaction_control {nullptr} |
Pointer to the mysql_before_commit_transaction_control service. More... | |
mysql_service_mysql_close_connection_of_binloggable_transaction_not_reached_commit_t * | m_mysql_close_connection_of_binloggable_transaction_not_reached_commit |
Pointer to the mysql_close_connection_of_binloggable_transaction_not_reached_commit service. More... | |
Class for creating a new thread that allows to stop the new transactions allowing some management queries to run.
This thread also gracefully disconnects the client which are running the binloggable transaction after specified time.
|
delete |
Deleted copy constructor.
|
delete |
Deleted move constructor.
Transaction_monitor_thread::Transaction_monitor_thread | ( | uint32 | timeout_arg | ) |
Initializes the synchronization primitives of the thread.
Transaction_monitor_thread::~Transaction_monitor_thread | ( | ) |
The destructor for the thread will destroy the mutex and cond_var.
|
private |
This function acquires the below services: mysql_new_transaction_control mysql_before_commit_transaction_control mysql_close_connection_of_binloggable_transaction_not_reached_commit.
|
staticprivate |
The thread callback passed onto mysql_thread_create.
[in] | arg | a pointer to an Transaction_monitor_thread instance. |
|
delete |
Deleted move operator.
|
delete |
Deleted assignment operator.
|
private |
This function releases the services.
int Transaction_monitor_thread::start | ( | ) |
Starts the process of monitoring transactions.
0 | the thread launched successfully |
!= | 0 the thread couldn't be launched |
bool Transaction_monitor_thread::terminate | ( | ) |
Terminates the thread.
Thread sets the abort flag and affectively waits for the operations to terminate.
true | failed to terminate |
false | thread terminated successfully. |
|
private |
The thread handle, i.e.
setups and tearsdown the infrastructure for this mysql_thread.
If time has elapsed disconnect the client connections running the transaction which have yet not reached commit. Else wait for 1 second periods for the primary change to happen until the specified timeout elapses.
|
private |
flag to indicate whether or not the thread is to be aborted.
|
private |
the thread handle.
|
private |
Pointer to the mysql_before_commit_transaction_control
service.
|
private |
Pointer to the mysql_close_connection_of_binloggable_transaction_not_reached_commit
service.
|
private |
Pointer to the mysql_new_transaction_control_imp
service.
|
private |
the cond_var used to signal the thread.
|
private |
the mutex for controlling access to the thread itself.
|
private |
Stores operation start time.
|
private |
the state of the thread.
|
private |
The number of seconds to wait before setting the THD::KILL_CONNECTION flag for the transactions that did not reach commit stage.