MySQL 8.0.39
Source Code Documentation
Ack_receiver Class Reference

Ack_receiver is responsible to control ack receive thread and maintain slave information used by ack receive thread. More...

#include <semisync_source_ack_receiver.h>

Inheritance diagram for Ack_receiver:
[legend]

Public Member Functions

 Ack_receiver ()
 
 ~Ack_receiver ()
 
bool add_slave (THD *thd)
 Notify ack receiver to receive acks on the dump session. More...
 
void remove_slave (THD *thd)
 Notify ack receiver not to receive ack on the dump session. More...
 
bool start ()
 Start ack receive thread. More...
 
void stop ()
 Stop ack receive thread. More...
 
void run ()
 The core of ack receive thread. More...
 
void setTraceLevel (unsigned long trace_level)
 
bool init ()
 
- 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 Types

enum  status { ST_UP , ST_DOWN , ST_STOPPING }
 

Private Member Functions

 Ack_receiver (const Ack_receiver &ack_receiver)
 
Ack_receiveroperator= (const Ack_receiver &ack_receiver)
 
void set_stage_info (const PSI_stage_info &stage)
 
void wait_for_slave_connection ()
 

Private Attributes

uint8 m_status
 
mysql_mutex_t m_mutex
 
mysql_cond_t m_cond
 
bool m_slaves_changed
 
Slave_vector m_slaves
 
my_thread_handle m_pid
 

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

Ack_receiver is responsible to control ack receive thread and maintain slave information used by ack receive thread.

There are mainly four operations on ack receive thread: start: start ack receive thread stop: stop ack receive thread add_slave: maintain a new semisync slave's information remove_slave: remove a semisync slave's information

Member Enumeration Documentation

◆ status

enum Ack_receiver::status
private
Enumerator
ST_UP 
ST_DOWN 
ST_STOPPING 

Constructor & Destructor Documentation

◆ Ack_receiver() [1/2]

Ack_receiver::Ack_receiver ( )

◆ ~Ack_receiver()

Ack_receiver::~Ack_receiver ( )

◆ Ack_receiver() [2/2]

Ack_receiver::Ack_receiver ( const Ack_receiver ack_receiver)
private

Member Function Documentation

◆ add_slave()

bool Ack_receiver::add_slave ( THD thd)

Notify ack receiver to receive acks on the dump session.

It adds the given dump thread into the slave list and wakes up ack thread if it is waiting for any slave coming.

Parameters
[in]thdTHD of a dump thread.
Returns
it return false if succeeds, otherwise true is returned.

◆ init()

bool Ack_receiver::init ( )
inline

◆ operator=()

Ack_receiver & Ack_receiver::operator= ( const Ack_receiver ack_receiver)
private

◆ remove_slave()

void Ack_receiver::remove_slave ( THD thd)

Notify ack receiver not to receive ack on the dump session.

it removes the given dump thread from slave list.

Parameters
[in]thdTHD of a dump thread.

◆ run()

void Ack_receiver::run ( )

The core of ack receive thread.

It monitors all slaves' sockets and receives acks when they come.

◆ set_stage_info()

void Ack_receiver::set_stage_info ( const PSI_stage_info stage)
inlineprivate

◆ setTraceLevel()

void Ack_receiver::setTraceLevel ( unsigned long  trace_level)
inline

◆ start()

bool Ack_receiver::start ( )

Start ack receive thread.

Returns
it return false if succeeds, otherwise true is returned.

◆ stop()

void Ack_receiver::stop ( )

Stop ack receive thread.

◆ wait_for_slave_connection()

void Ack_receiver::wait_for_slave_connection ( )
inlineprivate

Member Data Documentation

◆ m_cond

mysql_cond_t Ack_receiver::m_cond
private

◆ m_mutex

mysql_mutex_t Ack_receiver::m_mutex
private

◆ m_pid

my_thread_handle Ack_receiver::m_pid
private

◆ m_slaves

Slave_vector Ack_receiver::m_slaves
private

◆ m_slaves_changed

bool Ack_receiver::m_slaves_changed
private

◆ m_status

uint8 Ack_receiver::m_status
private

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