Commit 943989c9 authored by Angelique's avatar Angelique

MDEV-29943: Check gtid_slave_pos and use sync_with_master_gtid (and remove superfluous semicolons)

parent 88c35781
...@@ -68,6 +68,7 @@ connection server_3; ...@@ -68,6 +68,7 @@ connection server_3;
select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1; select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
domain_id seq_no domain_id seq_no
0 12 0 12
# slave gtid state is 0-1-12
include/stop_slave.inc include/stop_slave.inc
set global slave_parallel_threads = 0;; set global slave_parallel_threads = 0;;
set global slave_parallel_mode = optimistic;; set global slave_parallel_mode = optimistic;;
......
...@@ -15,12 +15,12 @@ set global binlog_alter_two_phase=true; ...@@ -15,12 +15,12 @@ set global binlog_alter_two_phase=true;
create table t1( a int primary key, b int) engine=myisam; create table t1( a int primary key, b int) engine=myisam;
create table t2( a int primary key, b int) engine=myisam; create table t2( a int primary key, b int) engine=myisam;
connect con1,localhost,root,,; connect con1,localhost,root,,;
alter table t1 add column c int;; alter table t1 add column c int;
connection master; connection master;
# Get into binlog first and wait # Get into binlog first and wait
# master gtid state is 0-1-3 # master gtid state is 0-1-3
connect con2,localhost,root,,; connect con2,localhost,root,,;
alter table t2 add column c int;; alter table t2 add column c int;
connection master; connection master;
# Get into binlog next and wait as well # Get into binlog next and wait as well
# master gtid state is 0-1-4 # master gtid state is 0-1-4
...@@ -53,7 +53,7 @@ master-bin.000001 # Query 1 # use `test`; create table t3( a int primary key, b ...@@ -53,7 +53,7 @@ master-bin.000001 # Query 1 # use `test`; create table t3( a int primary key, b
connection slave; connection slave;
include/sync_with_master_gtid.inc include/sync_with_master_gtid.inc
connect extra_slave,127.0.0.1,root,,test,$SLAVE_MYPORT; connect extra_slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
stop slave;; stop slave;
connection slave; connection slave;
connection extra_slave; connection extra_slave;
SET GLOBAL debug_dbug= @old_debug_slave; SET GLOBAL debug_dbug= @old_debug_slave;
...@@ -78,8 +78,7 @@ select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1; ...@@ -78,8 +78,7 @@ select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
domain_id seq_no domain_id seq_no
0 5 0 5
include/start_slave.inc include/start_slave.inc
connection master; include/sync_with_master_gtid.inc
connection slave;
# Everything from the master binlog must have been applied now: # Everything from the master binlog must have been applied now:
select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1; select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
domain_id seq_no domain_id seq_no
...@@ -111,9 +110,9 @@ SET GLOBAL debug_dbug= @old_debug_master; ...@@ -111,9 +110,9 @@ SET GLOBAL debug_dbug= @old_debug_master;
set DEBUG_SYNC= 'RESET'; set DEBUG_SYNC= 'RESET';
connection slave; connection slave;
stop slave; stop slave;
set global slave_parallel_threads = 0;; set global slave_parallel_threads = 0;
set global slave_parallel_mode = optimistic;; set global slave_parallel_mode = optimistic;
set global gtid_strict_mode = 0;; set global gtid_strict_mode = 0;
set DEBUG_SYNC= 'RESET'; set DEBUG_SYNC= 'RESET';
start slave; start slave;
include/rpl_end.inc include/rpl_end.inc
...@@ -41,6 +41,8 @@ select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1; ...@@ -41,6 +41,8 @@ select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
--connection server_3 --connection server_3
select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1; select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
--let $slave_gtid_state = `select @@gtid_binlog_state`
--echo # slave gtid state is $slave_gtid_state
--source include/stop_slave.inc --source include/stop_slave.inc
--eval set global slave_parallel_threads = $slave_parallel_threads; --eval set global slave_parallel_threads = $slave_parallel_threads;
--eval set global slave_parallel_mode = $slave_parallel_mode; --eval set global slave_parallel_mode = $slave_parallel_mode;
......
...@@ -33,7 +33,7 @@ create table t1( a int primary key, b int) engine=myisam; ...@@ -33,7 +33,7 @@ create table t1( a int primary key, b int) engine=myisam;
create table t2( a int primary key, b int) engine=myisam; create table t2( a int primary key, b int) engine=myisam;
--connect (con1,localhost,root,,) --connect (con1,localhost,root,,)
--send alter table t1 add column c int; --send alter table t1 add column c int
--connection master --connection master
--echo # Get into binlog first and wait --echo # Get into binlog first and wait
...@@ -43,7 +43,7 @@ create table t2( a int primary key, b int) engine=myisam; ...@@ -43,7 +43,7 @@ create table t2( a int primary key, b int) engine=myisam;
--echo # master gtid state is $master_gtid_state --echo # master gtid state is $master_gtid_state
--connect (con2,localhost,root,,) --connect (con2,localhost,root,,)
--send alter table t2 add column c int; --send alter table t2 add column c int
--connection master --connection master
--echo # Get into binlog next and wait as well --echo # Get into binlog next and wait as well
...@@ -75,7 +75,7 @@ create table t3( a int primary key, b int) engine=innodb; ...@@ -75,7 +75,7 @@ create table t3( a int primary key, b int) engine=innodb;
--source include/sync_with_master_gtid.inc --source include/sync_with_master_gtid.inc
# set debug_sync="now wait_for CA_1_processing"; # set debug_sync="now wait_for CA_1_processing";
connect(extra_slave,127.0.0.1,root,,test,$SLAVE_MYPORT); connect(extra_slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
--send stop slave; --send stop slave
--connection slave --connection slave
# set debug_sync="now signal proceed_CA_1"; # set debug_sync="now signal proceed_CA_1";
--connection extra_slave --connection extra_slave
...@@ -90,8 +90,7 @@ SET GLOBAL debug_dbug= @old_debug_slave; ...@@ -90,8 +90,7 @@ SET GLOBAL debug_dbug= @old_debug_slave;
select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1; select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
--source include/start_slave.inc --source include/start_slave.inc
--connection master --source include/sync_with_master_gtid.inc
--sync_slave_with_master
--echo # Everything from the master binlog must have been applied now: --echo # Everything from the master binlog must have been applied now:
select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1; select domain_id, seq_no from mysql.gtid_slave_pos order by seq_no desc limit 1;
--let $slave_gtid_state = `select @@gtid_binlog_state` --let $slave_gtid_state = `select @@gtid_binlog_state`
...@@ -113,9 +112,9 @@ set DEBUG_SYNC= 'RESET'; ...@@ -113,9 +112,9 @@ set DEBUG_SYNC= 'RESET';
--sync_slave_with_master --sync_slave_with_master
stop slave; stop slave;
--eval set global slave_parallel_threads = $slave_parallel_threads; --eval set global slave_parallel_threads = $slave_parallel_threads
--eval set global slave_parallel_mode = $slave_parallel_mode; --eval set global slave_parallel_mode = $slave_parallel_mode
--eval set global gtid_strict_mode = $gtid_strict_mode; --eval set global gtid_strict_mode = $gtid_strict_mode
set DEBUG_SYNC= 'RESET'; set DEBUG_SYNC= 'RESET';
start slave; start slave;
--source include/rpl_end.inc --source include/rpl_end.inc
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