MySQL 9.1.0
Source Code Documentation
Certifier_broadcast_thread Class Reference

This class is a core component of the database state machine replication protocol. More...

#include <certifier.h>

Public Member Functions

 Certifier_broadcast_thread ()
 Certifier_broadcast_thread constructor. More...
 
virtual ~Certifier_broadcast_thread ()
 
int initialize ()
 Initialize broadcast thread. More...
 
int terminate ()
 Terminate broadcast thread. More...
 
void dispatcher ()
 Broadcast thread worker method. More...
 

Static Public Attributes

static const int BROADCAST_GTID_EXECUTED_PERIOD = 60
 Period (in seconds) between stable transactions set broadcast. More...
 

Private Member Functions

int broadcast_gtid_executed ()
 Broadcast local GTID_EXECUTED to group. More...
 

Private Attributes

bool aborted
 Thread control. More...
 
THDbroadcast_thd
 
my_thread_handle broadcast_pthd
 
mysql_mutex_t broadcast_run_lock
 
mysql_cond_t broadcast_run_cond
 
mysql_mutex_t broadcast_dispatcher_lock
 
mysql_cond_t broadcast_dispatcher_cond
 
thread_state broadcast_thd_state
 
size_t broadcast_counter
 
int broadcast_gtid_executed_period
 

Detailed Description

This class is a core component of the database state machine replication protocol.

It implements conflict detection based on a certification procedure.

Snapshot Isolation is based on assigning logical timestamp to optimistic transactions, i.e. the ones which successfully meet certification and are good to commit on all members in the group. This timestamp is a monotonically increasing counter, and is same across all members in the group.

This timestamp, which in our algorithm is the snapshot version, is further used to update the certification info. The snapshot version maps the items in a transaction to the GTID_EXECUTED that this transaction saw when it was executed, that is, on which version the transaction was executed.

If the incoming transaction snapshot version is a subset of a previous certified transaction for the same write set, the current transaction was executed on top of outdated data, so it will be negatively certified. Otherwise, this transaction is marked certified and goes into applier.

Constructor & Destructor Documentation

◆ Certifier_broadcast_thread()

Certifier_broadcast_thread::Certifier_broadcast_thread ( )

Certifier_broadcast_thread constructor.

◆ ~Certifier_broadcast_thread()

Certifier_broadcast_thread::~Certifier_broadcast_thread ( )
virtual

Member Function Documentation

◆ broadcast_gtid_executed()

int Certifier_broadcast_thread::broadcast_gtid_executed ( )
private

Broadcast local GTID_EXECUTED to group.

Returns
the operation status
Return values
0OK
!=0Error

◆ dispatcher()

void Certifier_broadcast_thread::dispatcher ( )

Broadcast thread worker method.

◆ initialize()

int Certifier_broadcast_thread::initialize ( )

Initialize broadcast thread.

Returns
the operation status
Return values
0OK
!=0Error

◆ terminate()

int Certifier_broadcast_thread::terminate ( )

Terminate broadcast thread.

Returns
the operation status
Return values
0OK
!=0Error

Member Data Documentation

◆ aborted

bool Certifier_broadcast_thread::aborted
private

Thread control.

◆ broadcast_counter

size_t Certifier_broadcast_thread::broadcast_counter
private

◆ broadcast_dispatcher_cond

mysql_cond_t Certifier_broadcast_thread::broadcast_dispatcher_cond
private

◆ broadcast_dispatcher_lock

mysql_mutex_t Certifier_broadcast_thread::broadcast_dispatcher_lock
private

◆ BROADCAST_GTID_EXECUTED_PERIOD

const int Certifier_broadcast_thread::BROADCAST_GTID_EXECUTED_PERIOD = 60
static

Period (in seconds) between stable transactions set broadcast.

◆ broadcast_gtid_executed_period

int Certifier_broadcast_thread::broadcast_gtid_executed_period
private

◆ broadcast_pthd

my_thread_handle Certifier_broadcast_thread::broadcast_pthd
private

◆ broadcast_run_cond

mysql_cond_t Certifier_broadcast_thread::broadcast_run_cond
private

◆ broadcast_run_lock

mysql_mutex_t Certifier_broadcast_thread::broadcast_run_lock
private

◆ broadcast_thd

THD* Certifier_broadcast_thread::broadcast_thd
private

◆ broadcast_thd_state

thread_state Certifier_broadcast_thread::broadcast_thd_state
private

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