MySQL  8.0.22
Source Code Documentation
ReplSemiSyncMaster Class Reference

The extension class for the master of semi-synchronous replication. More...

#include <semisync_master.h>

Inheritance diagram for ReplSemiSyncMaster:
ReplSemiSyncBase Trace

Public Member Functions

 ReplSemiSyncMaster ()
 
 ~ReplSemiSyncMaster ()
 
bool getMasterEnabled ()
 
void setTraceLevel (unsigned long trace_level)
 
void set_wait_no_slave (const void *val)
 
void setWaitTimeout (unsigned long wait_timeout)
 
int initObject ()
 
int enableMaster ()
 
int disableMaster ()
 
void add_slave ()
 
void remove_slave ()
 
bool is_semi_sync_slave ()
 
int reportReplyPacket (uint32 server_id, const uchar *packet, ulong packet_len)
 
void reportReplyBinlog (const char *log_file_name, my_off_t end_offset)
 
int commitTrx (const char *trx_wait_binlog_name, my_off_t trx_wait_binlog_pos)
 
int reserveSyncHeader (unsigned char *header, unsigned long size)
 
int updateSyncHeader (unsigned char *packet, const char *log_file_name, my_off_t log_file_pos, uint32 server_id)
 
int writeTranxInBinlog (const char *log_file_name, my_off_t log_file_pos)
 
int readSlaveReply (NET *net, const char *event_buf)
 
int skipSlaveReply (const char *event_buf, uint32 server_id, const char *log_file_name, my_off_t log_file_pos)
 
void setExportStats ()
 
int resetMaster ()
 
int setWaitSlaveCount (unsigned int new_value)
 
void handleAck (int server_id, const char *log_file_name, my_off_t log_file_pos)
 
- Public Member Functions inherited from Trace
void function_enter (const char *func_name)
 
int function_exit (const char *func_name, int exit_code)
 
bool function_exit (const char *func_name, bool exit_code)
 
void function_exit (const char *func_name)
 
 Trace ()
 
 Trace (unsigned long trace_level)
 

Private Member Functions

void lock ()
 
void unlock ()
 
bool is_on ()
 
void set_master_enabled (bool enabled)
 
int switch_off ()
 
void force_switch_on ()
 
int try_switch_on (const char *log_file_name, my_off_t log_file_pos)
 

Private Attributes

ActiveTranxactive_tranxs_ = nullptr
 
bool init_done_ = false
 
mysql_mutex_t LOCK_binlog_
 
bool reply_file_name_inited_ = false
 
char reply_file_name_ [FN_REFLEN]
 
my_off_t reply_file_pos_ = 0
 
bool wait_file_name_inited_ = false
 
char wait_file_name_ [FN_REFLEN]
 
my_off_t wait_file_pos_ = 0
 
bool commit_file_name_inited_ = false
 
char commit_file_name_ [FN_REFLEN]
 
my_off_t commit_file_pos_ = 0
 
volatile bool master_enabled_
 
unsigned long wait_timeout_ = 0
 
bool state_ = false
 
AckContainer ack_container_
 

Additional Inherited Members

- Public Attributes inherited from Trace
unsigned long trace_level_
 
- Static Public Attributes inherited from ReplSemiSyncBase
static const unsigned char kSyncHeader [2]
 
static const unsigned char kPacketMagicNum = 0xef
 
static const unsigned char kPacketFlagSync = 0x01
 
- Static Public Attributes inherited from Trace
static const unsigned long kTraceFunction = 0x0040
 
static const unsigned long kTraceGeneral = 0x0001
 
static const unsigned long kTraceDetail = 0x0010
 
static const unsigned long kTraceNetWait = 0x0020
 

Detailed Description

The extension class for the master of semi-synchronous replication.

Constructor & Destructor Documentation

◆ ReplSemiSyncMaster()

ReplSemiSyncMaster::ReplSemiSyncMaster ( )

◆ ~ReplSemiSyncMaster()

ReplSemiSyncMaster::~ReplSemiSyncMaster ( )

Member Function Documentation

◆ add_slave()

void ReplSemiSyncMaster::add_slave ( )

◆ commitTrx()

int ReplSemiSyncMaster::commitTrx ( const char *  trx_wait_binlog_name,
my_off_t  trx_wait_binlog_pos 
)

◆ disableMaster()

int ReplSemiSyncMaster::disableMaster ( )

◆ enableMaster()

int ReplSemiSyncMaster::enableMaster ( )

◆ force_switch_on()

void ReplSemiSyncMaster::force_switch_on ( )
private

◆ getMasterEnabled()

bool ReplSemiSyncMaster::getMasterEnabled ( )
inline

