MySQL 9.5.0
Source Code Documentation
ReplSemiSyncSource Class Reference

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

#include <semisync_source.h>

Inheritance diagram for ReplSemiSyncSource:
[legend]

Public Member Functions

 ReplSemiSyncSource ()
 
 ~ReplSemiSyncSource ()
 
bool getSourceEnabled ()
 
void setTraceLevel (unsigned long trace_level)
 
void set_wait_no_replica (const void *val)
 
void setWaitTimeout (unsigned long wait_timeout)
 
int initObject ()
 
int enableSource ()
 
int disableSource ()
 
void add_replica ()
 
void remove_replica ()
 
bool is_semi_sync_replica ()
 
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 readReplicaReply (NET *net, const char *event_buf)
 
int skipReplicaReply (const char *event_buf, uint32 server_id, const char *log_file_name, my_off_t log_file_pos)
 
void setExportStats ()
 
int resetSource ()
 
int setWaitReplicaCount (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_source_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 source_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 source of semi-synchronous replication.

Constructor & Destructor Documentation

◆ ReplSemiSyncSource()

ReplSemiSyncSource::ReplSemiSyncSource ( )

◆ ~ReplSemiSyncSource()

ReplSemiSyncSource::~ReplSemiSyncSource ( )

Member Function Documentation

◆ add_replica()

void ReplSemiSyncSource::add_replica ( )

◆ commitTrx()

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

◆ disableSource()

int ReplSemiSyncSource::disableSource ( )

◆ enableSource()

int ReplSemiSyncSource::enableSource ( )

◆ force_switch_on()

void ReplSemiSyncSource::force_switch_on ( )
private

◆ getSourceEnabled()

bool ReplSemiSyncSource::getSourceEnabled ( )
inline

◆ handleAck()

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

◆ initObject()

int ReplSemiSyncSource::initObject ( )

◆ is_on()

bool ReplSemiSyncSource::is_on ( )
inlineprivate

◆ is_semi_sync_replica()

bool ReplSemiSyncSource::is_semi_sync_replica ( )

◆ lock()

void ReplSemiSyncSource::lock ( )
private

◆ readReplicaReply()

int ReplSemiSyncSource::readReplicaReply ( NET net,
const char *  event_buf 
)

◆ remove_replica()

void ReplSemiSyncSource::remove_replica ( )

◆ reportReplyBinlog()

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

◆ reportReplyPacket()

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

◆ reserveSyncHeader()

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

◆ resetSource()

int ReplSemiSyncSource::resetSource ( )

◆ set_source_enabled()

void ReplSemiSyncSource::set_source_enabled ( bool  enabled)
inlineprivate

◆ set_wait_no_replica()

void ReplSemiSyncSource::set_wait_no_replica ( const void *  val)

◆ setExportStats()

void ReplSemiSyncSource::setExportStats ( )

◆ setTraceLevel()

void ReplSemiSyncSource::setTraceLevel ( unsigned long  trace_level)
inline

◆ setWaitReplicaCount()

int ReplSemiSyncSource::setWaitReplicaCount ( unsigned int  new_value)

◆ setWaitTimeout()

void ReplSemiSyncSource::setWaitTimeout ( unsigned long  wait_timeout)
inline

◆ skipReplicaReply()

int ReplSemiSyncSource::skipReplicaReply ( const char *  event_buf,
uint32  server_id,
const char *  log_file_name,
my_off_t  log_file_pos 
)

◆ switch_off()

int ReplSemiSyncSource::switch_off ( )
private

◆ try_switch_on()

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

◆ unlock()

void ReplSemiSyncSource::unlock ( )
private

◆ updateSyncHeader()

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

◆ writeTranxInBinlog()

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

Member Data Documentation

◆ ack_container_

AckContainer ReplSemiSyncSource::ack_container_
private

◆ active_tranxs_

ActiveTranx* ReplSemiSyncSource::active_tranxs_ = nullptr
private

◆ commit_file_name_

char ReplSemiSyncSource::commit_file_name_[FN_REFLEN]
private

◆ commit_file_name_inited_

bool ReplSemiSyncSource::commit_file_name_inited_ = false
private

◆ commit_file_pos_

my_off_t ReplSemiSyncSource::commit_file_pos_ = 0
private

◆ init_done_

bool ReplSemiSyncSource::init_done_ = false
private

◆ LOCK_binlog_

mysql_mutex_t ReplSemiSyncSource::LOCK_binlog_
private

◆ reply_file_name_

char ReplSemiSyncSource::reply_file_name_[FN_REFLEN]
private

◆ reply_file_name_inited_

bool ReplSemiSyncSource::reply_file_name_inited_ = false
private

◆ reply_file_pos_

my_off_t ReplSemiSyncSource::reply_file_pos_ = 0
private

◆ source_enabled_

volatile bool ReplSemiSyncSource::source_enabled_
private
Initial value:
=
false

◆ state_

bool ReplSemiSyncSource::state_ = false
private

◆ wait_file_name_

char ReplSemiSyncSource::wait_file_name_[FN_REFLEN]
private

◆ wait_file_name_inited_

bool ReplSemiSyncSource::wait_file_name_inited_ = false
private

◆ wait_file_pos_

my_off_t ReplSemiSyncSource::wait_file_pos_ = 0
private

◆ wait_timeout_

unsigned long ReplSemiSyncSource::wait_timeout_ = 0
private

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