Skip to content

Commit

Permalink
MDEV-30929 spider.spider_fixes_part: wait and restart slave
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mariadb-YuchenPei committed May 6, 2024
1 parent 3ee6f69 commit 64314d3
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc

drop and create databases
connection master_1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc

drop and create databases
connection master_1;
Expand Down
1 change: 1 addition & 0 deletions storage/spider/mysql-test/spider/bg/r/spider_fixes.result
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc

drop and create databases
connection master_1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc

drop and create databases
connection master_1;
Expand Down
2 changes: 1 addition & 1 deletion storage/spider/mysql-test/spider/bg/t/slave_test_init.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions storage/spider/mysql-test/spider/r/spider3_fixes.result
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc

drop and create databases
connection master_1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc

drop and create databases
connection master_1;
Expand Down
1 change: 1 addition & 0 deletions storage/spider/mysql-test/spider/r/spider_fixes.result
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc

drop and create databases
connection master_1;
Expand Down
2 changes: 2 additions & 0 deletions storage/spider/mysql-test/spider/r/spider_fixes_part.result
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ child3_1
child3_2
child3_3
for slave1_1
include/start_slave.inc

drop and create databases
connection master_1;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion storage/spider/mysql-test/spider/t/slave_test_init.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions storage/spider/mysql-test/spider/t/spider_fixes_part.opt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--log-warnings=3
16 changes: 16 additions & 0 deletions storage/spider/mysql-test/spider/t/spider_fixes_part.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 64314d3

Please sign in to comment.