MDEV-35098 rpl.rpl_mysqldump_gtid_slave_pos fails in buildbot

The test turns out to be senstive to @@global.gtid_cleanup_batch_size.
With a rather small default value of the latter
SELECTing from mysql.gtid_slave_pos may not be deterministic: tests
that run before may increase a pending for automitic deletion batch.

The test is refined to set its own value for the batch size which
is virtually unreachable.

Thanks to Kristian Nielsen for the analysis.
This commit is contained in:
Andrei Elkin 2024-12-16 19:34:09 +02:00
parent aa49770d79
commit bc6121819c
2 changed files with 12 additions and 0 deletions

View file

@ -32,6 +32,7 @@ insert into t1 set a = 2;
insert into t1 set a = 1;
include/save_master_gtid.inc
connection slave;
SET @@global.gtid_cleanup_batch_size = $val;
include/start_slave.inc
include/sync_with_master_gtid.inc
select * from mysql.gtid_slave_pos;
@ -55,6 +56,7 @@ set statement sql_log_bin=0 for delete from mysql.gtid_slave_pos;
insert into mysql.gtid_slave_pos values (99 + 2, 1, 1, 1);
# 5.
include/rpl_restart_server.inc [server_number=2]
SET @@global.gtid_cleanup_batch_size = $val;
select * from mysql.gtid_slave_pos;
domain_id sub_id server_id seq_no
101 1 1 1
@ -99,6 +101,7 @@ set statement sql_log_bin=0 for delete from mysql.gtid_slave_pos;
insert into mysql.gtid_slave_pos values (99 + 1, 1, 1, 1);
# 5.
include/rpl_restart_server.inc [server_number=2]
SET @@global.gtid_cleanup_batch_size = $val;
select * from mysql.gtid_slave_pos;
domain_id sub_id server_id seq_no
100 1 1 1
@ -145,5 +148,6 @@ connection master;
DROP TABLE t1;
include/save_master_gtid.inc
connection slave;
SET @@global.gtid_cleanup_batch_size= $old_gtid_cleanup_batch_size;
include/sync_with_master_gtid.inc
include/rpl_end.inc

View file

@ -47,6 +47,12 @@ while ($i)
--source include/save_master_gtid.inc
--connection slave
# enforce determistic SELECT * from mysql.gtid_slave_pos
--let $old_gtid_cleanup_batch_size = `select @@GLOBAL.gtid_cleanup_batch_size`
# the number of generated transactions on master must not exceed this value:
--let $val= 2147483647
--evalp SET @@global.gtid_cleanup_batch_size = $val
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
# Prior tests in a mtr batch could leave the min value of sub_id column with
@ -85,6 +91,7 @@ while ($i)
--echo # 5.
--let $rpl_server_number= 2
--source include/rpl_restart_server.inc
--evalp SET @@global.gtid_cleanup_batch_size = $val
select * from mysql.gtid_slave_pos;
select @@global.gtid_slave_pos as "before dump restore";
--let $dump=dump_$i.sql
@ -130,6 +137,7 @@ DROP TABLE t1;
--source include/save_master_gtid.inc
--connection slave
--evalp SET @@global.gtid_cleanup_batch_size= $old_gtid_cleanup_batch_size
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp dump_*.sql
--source include/sync_with_master_gtid.inc