Commit 529120e1 authored by Andrei Elkin's avatar Andrei Elkin Committed by Monty

MDEV-13073. This patch is a followup of the previous one to convert the...

MDEV-13073. This patch is a followup of the previous one to convert the trailing underscore identifier to mariadb standard. For identifier representing class private members the underscore is replaced with a `m_` prefix. Otherwise `_` is just removed.
parent f279d3c4
...@@ -33,13 +33,13 @@ class Trace { ...@@ -33,13 +33,13 @@ class Trace {
static const unsigned long k_trace_detail; static const unsigned long k_trace_detail;
static const unsigned long k_trace_net_wait; static const unsigned long k_trace_net_wait;
unsigned long trace_level_; /* the level for tracing */ unsigned long m_trace_level; /* the level for tracing */
Trace() Trace()
:trace_level_(0L) :m_trace_level(0L)
{} {}
Trace(unsigned long trace_level) Trace(unsigned long trace_level)
:trace_level_(trace_level) :m_trace_level(trace_level)
{} {}
}; };
......
...@@ -74,29 +74,29 @@ static ulonglong timespec_to_usec(const struct timespec *ts) ...@@ -74,29 +74,29 @@ static ulonglong timespec_to_usec(const struct timespec *ts)
Active_tranx::Active_tranx(mysql_mutex_t *lock, Active_tranx::Active_tranx(mysql_mutex_t *lock,
ulong trace_level) ulong trace_level)
: Trace(trace_level), allocator_(max_connections), : Trace(trace_level), m_allocator(max_connections),
num_entries_(max_connections << 1), /* Transaction hash table size m_num_entries(max_connections << 1), /* Transaction hash table size
* is set to double the size * is set to double the size
* of max_connections */ * of max_connections */
lock_(lock) m_lock(lock)
{ {
/* No transactions are in the list initially. */ /* No transactions are in the list initially. */
trx_front_ = NULL; m_trx_front = NULL;
trx_rear_ = NULL; m_trx_rear = NULL;
/* Create the hash table to find a transaction's ending event. */ /* Create the hash table to find a transaction's ending event. */
trx_htb_ = new Tranx_node *[num_entries_]; m_trx_htb = new Tranx_node *[m_num_entries];
for (int idx = 0; idx < num_entries_; ++idx) for (int idx = 0; idx < m_num_entries; ++idx)
trx_htb_[idx] = NULL; m_trx_htb[idx] = NULL;
sql_print_information("Semi-sync replication initialized for transactions."); sql_print_information("Semi-sync replication initialized for transactions.");
} }
Active_tranx::~Active_tranx() Active_tranx::~Active_tranx()
{ {
delete [] trx_htb_; delete [] m_trx_htb;
trx_htb_ = NULL; m_trx_htb = NULL;
num_entries_ = 0; m_num_entries = 0;
} }
unsigned int Active_tranx::calc_hash(const unsigned char *key, unsigned int Active_tranx::calc_hash(const unsigned char *key,
...@@ -121,7 +121,7 @@ unsigned int Active_tranx::get_hash_value(const char *log_file_name, ...@@ -121,7 +121,7 @@ unsigned int Active_tranx::get_hash_value(const char *log_file_name,
unsigned int hash2 = calc_hash((const unsigned char *)(&log_file_pos), unsigned int hash2 = calc_hash((const unsigned char *)(&log_file_pos),
sizeof(log_file_pos)); sizeof(log_file_pos));
return (hash1 + hash2) % num_entries_; return (hash1 + hash2) % m_num_entries;
} }
int Active_tranx::compare(const char *log_file_name1, my_off_t log_file_pos1, int Active_tranx::compare(const char *log_file_name1, my_off_t log_file_pos1,
...@@ -148,7 +148,7 @@ int Active_tranx::insert_tranx_node(const char *log_file_name, ...@@ -148,7 +148,7 @@ int Active_tranx::insert_tranx_node(const char *log_file_name,
DBUG_ENTER("Active_tranx:insert_tranx_node"); DBUG_ENTER("Active_tranx:insert_tranx_node");
ins_node = allocator_.allocate_node(); ins_node = m_allocator.allocate_node();
if (!ins_node) if (!ins_node)
{ {
sql_print_error("%s: transaction node allocation failed for: (%s, %lu)", sql_print_error("%s: transaction node allocation failed for: (%s, %lu)",
...@@ -159,25 +159,25 @@ int Active_tranx::insert_tranx_node(const char *log_file_name, ...@@ -159,25 +159,25 @@ int Active_tranx::insert_tranx_node(const char *log_file_name,
} }
/* insert the binlog position in the active transaction list. */ /* insert the binlog position in the active transaction list. */
strncpy(ins_node->log_name_, log_file_name, FN_REFLEN-1); strncpy(ins_node->log_name, log_file_name, FN_REFLEN-1);
ins_node->log_name_[FN_REFLEN-1] = 0; /* make sure it ends properly */ ins_node->log_name[FN_REFLEN-1] = 0; /* make sure it ends properly */
ins_node->log_pos_ = log_file_pos; ins_node->log_pos = log_file_pos;
if (!trx_front_) if (!m_trx_front)
{ {
/* The list is empty. */ /* The list is empty. */
trx_front_ = trx_rear_ = ins_node; m_trx_front = m_trx_rear = ins_node;
} }
else else
{ {
int cmp = compare(ins_node, trx_rear_); int cmp = compare(ins_node, m_trx_rear);
if (cmp > 0) if (cmp > 0)
{ {
/* Compare with the tail first. If the transaction happens later in /* Compare with the tail first. If the transaction happens later in
* binlog, then make it the new tail. * binlog, then make it the new tail.
*/ */
trx_rear_->next_ = ins_node; m_trx_rear->next = ins_node;
trx_rear_ = ins_node; m_trx_rear = ins_node;
} }
else else
{ {
...@@ -186,20 +186,20 @@ int Active_tranx::insert_tranx_node(const char *log_file_name, ...@@ -186,20 +186,20 @@ int Active_tranx::insert_tranx_node(const char *log_file_name,
*/ */
sql_print_error("%s: binlog write out-of-order, tail (%s, %lu), " sql_print_error("%s: binlog write out-of-order, tail (%s, %lu), "
"new node (%s, %lu)", "Active_tranx:insert_tranx_node", "new node (%s, %lu)", "Active_tranx:insert_tranx_node",
trx_rear_->log_name_, (ulong)trx_rear_->log_pos_, m_trx_rear->log_name, (ulong)m_trx_rear->log_pos,
ins_node->log_name_, (ulong)ins_node->log_pos_); ins_node->log_name, (ulong)ins_node->log_pos);
result = -1; result = -1;
goto l_end; goto l_end;
} }
} }
hash_val = get_hash_value(ins_node->log_name_, ins_node->log_pos_); hash_val = get_hash_value(ins_node->log_name, ins_node->log_pos);
ins_node->hash_next_ = trx_htb_[hash_val]; ins_node->hash_next = m_trx_htb[hash_val];
trx_htb_[hash_val] = ins_node; m_trx_htb[hash_val] = ins_node;
DBUG_PRINT("semisync", ("%s: insert (%s, %lu) in entry(%u)", DBUG_PRINT("semisync", ("%s: insert (%s, %lu) in entry(%u)",
"Active_tranx:insert_tranx_node", "Active_tranx:insert_tranx_node",
ins_node->log_name_, (ulong)ins_node->log_pos_, ins_node->log_name, (ulong)ins_node->log_pos,
hash_val)); hash_val));
l_end: l_end:
...@@ -212,14 +212,14 @@ bool Active_tranx::is_tranx_end_pos(const char *log_file_name, ...@@ -212,14 +212,14 @@ bool Active_tranx::is_tranx_end_pos(const char *log_file_name,
DBUG_ENTER("Active_tranx::is_tranx_end_pos"); DBUG_ENTER("Active_tranx::is_tranx_end_pos");
unsigned int hash_val = get_hash_value(log_file_name, log_file_pos); unsigned int hash_val = get_hash_value(log_file_name, log_file_pos);
Tranx_node *entry = trx_htb_[hash_val]; Tranx_node *entry = m_trx_htb[hash_val];
while (entry != NULL) while (entry != NULL)
{ {
if (compare(entry, log_file_name, log_file_pos) == 0) if (compare(entry, log_file_name, log_file_pos) == 0)
break; break;
entry = entry->hash_next_; entry = entry->hash_next;
} }
DBUG_PRINT("semisync", ("%s: probe (%s, %lu) in entry(%u)", DBUG_PRINT("semisync", ("%s: probe (%s, %lu) in entry(%u)",
...@@ -238,13 +238,13 @@ int Active_tranx::clear_active_tranx_nodes(const char *log_file_name, ...@@ -238,13 +238,13 @@ int Active_tranx::clear_active_tranx_nodes(const char *log_file_name,
if (log_file_name != NULL) if (log_file_name != NULL)
{ {
new_front = trx_front_; new_front = m_trx_front;
while (new_front) while (new_front)
{ {
if (compare(new_front, log_file_name, log_file_pos) > 0) if (compare(new_front, log_file_name, log_file_pos) > 0)
break; break;
new_front = new_front->next_; new_front = new_front->next;
} }
} }
else else
...@@ -258,54 +258,54 @@ int Active_tranx::clear_active_tranx_nodes(const char *log_file_name, ...@@ -258,54 +258,54 @@ int Active_tranx::clear_active_tranx_nodes(const char *log_file_name,
/* No active transaction nodes after the call. */ /* No active transaction nodes after the call. */
/* Clear the hash table. */ /* Clear the hash table. */
memset(trx_htb_, 0, num_entries_ * sizeof(Tranx_node *)); memset(m_trx_htb, 0, m_num_entries * sizeof(Tranx_node *));
allocator_.free_all_nodes(); m_allocator.free_all_nodes();
/* Clear the active transaction list. */ /* Clear the active transaction list. */
if (trx_front_ != NULL) if (m_trx_front != NULL)
{ {
trx_front_ = NULL; m_trx_front = NULL;
trx_rear_ = NULL; m_trx_rear = NULL;
} }
DBUG_PRINT("semisync", ("%s: cleared all nodes", DBUG_PRINT("semisync", ("%s: cleared all nodes",
"Active_tranx::::clear_active_tranx_nodes")); "Active_tranx::::clear_active_tranx_nodes"));
} }
else if (new_front != trx_front_) else if (new_front != m_trx_front)
{ {
Tranx_node *curr_node, *next_node; Tranx_node *curr_node, *next_node;
/* Delete all transaction nodes before the confirmation point. */ /* Delete all transaction nodes before the confirmation point. */
int n_frees = 0; int n_frees = 0;
curr_node = trx_front_; curr_node = m_trx_front;
while (curr_node != new_front) while (curr_node != new_front)
{ {
next_node = curr_node->next_; next_node = curr_node->next;
n_frees++; n_frees++;
/* Remove the node from the hash table. */ /* Remove the node from the hash table. */
unsigned int hash_val = get_hash_value(curr_node->log_name_, curr_node->log_pos_); unsigned int hash_val = get_hash_value(curr_node->log_name, curr_node->log_pos);
Tranx_node **hash_ptr = &(trx_htb_[hash_val]); Tranx_node **hash_ptr = &(m_trx_htb[hash_val]);
while ((*hash_ptr) != NULL) while ((*hash_ptr) != NULL)
{ {
if ((*hash_ptr) == curr_node) if ((*hash_ptr) == curr_node)
{ {
(*hash_ptr) = curr_node->hash_next_; (*hash_ptr) = curr_node->hash_next;
break; break;
} }
hash_ptr = &((*hash_ptr)->hash_next_); hash_ptr = &((*hash_ptr)->hash_next);
} }
curr_node = next_node; curr_node = next_node;
} }
trx_front_ = new_front; m_trx_front = new_front;
allocator_.free_nodes_before(trx_front_); m_allocator.free_nodes_before(m_trx_front);
DBUG_PRINT("semisync", ("%s: cleared %d nodes back until pos (%s, %lu)", DBUG_PRINT("semisync", ("%s: cleared %d nodes back until pos (%s, %lu)",
"Active_tranx::::clear_active_tranx_nodes", "Active_tranx::::clear_active_tranx_nodes",
n_frees, n_frees,
trx_front_->log_name_, (ulong)trx_front_->log_pos_)); m_trx_front->log_name, (ulong)m_trx_front->log_pos));
} }
DBUG_RETURN(0); DBUG_RETURN(0);
...@@ -336,26 +336,26 @@ int Active_tranx::clear_active_tranx_nodes(const char *log_file_name, ...@@ -336,26 +336,26 @@ int Active_tranx::clear_active_tranx_nodes(const char *log_file_name,
******************************************************************************/ ******************************************************************************/
Repl_semi_sync_master::Repl_semi_sync_master() Repl_semi_sync_master::Repl_semi_sync_master()
: active_tranxs_(NULL), : m_active_tranxs(NULL),
init_done_(false), m_init_done(false),
reply_file_name_inited_(false), m_reply_file_name_inited(false),
reply_file_pos_(0L), m_reply_file_pos(0L),
wait_file_name_inited_(false), m_wait_file_name_inited(false),
wait_file_pos_(0), m_wait_file_pos(0),
master_enabled_(false), m_master_enabled(false),
wait_timeout_(0L), m_wait_timeout(0L),
state_(0), m_state(0),
wait_point_(0) m_wait_point(0)
{ {
strcpy(reply_file_name_, ""); strcpy(m_reply_file_name, "");
strcpy(wait_file_name_, ""); strcpy(m_wait_file_name, "");
} }
int Repl_semi_sync_master::init_object() int Repl_semi_sync_master::init_object()
{ {
int result; int result;
init_done_ = true; m_init_done = true;
/* References to the parameter works after set_options(). */ /* References to the parameter works after set_options(). */
set_wait_timeout(rpl_semi_sync_master_timeout); set_wait_timeout(rpl_semi_sync_master_timeout);
...@@ -398,15 +398,15 @@ int Repl_semi_sync_master::enable_master() ...@@ -398,15 +398,15 @@ int Repl_semi_sync_master::enable_master()
if (!get_master_enabled()) if (!get_master_enabled())
{ {
active_tranxs_ = new Active_tranx(&LOCK_binlog, trace_level_); m_active_tranxs = new Active_tranx(&LOCK_binlog, m_trace_level);
if (active_tranxs_ != NULL) if (m_active_tranxs != NULL)
{ {
commit_file_name_inited_ = false; m_commit_file_name_inited = false;
reply_file_name_inited_ = false; m_reply_file_name_inited = false;
wait_file_name_inited_ = false; m_wait_file_name_inited = false;
set_master_enabled(true); set_master_enabled(true);
state_ = true; m_state = true;
sql_print_information("Semi-sync replication enabled on the master."); sql_print_information("Semi-sync replication enabled on the master.");
} }
else else
...@@ -433,13 +433,13 @@ int Repl_semi_sync_master::disable_master() ...@@ -433,13 +433,13 @@ int Repl_semi_sync_master::disable_master()
*/ */
switch_off(); switch_off();
assert(active_tranxs_ != NULL); assert(m_active_tranxs != NULL);
delete active_tranxs_; delete m_active_tranxs;
active_tranxs_ = NULL; m_active_tranxs = NULL;
reply_file_name_inited_ = false; m_reply_file_name_inited = false;
wait_file_name_inited_ = false; m_wait_file_name_inited = false;
commit_file_name_inited_ = false; m_commit_file_name_inited = false;
set_master_enabled(false); set_master_enabled(false);
sql_print_information("Semi-sync replication disabled on the master."); sql_print_information("Semi-sync replication disabled on the master.");
...@@ -452,14 +452,14 @@ int Repl_semi_sync_master::disable_master() ...@@ -452,14 +452,14 @@ int Repl_semi_sync_master::disable_master()
void Repl_semi_sync_master::cleanup() void Repl_semi_sync_master::cleanup()
{ {
if (init_done_) if (m_init_done)
{ {
mysql_mutex_destroy(&LOCK_binlog); mysql_mutex_destroy(&LOCK_binlog);
mysql_cond_destroy(&COND_binlog_send); mysql_cond_destroy(&COND_binlog_send);
init_done_= 0; m_init_done= 0;
} }
delete active_tranxs_; delete m_active_tranxs;
} }
void Repl_semi_sync_master::lock() void Repl_semi_sync_master::lock()
...@@ -592,10 +592,10 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id, ...@@ -592,10 +592,10 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id,
* sync replication slaves. So, if any one of them get the transaction, * sync replication slaves. So, if any one of them get the transaction,
* the transaction session in the primary can move forward. * the transaction session in the primary can move forward.
*/ */
if (reply_file_name_inited_) if (m_reply_file_name_inited)
{ {
cmp = Active_tranx::compare(log_file_name, log_file_pos, cmp = Active_tranx::compare(log_file_name, log_file_pos,
reply_file_name_, reply_file_pos_); m_reply_file_name, m_reply_file_pos);
/* If the requested position is behind the sending binlog position, /* If the requested position is behind the sending binlog position,
* would not adjust sending binlog position. * would not adjust sending binlog position.
...@@ -614,13 +614,13 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id, ...@@ -614,13 +614,13 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id,
if (need_copy_send_pos) if (need_copy_send_pos)
{ {
strmake_buf(reply_file_name_, log_file_name); strmake_buf(m_reply_file_name, log_file_name);
reply_file_pos_ = log_file_pos; m_reply_file_pos = log_file_pos;
reply_file_name_inited_ = true; m_reply_file_name_inited = true;
/* Remove all active transaction nodes before this point. */ /* Remove all active transaction nodes before this point. */
assert(active_tranxs_ != NULL); assert(m_active_tranxs != NULL);
active_tranxs_->clear_active_tranx_nodes(log_file_name, log_file_pos); m_active_tranxs->clear_active_tranx_nodes(log_file_name, log_file_pos);
DBUG_PRINT("semisync", ("%s: Got reply at (%s, %lu)", DBUG_PRINT("semisync", ("%s: Got reply at (%s, %lu)",
"Repl_semi_sync_master::report_reply_binlog", "Repl_semi_sync_master::report_reply_binlog",
...@@ -632,15 +632,15 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id, ...@@ -632,15 +632,15 @@ int Repl_semi_sync_master::report_reply_binlog(uint32 server_id,
/* Let us check if some of the waiting threads doing a trx /* Let us check if some of the waiting threads doing a trx
* commit can now proceed. * commit can now proceed.
*/ */
cmp = Active_tranx::compare(reply_file_name_, reply_file_pos_, cmp = Active_tranx::compare(m_reply_file_name, m_reply_file_pos,
wait_file_name_, wait_file_pos_); m_wait_file_name, m_wait_file_pos);
if (cmp >= 0) if (cmp >= 0)
{ {
/* Yes, at least one waiting thread can now proceed: /* Yes, at least one waiting thread can now proceed:
* let us release all waiting threads with a broadcast * let us release all waiting threads with a broadcast
*/ */
can_release_threads = true; can_release_threads = true;
wait_file_name_inited_ = false; m_wait_file_name_inited = false;
} }
} }
...@@ -811,9 +811,9 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, ...@@ -811,9 +811,9 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
while (is_on() && !thd_killed(current_thd)) while (is_on() && !thd_killed(current_thd))
{ {
if (reply_file_name_inited_) if (m_reply_file_name_inited)
{ {
int cmp = Active_tranx::compare(reply_file_name_, reply_file_pos_, int cmp = Active_tranx::compare(m_reply_file_name, m_reply_file_pos,
trx_wait_binlog_name, trx_wait_binlog_name,
trx_wait_binlog_pos); trx_wait_binlog_pos);
if (cmp >= 0) if (cmp >= 0)
...@@ -823,8 +823,8 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, ...@@ -823,8 +823,8 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
*/ */
DBUG_PRINT("semisync", ("%s: Binlog reply is ahead (%s, %lu),", DBUG_PRINT("semisync", ("%s: Binlog reply is ahead (%s, %lu),",
"Repl_semi_sync_master::commit_trx", "Repl_semi_sync_master::commit_trx",
reply_file_name_, m_reply_file_name,
(ulong)reply_file_pos_)); (ulong)m_reply_file_pos));
break; break;
} }
} }
...@@ -832,37 +832,37 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, ...@@ -832,37 +832,37 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
/* Let us update the info about the minimum binlog position of waiting /* Let us update the info about the minimum binlog position of waiting
* threads. * threads.
*/ */
if (wait_file_name_inited_) if (m_wait_file_name_inited)
{ {
int cmp = Active_tranx::compare(trx_wait_binlog_name, int cmp = Active_tranx::compare(trx_wait_binlog_name,
trx_wait_binlog_pos, trx_wait_binlog_pos,
wait_file_name_, wait_file_pos_); m_wait_file_name, m_wait_file_pos);
if (cmp <= 0) if (cmp <= 0)
{ {
/* This thd has a lower position, let's update the minimum info. */ /* This thd has a lower position, let's update the minimum info. */
strmake_buf(wait_file_name_, trx_wait_binlog_name); strmake_buf(m_wait_file_name, trx_wait_binlog_name);
wait_file_pos_ = trx_wait_binlog_pos; m_wait_file_pos = trx_wait_binlog_pos;
rpl_semi_sync_master_wait_pos_backtraverse++; rpl_semi_sync_master_wait_pos_backtraverse++;
DBUG_PRINT("semisync", ("%s: move back wait position (%s, %lu),", DBUG_PRINT("semisync", ("%s: move back wait position (%s, %lu),",
"Repl_semi_sync_master::commit_trx", "Repl_semi_sync_master::commit_trx",
wait_file_name_, (ulong)wait_file_pos_)); m_wait_file_name, (ulong)m_wait_file_pos));
} }
} }
else else
{ {
strmake_buf(wait_file_name_, trx_wait_binlog_name); strmake_buf(m_wait_file_name, trx_wait_binlog_name);
wait_file_pos_ = trx_wait_binlog_pos; m_wait_file_pos = trx_wait_binlog_pos;
wait_file_name_inited_ = true; m_wait_file_name_inited = true;
DBUG_PRINT("semisync", ("%s: init wait position (%s, %lu),", DBUG_PRINT("semisync", ("%s: init wait position (%s, %lu),",
"Repl_semi_sync_master::commit_trx", "Repl_semi_sync_master::commit_trx",
wait_file_name_, (ulong)wait_file_pos_)); m_wait_file_name, (ulong)m_wait_file_pos));
} }
/* Calcuate the waiting period. */ /* Calcuate the waiting period. */
long diff_secs = (long) (wait_timeout_ / TIME_THOUSAND); long diff_secs = (long) (m_wait_timeout / TIME_THOUSAND);
long diff_nsecs = (long) ((wait_timeout_ % TIME_THOUSAND) * TIME_MILLION); long diff_nsecs = (long) ((m_wait_timeout % TIME_THOUSAND) * TIME_MILLION);
long nsecs = start_ts.tv_nsec + diff_nsecs; long nsecs = start_ts.tv_nsec + diff_nsecs;
abstime.tv_sec = start_ts.tv_sec + diff_secs + nsecs/TIME_BILLION; abstime.tv_sec = start_ts.tv_sec + diff_secs + nsecs/TIME_BILLION;
abstime.tv_nsec = nsecs % TIME_BILLION; abstime.tv_nsec = nsecs % TIME_BILLION;
...@@ -879,8 +879,8 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, ...@@ -879,8 +879,8 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
DBUG_PRINT("semisync", ("%s: wait %lu ms for binlog sent (%s, %lu)", DBUG_PRINT("semisync", ("%s: wait %lu ms for binlog sent (%s, %lu)",
"Repl_semi_sync_master::commit_trx", "Repl_semi_sync_master::commit_trx",
wait_timeout_, m_wait_timeout,
wait_file_name_, (ulong)wait_file_pos_)); m_wait_file_name, (ulong)m_wait_file_pos));
wait_result = cond_timewait(&abstime); wait_result = cond_timewait(&abstime);
rpl_semi_sync_master_wait_sessions--; rpl_semi_sync_master_wait_sessions--;
...@@ -891,7 +891,7 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, ...@@ -891,7 +891,7 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
sql_print_warning("Timeout waiting for reply of binlog (file: %s, pos: %lu), " sql_print_warning("Timeout waiting for reply of binlog (file: %s, pos: %lu), "
"semi-sync up to file %s, position %lu.", "semi-sync up to file %s, position %lu.",
trx_wait_binlog_name, (ulong)trx_wait_binlog_pos, trx_wait_binlog_name, (ulong)trx_wait_binlog_pos,
reply_file_name_, (ulong)reply_file_pos_); m_reply_file_name, (ulong)m_reply_file_pos);
rpl_semi_sync_master_wait_timeouts++; rpl_semi_sync_master_wait_timeouts++;
/* switch semi-sync off */ /* switch semi-sync off */
...@@ -921,11 +921,11 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, ...@@ -921,11 +921,11 @@ int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name,
/* /*
At this point, the binlog file and position of this transaction At this point, the binlog file and position of this transaction
must have been removed from Active_tranx. must have been removed from Active_tranx.
active_tranxs_ may be NULL if someone disabled semi sync during m_active_tranxs may be NULL if someone disabled semi sync during
cond_timewait() cond_timewait()
*/ */
assert(thd_killed(current_thd) || !active_tranxs_ || assert(thd_killed(current_thd) || !m_active_tranxs ||
!active_tranxs_->is_tranx_end_pos(trx_wait_binlog_name, !m_active_tranxs->is_tranx_end_pos(trx_wait_binlog_name,
trx_wait_binlog_pos)); trx_wait_binlog_pos));
l_end: l_end:
...@@ -967,15 +967,15 @@ int Repl_semi_sync_master::switch_off() ...@@ -967,15 +967,15 @@ int Repl_semi_sync_master::switch_off()
DBUG_ENTER("Repl_semi_sync_master::switch_off"); DBUG_ENTER("Repl_semi_sync_master::switch_off");
state_ = false; m_state = false;
/* Clear the active transaction list. */ /* Clear the active transaction list. */
assert(active_tranxs_ != NULL); assert(m_active_tranxs != NULL);
result = active_tranxs_->clear_active_tranx_nodes(NULL, 0); result = m_active_tranxs->clear_active_tranx_nodes(NULL, 0);
rpl_semi_sync_master_off_times++; rpl_semi_sync_master_off_times++;
wait_file_name_inited_ = false; m_wait_file_name_inited = false;
reply_file_name_inited_ = false; m_reply_file_name_inited = false;
sql_print_information("Semi-sync replication switched OFF."); sql_print_information("Semi-sync replication switched OFF.");
cond_broadcast(); /* wake up all waiting threads */ cond_broadcast(); /* wake up all waiting threads */
...@@ -993,13 +993,13 @@ int Repl_semi_sync_master::try_switch_on(int server_id, ...@@ -993,13 +993,13 @@ int Repl_semi_sync_master::try_switch_on(int server_id,
/* If the current sending event's position is larger than or equal to the /* If the current sending event's position is larger than or equal to the
* 'largest' commit transaction binlog position, the slave is already * 'largest' commit transaction binlog position, the slave is already
* catching up now and we can switch semi-sync on here. * catching up now and we can switch semi-sync on here.
* If commit_file_name_inited_ indicates there are no recent transactions, * If m_commit_file_name_inited indicates there are no recent transactions,
* we can enable semi-sync immediately. * we can enable semi-sync immediately.
*/ */
if (commit_file_name_inited_) if (m_commit_file_name_inited)
{ {
int cmp = Active_tranx::compare(log_file_name, log_file_pos, int cmp = Active_tranx::compare(log_file_name, log_file_pos,
commit_file_name_, commit_file_pos_); m_commit_file_name, m_commit_file_pos);
semi_sync_on = (cmp >= 0); semi_sync_on = (cmp >= 0);
} }
else else
...@@ -1010,7 +1010,7 @@ int Repl_semi_sync_master::try_switch_on(int server_id, ...@@ -1010,7 +1010,7 @@ int Repl_semi_sync_master::try_switch_on(int server_id,
if (semi_sync_on) if (semi_sync_on)
{ {
/* Switch semi-sync replication on. */ /* Switch semi-sync replication on. */
state_ = true; m_state = true;
sql_print_information("Semi-sync replication switched ON with slave (server_id: %d) " sql_print_information("Semi-sync replication switched ON with slave (server_id: %d) "
"at (%s, %lu)", "at (%s, %lu)",
...@@ -1066,10 +1066,10 @@ int Repl_semi_sync_master::update_sync_header(THD* thd, unsigned char *packet, ...@@ -1066,10 +1066,10 @@ int Repl_semi_sync_master::update_sync_header(THD* thd, unsigned char *packet,
/* semi-sync is ON */ /* semi-sync is ON */
sync = false; /* No sync unless a transaction is involved. */ sync = false; /* No sync unless a transaction is involved. */
if (reply_file_name_inited_) if (m_reply_file_name_inited)
{ {
cmp = Active_tranx::compare(log_file_name, log_file_pos, cmp = Active_tranx::compare(log_file_name, log_file_pos,
reply_file_name_, reply_file_pos_); m_reply_file_name, m_reply_file_pos);
if (cmp <= 0) if (cmp <= 0)
{ {
/* If we have already got the reply for the event, then we do /* If we have already got the reply for the event, then we do
...@@ -1079,10 +1079,10 @@ int Repl_semi_sync_master::update_sync_header(THD* thd, unsigned char *packet, ...@@ -1079,10 +1079,10 @@ int Repl_semi_sync_master::update_sync_header(THD* thd, unsigned char *packet,
} }
} }
if (wait_file_name_inited_) if (m_wait_file_name_inited)
{ {
cmp = Active_tranx::compare(log_file_name, log_file_pos, cmp = Active_tranx::compare(log_file_name, log_file_pos,
wait_file_name_, wait_file_pos_); m_wait_file_name, m_wait_file_pos);
} }
else else
{ {
...@@ -1097,17 +1097,17 @@ int Repl_semi_sync_master::update_sync_header(THD* thd, unsigned char *packet, ...@@ -1097,17 +1097,17 @@ int Repl_semi_sync_master::update_sync_header(THD* thd, unsigned char *packet,
/* /*
* We only wait if the event is a transaction's ending event. * We only wait if the event is a transaction's ending event.
*/ */
assert(active_tranxs_ != NULL); assert(m_active_tranxs != NULL);
sync = active_tranxs_->is_tranx_end_pos(log_file_name, sync = m_active_tranxs->is_tranx_end_pos(log_file_name,
log_file_pos); log_file_pos);
} }
} }
else else
{ {
if (commit_file_name_inited_) if (m_commit_file_name_inited)
{ {
int cmp = Active_tranx::compare(log_file_name, log_file_pos, int cmp = Active_tranx::compare(log_file_name, log_file_pos,
commit_file_name_, commit_file_pos_); m_commit_file_name, m_commit_file_pos);
sync = (cmp >= 0); sync = (cmp >= 0);
} }
else else
...@@ -1151,35 +1151,35 @@ int Repl_semi_sync_master::write_tranx_in_binlog(const char* log_file_name, ...@@ -1151,35 +1151,35 @@ int Repl_semi_sync_master::write_tranx_in_binlog(const char* log_file_name,
/* Update the 'largest' transaction commit position seen so far even /* Update the 'largest' transaction commit position seen so far even
* though semi-sync is switched off. * though semi-sync is switched off.
* It is much better that we update commit_file_* here, instead of * It is much better that we update m_commit_file* here, instead of
* inside commit_trx(). This is mostly because update_sync_header() * inside commit_trx(). This is mostly because update_sync_header()
* will watch for commit_file_* to decide whether to switch semi-sync * will watch for m_commit_file* to decide whether to switch semi-sync
* on. The detailed reason is explained in function update_sync_header(). * on. The detailed reason is explained in function update_sync_header().
*/ */
if (commit_file_name_inited_) if (m_commit_file_name_inited)
{ {
int cmp = Active_tranx::compare(log_file_name, log_file_pos, int cmp = Active_tranx::compare(log_file_name, log_file_pos,
commit_file_name_, commit_file_pos_); m_commit_file_name, m_commit_file_pos);
if (cmp > 0) if (cmp > 0)
{ {
/* This is a larger position, let's update the maximum info. */ /* This is a larger position, let's update the maximum info. */
strncpy(commit_file_name_, log_file_name, FN_REFLEN-1); strncpy(m_commit_file_name, log_file_name, FN_REFLEN-1);
commit_file_name_[FN_REFLEN-1] = 0; /* make sure it ends properly */ m_commit_file_name[FN_REFLEN-1] = 0; /* make sure it ends properly */
commit_file_pos_ = log_file_pos; m_commit_file_pos = log_file_pos;
} }
} }
else else
{ {
strncpy(commit_file_name_, log_file_name, FN_REFLEN-1); strncpy(m_commit_file_name, log_file_name, FN_REFLEN-1);
commit_file_name_[FN_REFLEN-1] = 0; /* make sure it ends properly */ m_commit_file_name[FN_REFLEN-1] = 0; /* make sure it ends properly */
commit_file_pos_ = log_file_pos; m_commit_file_pos = log_file_pos;
commit_file_name_inited_ = true; m_commit_file_name_inited = true;
} }
if (is_on()) if (is_on())
{ {
assert(active_tranxs_ != NULL); assert(m_active_tranxs != NULL);
if(active_tranxs_->insert_tranx_node(log_file_name, log_file_pos)) if(m_active_tranxs->insert_tranx_node(log_file_name, log_file_pos))
{ {
/* /*
if insert tranx_node failed, print a warning message if insert tranx_node failed, print a warning message
...@@ -1254,13 +1254,13 @@ int Repl_semi_sync_master::after_reset_master() ...@@ -1254,13 +1254,13 @@ int Repl_semi_sync_master::after_reset_master()
if (rpl_semi_sync_master_clients == 0 && if (rpl_semi_sync_master_clients == 0 &&
!rpl_semi_sync_master_wait_no_slave) !rpl_semi_sync_master_wait_no_slave)
state_ = 0; m_state = 0;
else else
state_ = get_master_enabled()? 1 : 0; m_state = get_master_enabled()? 1 : 0;
wait_file_name_inited_ = false; m_wait_file_name_inited = false;
reply_file_name_inited_ = false; m_reply_file_name_inited = false;
commit_file_name_inited_ = false; m_commit_file_name_inited = false;
rpl_semi_sync_master_yes_transactions = 0; rpl_semi_sync_master_yes_transactions = 0;
rpl_semi_sync_master_no_transactions = 0; rpl_semi_sync_master_no_transactions = 0;
...@@ -1306,7 +1306,7 @@ void Repl_semi_sync_master::set_export_stats() ...@@ -1306,7 +1306,7 @@ void Repl_semi_sync_master::set_export_stats()
{ {
lock(); lock();
rpl_semi_sync_master_status = state_; rpl_semi_sync_master_status = m_state;
rpl_semi_sync_master_avg_trx_wait_time= rpl_semi_sync_master_avg_trx_wait_time=
((rpl_semi_sync_master_trx_wait_num) ? ((rpl_semi_sync_master_trx_wait_num) ?
(ulong)((double)rpl_semi_sync_master_trx_wait_time / (ulong)((double)rpl_semi_sync_master_trx_wait_time /
......
...@@ -28,10 +28,10 @@ extern PSI_cond_key key_COND_binlog_send; ...@@ -28,10 +28,10 @@ extern PSI_cond_key key_COND_binlog_send;
#endif #endif
struct Tranx_node { struct Tranx_node {
char log_name_[FN_REFLEN]; char log_name[FN_REFLEN];
my_off_t log_pos_; my_off_t log_pos;
struct Tranx_node *next_; /* the next node in the sorted list */ struct Tranx_node *next; /* the next node in the sorted list */
struct Tranx_node *hash_next_; /* the next node during hash collision */ struct Tranx_node *hash_next; /* the next node during hash collision */
}; };
/** /**
...@@ -123,10 +123,10 @@ class Tranx_node_allocator ...@@ -123,10 +123,10 @@ class Tranx_node_allocator
} }
trx_node= &(current_block->nodes[++last_node]); trx_node= &(current_block->nodes[++last_node]);
trx_node->log_name_[0] = '\0'; trx_node->log_name[0] = '\0';
trx_node->log_pos_= 0; trx_node->log_pos= 0;
trx_node->next_= 0; trx_node->next= 0;
trx_node->hash_next_= 0; trx_node->hash_next= 0;
return trx_node; return trx_node;
} }
...@@ -299,14 +299,14 @@ class Active_tranx ...@@ -299,14 +299,14 @@ class Active_tranx
:public Trace { :public Trace {
private: private:
Tranx_node_allocator allocator_; Tranx_node_allocator m_allocator;
/* These two record the active transaction list in sort order. */ /* These two record the active transaction list in sort order. */
Tranx_node *trx_front_, *trx_rear_; Tranx_node *m_trx_front, *m_trx_rear;
Tranx_node **trx_htb_; /* A hash table on active transactions. */ Tranx_node **m_trx_htb; /* A hash table on active transactions. */
int num_entries_; /* maximum hash table entries */ int m_num_entries; /* maximum hash table entries */
mysql_mutex_t *lock_; /* mutex lock */ mysql_mutex_t *m_lock; /* mutex lock */
inline void assert_lock_owner(); inline void assert_lock_owner();
...@@ -316,16 +316,16 @@ class Active_tranx ...@@ -316,16 +316,16 @@ class Active_tranx
int compare(const char *log_file_name1, my_off_t log_file_pos1, int compare(const char *log_file_name1, my_off_t log_file_pos1,
const Tranx_node *node2) { const Tranx_node *node2) {
return compare(log_file_name1, log_file_pos1, return compare(log_file_name1, log_file_pos1,
node2->log_name_, node2->log_pos_); node2->log_name, node2->log_pos);
} }
int compare(const Tranx_node *node1, int compare(const Tranx_node *node1,
const char *log_file_name2, my_off_t log_file_pos2) { const char *log_file_name2, my_off_t log_file_pos2) {
return compare(node1->log_name_, node1->log_pos_, return compare(node1->log_name, node1->log_pos,
log_file_name2, log_file_pos2); log_file_name2, log_file_pos2);
} }
int compare(const Tranx_node *node1, const Tranx_node *node2) { int compare(const Tranx_node *node1, const Tranx_node *node2) {
return compare(node1->log_name_, node1->log_pos_, return compare(node1->log_name, node1->log_pos,
node2->log_name_, node2->log_pos_); node2->log_name, node2->log_pos);
} }
public: public:
...@@ -369,11 +369,11 @@ class Active_tranx ...@@ -369,11 +369,11 @@ class Active_tranx
class Repl_semi_sync_master class Repl_semi_sync_master
:public Repl_semi_sync_base { :public Repl_semi_sync_base {
private: private:
Active_tranx *active_tranxs_; /* active transaction list: the list will Active_tranx *m_active_tranxs; /* active transaction list: the list will
be cleared when semi-sync switches off. */ be cleared when semi-sync switches off. */
/* True when init_object has been called */ /* True when init_object has been called */
bool init_done_; bool m_init_done;
/* This cond variable is signaled when enough binlog has been sent to slave, /* This cond variable is signaled when enough binlog has been sent to slave,
* so that a waiting trx can return the 'ok' to the client for a commit. * so that a waiting trx can return the 'ok' to the client for a commit.
...@@ -383,32 +383,32 @@ class Repl_semi_sync_master ...@@ -383,32 +383,32 @@ class Repl_semi_sync_master
/* Mutex that protects the following state variables and the active /* Mutex that protects the following state variables and the active
* transaction list. * transaction list.
* Under no cirumstances we can acquire mysql_bin_log.LOCK_log if we are * Under no cirumstances we can acquire mysql_bin_log.LOCK_log if we are
* already holding LOCK_binlog_ because it can cause deadlocks. * already holding m_LOCK_binlog because it can cause deadlocks.
*/ */
mysql_mutex_t LOCK_binlog; mysql_mutex_t LOCK_binlog;
/* This is set to true when reply_file_name_ contains meaningful data. */ /* This is set to true when m_reply_file_name contains meaningful data. */
bool reply_file_name_inited_; bool m_reply_file_name_inited;
/* The binlog name up to which we have received replies from any slaves. */ /* The binlog name up to which we have received replies from any slaves. */
char reply_file_name_[FN_REFLEN]; char m_reply_file_name[FN_REFLEN];
/* The position in that file up to which we have the reply from any slaves. */ /* The position in that file up to which we have the reply from any slaves. */
my_off_t reply_file_pos_; my_off_t m_reply_file_pos;
/* This is set to true when we know the 'smallest' wait position. */ /* This is set to true when we know the 'smallest' wait position. */
bool wait_file_name_inited_; bool m_wait_file_name_inited;
/* NULL, or the 'smallest' filename that a transaction is waiting for /* NULL, or the 'smallest' filename that a transaction is waiting for
* slave replies. * slave replies.
*/ */
char wait_file_name_[FN_REFLEN]; char m_wait_file_name[FN_REFLEN];
/* The smallest position in that file that a trx is waiting for: the trx /* The smallest position in that file that a trx is waiting for: the trx
* can proceed and send an 'ok' to the client when the master has got the * can proceed and send an 'ok' to the client when the master has got the
* reply from the slave indicating that it already got the binlog events. * reply from the slave indicating that it already got the binlog events.
*/ */
my_off_t wait_file_pos_; my_off_t m_wait_file_pos;
/* This is set to true when we know the 'largest' transaction commit /* This is set to true when we know the 'largest' transaction commit
* position in the binlog file. * position in the binlog file.
...@@ -417,22 +417,22 @@ class Repl_semi_sync_master ...@@ -417,22 +417,22 @@ class Repl_semi_sync_master
* switch off. Binlog-dump thread can use the three fields to detect when * switch off. Binlog-dump thread can use the three fields to detect when
* slaves catch up on replication so that semi-sync can switch on again. * slaves catch up on replication so that semi-sync can switch on again.
*/ */
bool commit_file_name_inited_; bool m_commit_file_name_inited;
/* The 'largest' binlog filename that a commit transaction is seeing. */ /* The 'largest' binlog filename that a commit transaction is seeing. */
char commit_file_name_[FN_REFLEN]; char m_commit_file_name[FN_REFLEN];
/* The 'largest' position in that file that a commit transaction is seeing. */ /* The 'largest' position in that file that a commit transaction is seeing. */
my_off_t commit_file_pos_; my_off_t m_commit_file_pos;
/* All global variables which can be set by parameters. */ /* All global variables which can be set by parameters. */
volatile bool master_enabled_; /* semi-sync is enabled on the master */ volatile bool m_master_enabled; /* semi-sync is enabled on the master */
unsigned long wait_timeout_; /* timeout period(ms) during tranx wait */ unsigned long m_wait_timeout; /* timeout period(ms) during tranx wait */
bool state_; /* whether semi-sync is switched */ bool m_state; /* whether semi-sync is switched */
/*Waiting for ACK before/after innodb commit*/ /*Waiting for ACK before/after innodb commit*/
ulong wait_point_; ulong m_wait_point;
void lock(); void lock();
void unlock(); void unlock();
...@@ -441,11 +441,11 @@ class Repl_semi_sync_master ...@@ -441,11 +441,11 @@ class Repl_semi_sync_master
/* Is semi-sync replication on? */ /* Is semi-sync replication on? */
bool is_on() { bool is_on() {
return (state_); return (m_state);
} }
void set_master_enabled(bool enabled) { void set_master_enabled(bool enabled) {
master_enabled_ = enabled; m_master_enabled = enabled;
} }
/* Switch semi-sync off because of timeout in transaction waiting. */ /* Switch semi-sync off because of timeout in transaction waiting. */
...@@ -462,28 +462,28 @@ class Repl_semi_sync_master ...@@ -462,28 +462,28 @@ class Repl_semi_sync_master
void cleanup(); void cleanup();
bool get_master_enabled() { bool get_master_enabled() {
return master_enabled_; return m_master_enabled;
} }
void set_trace_level(unsigned long trace_level) { void set_trace_level(unsigned long trace_level) {
trace_level_ = trace_level; m_trace_level = trace_level;
if (active_tranxs_) if (m_active_tranxs)
active_tranxs_->trace_level_ = trace_level; m_active_tranxs->m_trace_level = trace_level;
} }
/* Set the transaction wait timeout period, in milliseconds. */ /* Set the transaction wait timeout period, in milliseconds. */
void set_wait_timeout(unsigned long wait_timeout) { void set_wait_timeout(unsigned long wait_timeout) {
wait_timeout_ = wait_timeout; m_wait_timeout = wait_timeout;
} }
/*set the ACK point, after binlog sync or after transaction commit*/ /*set the ACK point, after binlog sync or after transaction commit*/
void set_wait_point(unsigned long ack_point) void set_wait_point(unsigned long ack_point)
{ {
wait_point_ = ack_point; m_wait_point = ack_point;
} }
ulong wait_point() //no cover line ulong wait_point() //no cover line
{ {
return wait_point_; //no cover line return m_wait_point; //no cover line
} }
/* Initialize this class after MySQL parameters are initialized. this /* Initialize this class after MySQL parameters are initialized. this
...@@ -549,7 +549,7 @@ class Repl_semi_sync_master ...@@ -549,7 +549,7 @@ class Repl_semi_sync_master
/*Wait after the transaction is rollback*/ /*Wait after the transaction is rollback*/
int wait_after_rollback(THD *thd, bool all); int wait_after_rollback(THD *thd, bool all);
/*Store the current binlog position in active_tranxs_. This position should /*Store the current binlog position in m_active_tranxs. This position should
* be acked by slave*/ * be acked by slave*/
int report_binlog_update(THD *thd, const char *log_file,my_off_t log_pos); int report_binlog_update(THD *thd, const char *log_file,my_off_t log_pos);
......
...@@ -78,7 +78,7 @@ class Ack_receiver : public Repl_semi_sync_base ...@@ -78,7 +78,7 @@ class Ack_receiver : public Repl_semi_sync_base
void set_trace_level(unsigned long trace_level) void set_trace_level(unsigned long trace_level)
{ {
trace_level_= trace_level; m_trace_level= trace_level;
} }
private: private:
enum status {ST_UP, ST_DOWN, ST_STOPPING}; enum status {ST_UP, ST_DOWN, ST_STOPPING};
......
...@@ -41,7 +41,7 @@ int Repl_semi_sync_slave::init_object() ...@@ -41,7 +41,7 @@ int Repl_semi_sync_slave::init_object()
{ {
int result= 0; int result= 0;
init_done_ = true; m_init_done = true;
/* References to the parameter works after set_options(). */ /* References to the parameter works after set_options(). */
set_slave_enabled(rpl_semi_sync_slave_enabled); set_slave_enabled(rpl_semi_sync_slave_enabled);
...@@ -134,9 +134,9 @@ void Repl_semi_sync_slave::kill_connection(MYSQL *mysql) ...@@ -134,9 +134,9 @@ void Repl_semi_sync_slave::kill_connection(MYSQL *mysql)
char kill_buffer[30]; char kill_buffer[30];
MYSQL *kill_mysql = NULL; MYSQL *kill_mysql = NULL;
kill_mysql = mysql_init(kill_mysql); kill_mysql = mysql_init(kill_mysql);
mysql_options(kill_mysql, MYSQL_OPT_CONNECT_TIMEOUT, &kill_conn_timeout_); mysql_options(kill_mysql, MYSQL_OPT_CONNECT_TIMEOUT, &m_kill_conn_timeout);
mysql_options(kill_mysql, MYSQL_OPT_READ_TIMEOUT, &kill_conn_timeout_); mysql_options(kill_mysql, MYSQL_OPT_READ_TIMEOUT, &m_kill_conn_timeout);
mysql_options(kill_mysql, MYSQL_OPT_WRITE_TIMEOUT, &kill_conn_timeout_); mysql_options(kill_mysql, MYSQL_OPT_WRITE_TIMEOUT, &m_kill_conn_timeout);
bool ret= (!mysql_real_connect(kill_mysql, mysql->host, bool ret= (!mysql_real_connect(kill_mysql, mysql->host,
mysql->user, mysql->passwd,0, mysql->port, mysql->unix_socket, 0)); mysql->user, mysql->passwd,0, mysql->port, mysql->unix_socket, 0));
......
...@@ -32,11 +32,11 @@ class Master_info; ...@@ -32,11 +32,11 @@ class Master_info;
class Repl_semi_sync_slave class Repl_semi_sync_slave
:public Repl_semi_sync_base { :public Repl_semi_sync_base {
public: public:
Repl_semi_sync_slave() :slave_enabled_(false) {} Repl_semi_sync_slave() :m_slave_enabled(false) {}
~Repl_semi_sync_slave() {} ~Repl_semi_sync_slave() {}
void set_trace_level(unsigned long trace_level) { void set_trace_level(unsigned long trace_level) {
trace_level_ = trace_level; m_trace_level = trace_level;
} }
/* Initialize this class after MySQL parameters are initialized. this /* Initialize this class after MySQL parameters are initialized. this
...@@ -45,23 +45,23 @@ class Repl_semi_sync_slave ...@@ -45,23 +45,23 @@ class Repl_semi_sync_slave
int init_object(); int init_object();
bool get_slave_enabled() { bool get_slave_enabled() {
return slave_enabled_; return m_slave_enabled;
} }
void set_slave_enabled(bool enabled) { void set_slave_enabled(bool enabled) {
slave_enabled_ = enabled; m_slave_enabled = enabled;
} }
bool is_delay_master(){ bool is_delay_master(){
return delay_master_; return m_delay_master;
} }
void set_delay_master(bool enabled) { void set_delay_master(bool enabled) {
delay_master_ = enabled; m_delay_master = enabled;
} }
void set_kill_conn_timeout(unsigned int timeout) { void set_kill_conn_timeout(unsigned int timeout) {
kill_conn_timeout_ = timeout; m_kill_conn_timeout = timeout;
} }
/* A slave reads the semi-sync packet header and separate the metadata /* A slave reads the semi-sync packet header and separate the metadata
...@@ -95,10 +95,10 @@ class Repl_semi_sync_slave ...@@ -95,10 +95,10 @@ class Repl_semi_sync_slave
private: private:
/* True when init_object has been called */ /* True when init_object has been called */
bool init_done_; bool m_init_done;
bool slave_enabled_; /* semi-sycn is enabled on the slave */ bool m_slave_enabled; /* semi-sycn is enabled on the slave */
bool delay_master_; bool m_delay_master;
unsigned int kill_conn_timeout_; unsigned int m_kill_conn_timeout;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment