Commit 64314d30 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-30929 spider.spider_fixes_part: wait and restart slave

In the absence of insight of the cause of spider.spider_fixes_part
failure as described in MDEV-30929, This is a workaround, which could
help narrow the possibility down to whether slave SQL thread attempts
to read from file that maybe not yet on disk. It does not otherwise
affect the coverage of the test.

I have pushed this commit 4 times, but have yet to encounter the
failure as described in MDEV-30929, so it could also fix the test and
stop the CI pollution.

Also replaced START SLAVE; with --source include/start_slave.inc
inside the slave_test_init.inc files.
parent 3ee6f69d
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
drop and create databases
connection master_1;
......
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
drop and create databases
connection master_1;
......
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
drop and create databases
connection master_1;
......
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
drop and create databases
connection master_1;
......
......@@ -19,7 +19,7 @@ if (!$SLAVE1_1_SLAVE_STATUS)
MASTER_PORT = $MASTER_1_MYPORT
;
}
START SLAVE;
--source include/start_slave.inc
--connection master_1
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--connection slave1_1
......
......@@ -5,6 +5,7 @@ child2_2
child2_3
for child3
for slave1_1
include/start_slave.inc
connection slave1_1;
connection master_1;
set @old_binlog_format= @@binlog_format;
......
......@@ -5,6 +5,7 @@ child2_2
child2_3
for child3
for slave1_1
include/start_slave.inc
connection slave1_1;
connection master_1;
set @old_binlog_format= @@binlog_format;
......
......@@ -5,6 +5,7 @@ child2_2
child2_3
for child3
for slave1_1
include/start_slave.inc
connection slave1_1;
connection master_1;
set @old_binlog_format= @@binlog_format;
......
......@@ -5,6 +5,7 @@ child2_2
child2_3
for child3
for slave1_1
include/start_slave.inc
connection slave1_1;
SHOW VARIABLES LIKE 'slave_transaction_retry_errors';
......
......@@ -5,6 +5,7 @@ child2_2
child2_3
for child3
for slave1_1
include/start_slave.inc
connection slave1_1;
set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation;
set global spider_slave_trx_isolation= 1;
......
......@@ -5,6 +5,7 @@ child2_2
child2_3
for child3
for slave1_1
include/start_slave.inc
connection slave1_1;
SHOW VARIABLES LIKE 'slave_transaction_retry_errors';
......
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
connection slave1_1;
set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation;
set global spider_slave_trx_isolation= 1;
......
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
drop and create databases
connection master_1;
......
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
drop and create databases
connection master_1;
......
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
drop and create databases
connection master_1;
......
......@@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc
drop and create databases
connection master_1;
......@@ -109,6 +110,7 @@ a b c
2.26
auto_increment with partition
connection master_1;
include/save_master_pos.inc
connection slave1_1;
connection master_1;
DROP TABLE IF EXISTS t1;
......
......@@ -19,7 +19,7 @@ if (!$SLAVE1_1_SLAVE_STATUS)
MASTER_PORT = $MASTER_1_MYPORT
;
}
START SLAVE;
--source include/start_slave.inc
--connection master_1
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--connection slave1_1
......
......@@ -488,7 +488,23 @@ if ($HAVE_PARTITION)
if ($USE_REPLICATION)
{
save_master_pos;
--source include/save_master_pos.inc
--connection slave1_1
--let $rc= `select master_pos_wait('$_master_file', $_master_pos, 300, '')`
if (`select $rc is NULL OR $rc < 0`)
{
--vertical_results
show slave status;
--horizontal_results
show global status;
show global variables;
--let $MYSQLD_DATADIR= `select @@datadir`
--exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/mysqld-relay-bin.000001;
# Check that the relay-log file is fully on disk.
--exec ls -l $MYSQLD_DATADIR;
# After that try to restart the slave SQL thread
start slave sql_thread;
}
sync_with_master;
--connection master_1
--disable_query_log
......
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