◆ handleAck()

void ReplSemiSyncMaster::handleAck ( int  server_id,
const char *  log_file_name,
my_off_t  log_file_pos 
)
inline

◆ initObject()

int ReplSemiSyncMaster::initObject ( )

◆ is_on()

bool ReplSemiSyncMaster::is_on ( )
inlineprivate

◆ is_semi_sync_slave()

bool ReplSemiSyncMaster::is_semi_sync_slave ( )

◆ lock()

void ReplSemiSyncMaster::lock ( )
private

◆ readSlaveReply()

int ReplSemiSyncMaster::readSlaveReply ( NET net,
const char *  event_buf 
)

◆ remove_slave()

void ReplSemiSyncMaster::remove_slave ( )

◆ reportReplyBinlog()

void ReplSemiSyncMaster::reportReplyBinlog ( const char *  log_file_name,
my_off_t  end_offset 
)

◆ reportReplyPacket()

int ReplSemiSyncMaster::reportReplyPacket ( uint32  server_id,
const uchar packet,
ulong  packet_len 
)

◆ reserveSyncHeader()

int ReplSemiSyncMaster::reserveSyncHeader ( unsigned char *  header,
unsigned long  size 
)

◆ resetMaster()

int ReplSemiSyncMaster::resetMaster ( )

◆ set_master_enabled()

void ReplSemiSyncMaster::set_master_enabled ( bool  enabled)
inlineprivate

◆ set_wait_no_slave()

void ReplSemiSyncMaster::set_wait_no_slave ( const void *  val)

◆ setExportStats()

void ReplSemiSyncMaster::setExportStats ( )

◆ setTraceLevel()

void ReplSemiSyncMaster::setTraceLevel ( unsigned long  trace_level)
inline

◆ setWaitSlaveCount()

int ReplSemiSyncMaster::setWaitSlaveCount ( unsigned int  new_value)

◆ setWaitTimeout()

void ReplSemiSyncMaster::setWaitTimeout ( unsigned long  wait_timeout)
inline

◆ skipSlaveReply()

int ReplSemiSyncMaster::skipSlaveReply ( const char *  event_buf,
uint32  server_id,
const char *  log_file_name,
my_off_t  log_file_pos 
)

◆ switch_off()

int ReplSemiSyncMaster::switch_off ( )
private

◆ try_switch_on()

int ReplSemiSyncMaster::try_switch_on ( const char *  log_file_name,
my_off_t  log_file_pos 
)
private

◆ unlock()

void ReplSemiSyncMaster::unlock ( )
private

◆ updateSyncHeader()

int ReplSemiSyncMaster::updateSyncHeader ( unsigned char *  packet,
const char *  log_file_name,
my_off_t  log_file_pos,
uint32  server_id 
)

◆ writeTranxInBinlog()

int ReplSemiSyncMaster::writeTranxInBinlog ( const char *  log_file_name,
my_off_t  log_file_pos 
)

Member Data Documentation

◆ ack_container_

AckContainer ReplSemiSyncMaster::ack_container_
private

◆ active_tranxs_

ActiveTranx* ReplSemiSyncMaster::active_tranxs_ = nullptr
private

◆ commit_file_name_

char ReplSemiSyncMaster::commit_file_name_[FN_REFLEN]
private

◆ commit_file_name_inited_

bool ReplSemiSyncMaster::commit_file_name_inited_ = false
private

◆ commit_file_pos_

my_off_t ReplSemiSyncMaster::commit_file_pos_ = 0
private

◆ init_done_

bool ReplSemiSyncMaster::init_done_ = false
private

◆ LOCK_binlog_

mysql_mutex_t ReplSemiSyncMaster::LOCK_binlog_
private

◆ master_enabled_

volatile bool ReplSemiSyncMaster::master_enabled_
private
Initial value:
=
false

◆ reply_file_name_

char ReplSemiSyncMaster::reply_file_name_[FN_REFLEN]
private

◆ reply_file_name_inited_

bool ReplSemiSyncMaster::reply_file_name_inited_ = false
private

◆ reply_file_pos_

my_off_t ReplSemiSyncMaster::reply_file_pos_ = 0
private

◆ state_

bool ReplSemiSyncMaster::state_ = false
private

◆ wait_file_name_

char ReplSemiSyncMaster::wait_file_name_[FN_REFLEN]
private

◆ wait_file_name_inited_

bool ReplSemiSyncMaster::wait_file_name_inited_ = false
private

◆ wait_file_pos_

my_off_t ReplSemiSyncMaster::wait_file_pos_ = 0
private

◆ wait_timeout_

unsigned long ReplSemiSyncMaster::wait_timeout_ = 0
private

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