MySQL  8.0.18
Source Code Documentation
Commit_order_manager Class Reference

#include <rpl_slave_commit_order_manager.h>

Classes

struct  worker_info
 

Public Member Functions

 Commit_order_manager (uint32 worker_numbers)
 
 ~Commit_order_manager ()
 
void register_trx (Slave_worker *worker)
 Register the worker into commit order queue when coordinator dispatches a transaction to the worker. More...
 
bool wait_for_its_turn (Slave_worker *worker, bool all)
 Wait for its turn to commit or unregister. More...
 
void unregister_trx (Slave_worker *worker)
 Unregister the transaction from the commit order queue and signal the next one to go ahead. More...
 
void report_rollback (Slave_worker *worker)
 Wait its turn to rollback and report the rollback. More...
 
void report_commit (Slave_worker *worker)
 Wait its turn to unregister and unregister the transaction. More...
 
void report_deadlock (Slave_worker *worker)
 

Private Types

enum  order_commit_status { OCS_WAIT, OCS_SIGNAL, OCS_FINISH }
 

Private Member Functions

bool queue_empty ()
 
void queue_pop ()
 
void queue_push (uint32 index)
 
uint32 queue_front ()
 
 Commit_order_manager (const Commit_order_manager &)
 
Commit_order_manageroperator= (const Commit_order_manager &)
 

Private Attributes

mysql_mutex_t m_mutex
 
bool m_rollback_trx
 
std::vector< worker_infom_workers
 
uint32 queue_head
 
uint32 queue_tail
 

Static Private Attributes

static const uint32 QUEUE_EOF = 0xFFFFFFFF
 

Member Enumeration Documentation

◆ order_commit_status

Enumerator
OCS_WAIT 
OCS_SIGNAL 
OCS_FINISH 

Constructor & Destructor Documentation

◆ Commit_order_manager() [1/2]

Commit_order_manager::Commit_order_manager ( uint32  worker_numbers)

◆ ~Commit_order_manager()

Commit_order_manager::~Commit_order_manager ( )

◆ Commit_order_manager() [2/2]

Commit_order_manager::Commit_order_manager ( const Commit_order_manager )
private

Member Function Documentation

◆ operator=()

Commit_order_manager& Commit_order_manager::operator= ( const Commit_order_manager )
private

◆ queue_empty()

bool Commit_order_manager::queue_empty ( )
inlineprivate

◆ queue_front()

uint32 Commit_order_manager::queue_front ( )
inlineprivate

◆ queue_pop()

void Commit_order_manager::queue_pop ( )
inlineprivate

◆ queue_push()

void Commit_order_manager::queue_push ( uint32  index)
inlineprivate

◆ register_trx()

void Commit_order_manager::register_trx ( Slave_worker worker)

Register the worker into commit order queue when coordinator dispatches a transaction to the worker.

Parameters
[in]workerThe worker which the transaction will be dispatched to.

◆ report_commit()

void Commit_order_manager::report_commit ( Slave_worker worker)
inline

Wait its turn to unregister and unregister the transaction.

It is called for the cases that trx is already committed, but nothing is binlogged.

Parameters
[in]workerThe worker which is executing the transaction.

◆ report_deadlock()

void Commit_order_manager::report_deadlock ( Slave_worker worker)

◆ report_rollback()

void Commit_order_manager::report_rollback ( Slave_worker worker)

Wait its turn to rollback and report the rollback.

Parameters
[in]workerThe worker which is executing the transaction.

◆ unregister_trx()

void Commit_order_manager::unregister_trx ( Slave_worker worker)

Unregister the transaction from the commit order queue and signal the next one to go ahead.

Parameters
[in]workerThe worker which is executing the transaction.

◆ wait_for_its_turn()

bool Commit_order_manager::wait_for_its_turn ( Slave_worker worker,
bool  all 
)

Wait for its turn to commit or unregister.

Waits until it becomes the queue head.

Parameters
[in]workerThe worker which is executing the transaction.
[in]allIf it is a real transation commit.
Returns
Return values
falseAll previous transactions succeed, so this transaction can go ahead and commit.
trueOne or more previous transactions rollback, so this transaction should rollback.
falseAll previous threads succeeded so this thread can go ahead and commit.

Member Data Documentation

◆ m_mutex

mysql_mutex_t Commit_order_manager::m_mutex
private

◆ m_rollback_trx

bool Commit_order_manager::m_rollback_trx
private

◆ m_workers

std::vector<worker_info> Commit_order_manager::m_workers
private

◆ QUEUE_EOF

const uint32 Commit_order_manager::QUEUE_EOF = 0xFFFFFFFF
staticprivate

◆ queue_head

uint32 Commit_order_manager::queue_head
private

◆ queue_tail

uint32 Commit_order_manager::queue_tail
private

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