Skip to content
Permalink
Browse files
MDEV-13073. This part converts the Ali patch`s identifiers to the Mar…
…iaDB standard. Also some renaming is done as well as white spaces removal.
  • Loading branch information
andrelkin authored and montywi committed Dec 18, 2017
1 parent 6a84e34 commit f279d3c
Show file tree
Hide file tree
Showing 17 changed files with 347 additions and 338 deletions.
@@ -5,7 +5,7 @@ CALL mtr.add_suppression("Failed to register slave to semi-sync ACK receiver thr
CALL mtr.add_suppression("Failed to stop ack receiver thread on pthread_join.*");
CALL mtr.add_suppression("Got an error reading communication packets:*");
CALL mtr.add_suppression("Timeout waiting for reply of binlog*");
CALL mtr.add_suppression("slaveReadSyncHeader*");
CALL mtr.add_suppression("slave_read_sync_header*");
CALL mtr.add_suppression("Missing magic number for semi-sync*");
CALL mtr.add_suppression("Got timeout reading communication packets*");
CALL mtr.add_suppression("Failed to call*");
@@ -7,7 +7,7 @@ CALL mtr.add_suppression("Failed to register slave to semi-sync ACK receiver thr
CALL mtr.add_suppression("Failed to stop ack receiver thread on pthread_join.*");
CALL mtr.add_suppression("Got an error reading communication packets:*");
CALL mtr.add_suppression("Timeout waiting for reply of binlog*");
CALL mtr.add_suppression("slaveReadSyncHeader*");
CALL mtr.add_suppression("slave_read_sync_header*");
CALL mtr.add_suppression("Missing magic number for semi-sync*");
CALL mtr.add_suppression("Got timeout reading communication packets*");
CALL mtr.add_suppression("Failed to call*");
@@ -1486,7 +1486,7 @@ int ha_commit_trans(THD *thd, bool all)
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
#ifdef HAVE_REPLICATION
repl_semisync_master.waitAfterCommit(thd, all);
repl_semisync_master.wait_after_commit(thd, all);
DEBUG_SYNC(thd, "after_group_after_commit");
#endif
goto end;
@@ -1734,7 +1734,7 @@ int ha_rollback_trans(THD *thd, bool all)
ER_WARNING_NOT_COMPLETE_ROLLBACK,
ER_THD(thd, ER_WARNING_NOT_COMPLETE_ROLLBACK));
#ifdef HAVE_REPLICATION
repl_semisync_master.waitAfterRollback(thd, all);
repl_semisync_master.wait_after_rollback(thd, all);
#endif
DBUG_RETURN(error);
}
@@ -6376,8 +6376,8 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
mysql_mutex_assert_not_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
#ifdef HAVE_REPLICATION
if (repl_semisync_master.reportBinlogUpdate(thd, log_file_name,
file->pos_in_file))
if (repl_semisync_master.report_binlog_update(thd, log_file_name,
file->pos_in_file))
{
sql_print_error("Failed to run 'after_flush' hooks");
error= 1;
@@ -6409,8 +6409,8 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
mysql_mutex_assert_owner(&LOCK_after_binlog_sync);
mysql_mutex_assert_not_owner(&LOCK_commit_ordered);
#ifdef HAVE_REPLICATION
if (repl_semisync_master.waitAfterSync(log_file_name,
file->pos_in_file))
if (repl_semisync_master.wait_after_sync(log_file_name,
file->pos_in_file))
{
error=1;
/* error is already printed inside hook */
@@ -7847,10 +7847,10 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
#ifdef HAVE_REPLICATION
if (!current->error &&
repl_semisync_master.
reportBinlogUpdate(current->thd,
current->cache_mngr->last_commit_pos_file,
current->cache_mngr->
last_commit_pos_offset))
report_binlog_update(current->thd,
current->cache_mngr->last_commit_pos_file,
current->cache_mngr->
last_commit_pos_offset))
{
current->error= ER_ERROR_ON_WRITE;
current->commit_errno= -1;
@@ -7935,10 +7935,10 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
#ifdef HAVE_REPLICATION
if (!current->error)
current->error=
repl_semisync_master.waitAfterSync(current->cache_mngr->
last_commit_pos_file,
current->cache_mngr->
last_commit_pos_offset);
repl_semisync_master.wait_after_sync(current->cache_mngr->
last_commit_pos_file,
current->cache_mngr->
last_commit_pos_offset);
#endif
first= false;
}
@@ -947,8 +947,7 @@ PSI_mutex_key key_LOCK_after_binlog_sync;
PSI_mutex_key key_LOCK_prepare_ordered, key_LOCK_commit_ordered,
key_LOCK_slave_background;
PSI_mutex_key key_TABLE_SHARE_LOCK_share;
PSI_mutex_key key_ss_mutex_LOCK_binlog_;
PSI_mutex_key key_ss_mutex_Ack_receiver_mutex;
PSI_mutex_key key_LOCK_ack_receiver;

static PSI_mutex_info all_server_mutexes[]=
{
@@ -1027,7 +1026,7 @@ static PSI_mutex_info all_server_mutexes[]=
{ &key_LOCK_rpl_thread, "LOCK_rpl_thread", 0},
{ &key_LOCK_rpl_thread_pool, "LOCK_rpl_thread_pool", 0},
{ &key_LOCK_parallel_entry, "LOCK_parallel_entry", 0},
{ &key_ss_mutex_Ack_receiver_mutex, "Ack_receiver::m_mutex", 0},
{ &key_LOCK_ack_receiver, "Ack_receiver::mutex", 0},
{ &key_LOCK_binlog, "LOCK_binlog", 0}
};

@@ -1082,7 +1081,7 @@ PSI_cond_key key_COND_rpl_thread_queue, key_COND_rpl_thread,
key_COND_parallel_entry, key_COND_group_commit_orderer,
key_COND_prepare_ordered, key_COND_slave_background;
PSI_cond_key key_COND_wait_gtid, key_COND_gtid_ignore_duplicates;
PSI_cond_key key_ss_cond_Ack_receiver_cond;
PSI_cond_key key_COND_ack_receiver;

static PSI_cond_info all_server_conds[]=
{
@@ -1136,15 +1135,15 @@ static PSI_cond_info all_server_conds[]=
{ &key_COND_start_thread, "COND_start_thread", PSI_FLAG_GLOBAL},
{ &key_COND_wait_gtid, "COND_wait_gtid", 0},
{ &key_COND_gtid_ignore_duplicates, "COND_gtid_ignore_duplicates", 0},
{ &key_ss_cond_Ack_receiver_cond, "Ack_receiver::m_cond", 0},
{ &key_COND_ack_receiver, "Ack_receiver::cond", 0},
{ &key_COND_binlog_send, "COND_binlog_send", 0}
};

PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert,
key_thread_handle_manager, key_thread_main,
key_thread_one_connection, key_thread_signal_hand,
key_thread_slave_background, key_rpl_parallel_thread;
PSI_thread_key key_ss_thread_Ack_receiver_thread;
PSI_thread_key key_thread_ack_receiver;

static PSI_thread_info all_server_threads[]=
{
@@ -1171,7 +1170,7 @@ static PSI_thread_info all_server_threads[]=
{ &key_thread_one_connection, "one_connection", 0},
{ &key_thread_signal_hand, "signal_handler", PSI_FLAG_GLOBAL},
{ &key_thread_slave_background, "slave_background", PSI_FLAG_GLOBAL},
{ &key_ss_thread_Ack_receiver_thread, "Ack_receiver", PSI_FLAG_GLOBAL},
{ &key_thread_ack_receiver, "Ack_receiver", PSI_FLAG_GLOBAL},
{ &key_rpl_parallel_thread, "rpl_parallel_thread", 0}
};

@@ -5184,8 +5183,8 @@ static int init_server_components()
"--log-bin option is not defined.");
}

if (repl_semisync_master.initObject() ||
repl_semisync_slave.initObject())
if (repl_semisync_master.init_object() ||
repl_semisync_slave.init_object())
{
sql_print_error("Could not initialize semisync.");
unireg_abort(1);
@@ -8256,7 +8255,7 @@ static int show_ssl_get_cipher_list(THD *thd, SHOW_VAR *var, char *buff,
#define DEF_SHOW_FUNC(name, show_type) \
static int SHOW_FNAME(name)(MYSQL_THD thd, SHOW_VAR *var, char *buff) \
{ \
repl_semisync_master.setExportStats(); \
repl_semisync_master.set_export_stats(); \
var->type= show_type; \
var->value= (char *)&rpl_semi_sync_master_##name; \
return 0; \
@@ -19,14 +19,14 @@
#include <my_global.h>
#include "semisync.h"

const unsigned char ReplSemiSyncBase::kPacketMagicNum = 0xef;
const unsigned char ReplSemiSyncBase::kPacketFlagSync = 0x01;
const unsigned char Repl_semi_sync_base::k_packet_magic_num= 0xef;
const unsigned char Repl_semi_sync_base::k_packet_flag_sync= 0x01;


const unsigned long Trace::kTraceGeneral = 0x0001;
const unsigned long Trace::kTraceDetail = 0x0010;
const unsigned long Trace::kTraceNetWait = 0x0020;
const unsigned long Trace::kTraceFunction = 0x0040;
const unsigned long Trace::k_trace_general= 0x0001;
const unsigned long Trace::k_trace_detail= 0x0010;
const unsigned long Trace::k_trace_net_wait= 0x0020;
const unsigned long Trace::k_trace_function= 0x0040;

const unsigned char ReplSemiSyncBase::kSyncHeader[2] =
{ReplSemiSyncBase::kPacketMagicNum, 0};
const unsigned char Repl_semi_sync_base::k_sync_header[2]=
{Repl_semi_sync_base::k_packet_magic_num, 0};
@@ -28,10 +28,10 @@
*/
class Trace {
public:
static const unsigned long kTraceFunction;
static const unsigned long kTraceGeneral;
static const unsigned long kTraceDetail;
static const unsigned long kTraceNetWait;
static const unsigned long k_trace_function;
static const unsigned long k_trace_general;
static const unsigned long k_trace_detail;
static const unsigned long k_trace_net_wait;

unsigned long trace_level_; /* the level for tracing */

@@ -46,14 +46,14 @@ class Trace {
/**
Base class for semi-sync master and slave classes
*/
class ReplSemiSyncBase
class Repl_semi_sync_base
:public Trace {
public:
static const unsigned char kSyncHeader[2]; /* three byte packet header */
static const unsigned char k_sync_header[2]; /* three byte packet header */

/* Constants in network packet header. */
static const unsigned char kPacketMagicNum;
static const unsigned char kPacketFlagSync;
static const unsigned char k_packet_magic_num;
static const unsigned char k_packet_flag_sync;
};

/* The layout of a semisync slave reply packet:

0 comments on commit f279d3c

Please sign in to comment.