MySQL 8.4.1
Source Code Documentation
Server_ongoing_transactions_handler Class Reference

#include <server_ongoing_transactions_handler.h>

Inheritance diagram for Server_ongoing_transactions_handler:
[legend]

Public Member Functions

 Server_ongoing_transactions_handler ()
 Initialize the class and get the server service. More...
 
 ~Server_ongoing_transactions_handler () override
 Class destructor. More...
 
bool initialize_server_service (Plugin_stage_monitor_handler *stage_handler)
 Fetch the registry and the service for this class. More...
 
bool get_server_running_transactions (ulong **ids, ulong *size)
 Get the list of running transactions from the server. More...
 
int wait_for_current_transaction_load_execution (bool *abort_flag, my_thread_id id_to_ignore=0)
 Gets running transactions and waits for its end. More...
 
void abort_waiting_process ()
 Abort any running waiting process. More...
 
int before_transaction_begin (my_thread_id thread_id, ulong gr_consistency_level, ulong hold_timeout, enum_rpl_channel_type rpl_channel_type, const THD *thd) override
 Executed before a transaction begins. More...
 
int before_commit (my_thread_id thread_id, Group_transaction_listener::enum_transaction_origin origin) override
 Executed before commit. More...
 
int before_rollback (my_thread_id thread_id, Group_transaction_listener::enum_transaction_origin origin) override
 Executed before rollback. More...
 
int after_rollback (my_thread_id thread_id) override
 Executed after rollback. More...
 
int after_commit (my_thread_id thread_id, rpl_sidno sidno, rpl_gno gno) override
 Executed after commit. More...
 
- Public Member Functions inherited from Group_transaction_listener
virtual ~Group_transaction_listener ()
 Class destructor. More...
 

Private Attributes

std::queue< my_thread_idthread_ids_finished
 The transactions that finished while the service is running. More...
 
mysql_mutex_t query_wait_lock
 The lock for the query wait. More...
 
my_h_service generic_service
 The server service handle. More...
 
Plugin_stage_monitor_handlerstage_handler
 A stage handler for reporting progress. More...
 

Additional Inherited Members

- Public Types inherited from Group_transaction_listener
enum  enum_transaction_origin { GROUP_APPLIER_TRANSACTION = 0 , GROUP_RECOVERY_TRANSACTION = 1 , GROUP_LOCAL_TRANSACTION = 2 }
 Enum for transaction origins. More...
 

Constructor & Destructor Documentation

◆ Server_ongoing_transactions_handler()

Server_ongoing_transactions_handler::Server_ongoing_transactions_handler ( )

Initialize the class and get the server service.

◆ ~Server_ongoing_transactions_handler()

Server_ongoing_transactions_handler::~Server_ongoing_transactions_handler ( )
override

Class destructor.

Member Function Documentation

◆ abort_waiting_process()

void Server_ongoing_transactions_handler::abort_waiting_process ( )

Abort any running waiting process.

◆ after_commit()

int Server_ongoing_transactions_handler::after_commit ( my_thread_id  thread_id,
rpl_sidno  sidno,
rpl_gno  gno 
)
overridevirtual

Executed after commit.

Parameters
thread_idthe transaction thread id
sidnothe transaction sidno
gnothe transaction gno

Implements Group_transaction_listener.

◆ after_rollback()

int Server_ongoing_transactions_handler::after_rollback ( my_thread_id  thread_id)
overridevirtual

Executed after rollback.

Parameters
thread_idthe transaction thread id

Implements Group_transaction_listener.

◆ before_commit()

int Server_ongoing_transactions_handler::before_commit ( my_thread_id  thread_id,
Group_transaction_listener::enum_transaction_origin  origin 
)
overridevirtual

Executed before commit.

Parameters
thread_idthe transaction thread id
originwho applied it

Implements Group_transaction_listener.

◆ before_rollback()

int Server_ongoing_transactions_handler::before_rollback ( my_thread_id  thread_id,
Group_transaction_listener::enum_transaction_origin  origin 
)
overridevirtual

Executed before rollback.

Parameters
thread_idthe transaction thread id
originwho applied it

Implements Group_transaction_listener.

◆ before_transaction_begin()

int Server_ongoing_transactions_handler::before_transaction_begin ( my_thread_id  thread_id,
ulong  gr_consistency_level,
ulong  hold_timeout,
enum_rpl_channel_type  channel_type,
const THD thd 
)
overridevirtual

Executed before a transaction begins.

Parameters
thread_idthe transaction thread id
gr_consistency_levelthe current consistency level for this session
hold_timeoutthe max time to execute an action on this transaction
channel_typetype channel that receives transaction
thdserver thd that represents client session

Implements Group_transaction_listener.

◆ get_server_running_transactions()

bool Server_ongoing_transactions_handler::get_server_running_transactions ( ulong **  ids,
ulong *  size 
)

Get the list of running transactions from the server.

Parameters
[out]idsan array of thread ids
[out]sizethe size of the array returned on ids
Returns
0 in case of success, 1 in case of error

◆ initialize_server_service()

bool Server_ongoing_transactions_handler::initialize_server_service ( Plugin_stage_monitor_handler stage_handler)

Fetch the registry and the service for this class.

Parameters
stage_handlerthe stage handler to report progress
Returns
false in case of success, or true otherwise

◆ wait_for_current_transaction_load_execution()

int Server_ongoing_transactions_handler::wait_for_current_transaction_load_execution ( bool *  abort_flag,
my_thread_id  id_to_ignore = 0 
)

Gets running transactions and waits for its end.

Parameters
abort_flagcancel flag
id_to_ignoreif different from 0, the method does not wait for it
Returns
0 in case of success, 1 in case of error

Member Data Documentation

◆ generic_service

my_h_service Server_ongoing_transactions_handler::generic_service
private

The server service handle.

◆ query_wait_lock

mysql_mutex_t Server_ongoing_transactions_handler::query_wait_lock
private

The lock for the query wait.

◆ stage_handler

Plugin_stage_monitor_handler* Server_ongoing_transactions_handler::stage_handler
private

A stage handler for reporting progress.

◆ thread_ids_finished

std::queue<my_thread_id> Server_ongoing_transactions_handler::thread_ids_finished
private

The transactions that finished while the service is running.


The documentation for this class was generated from the following files: