mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-26: Global transaction ID.
Change of user interface to be more logical and more in line with expectations to work similar to old-style replication. User can now explicitly choose in CHANGE MASTER whether binlog position is taken into account (master_gtid_pos=current_pos) or not (master_gtid_pos= slave_pos) when slave connects to master. @@gtid_pos is replaced by three separate variables @@gtid_slave_pos (can be set by user, replicated GTIDs only), @@gtid_binlog_pos (read only), and @@gtid_current_pos (a combination of the two, most recent GTID within each domain). mysql.rpl_slave_state is renamed to mysql.gtid_slave_pos to match. This fixes MDEV-4474.
This commit is contained in:
@@ -37,7 +37,8 @@ Master_info::Master_info(LEX_STRING *connection_name_arg,
|
||||
checksum_alg_before_fd(BINLOG_CHECKSUM_ALG_UNDEF),
|
||||
connect_retry(DEFAULT_CONNECT_RETRY), inited(0), abort_slave(0),
|
||||
slave_running(0), slave_run_id(0), sync_counter(0),
|
||||
heartbeat_period(0), received_heartbeats(0), master_id(0), using_gtid(0)
|
||||
heartbeat_period(0), received_heartbeats(0), master_id(0),
|
||||
using_gtid(USE_GTID_NO)
|
||||
{
|
||||
host[0] = 0; user[0] = 0; password[0] = 0;
|
||||
ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0;
|
||||
@@ -152,7 +153,7 @@ void init_master_log_pos(Master_info* mi)
|
||||
|
||||
mi->master_log_name[0] = 0;
|
||||
mi->master_log_pos = BIN_LOG_HEADER_SIZE; // skip magic number
|
||||
mi->using_gtid= false;
|
||||
mi->using_gtid= Master_info::USE_GTID_NO;
|
||||
|
||||
/* Intentionally init ssl_verify_server_cert to 0, no option available */
|
||||
mi->ssl_verify_server_cert= 0;
|
||||
@@ -447,7 +448,15 @@ file '%s')", fname);
|
||||
while (!init_strvar_from_file(buf, sizeof(buf), &mi->file, 0))
|
||||
{
|
||||
if (0 == strncmp(buf, STRING_WITH_LEN("using_gtid=")))
|
||||
mi->using_gtid= (0 != atoi(buf + sizeof("using_gtid")));
|
||||
{
|
||||
int val= atoi(buf + sizeof("using_gtid"));
|
||||
if (val == Master_info::USE_GTID_CURRENT_POS)
|
||||
mi->using_gtid= Master_info::USE_GTID_CURRENT_POS;
|
||||
else if (val == Master_info::USE_GTID_SLAVE_POS)
|
||||
mi->using_gtid= Master_info::USE_GTID_SLAVE_POS;
|
||||
else
|
||||
mi->using_gtid= Master_info::USE_GTID_NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user