summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
blob: 0ed936d0267ddc32250de9b8b28e5817f0628723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
--source include/have_innodb.inc
--source include/have_debug.inc
# Valgrind does not work well with test that crashes the server
--source include/not_valgrind.inc
--source include/master-slave.inc

connection master;

call mtr.add_suppression("mysqld: Table './mysql/gtid_slave_pos' is marked as crashed and should be repaired");
call mtr.add_suppression("Checking table:   './mysql/gtid_slave_pos'");
call mtr.add_suppression("mysql.gtid_slave_pos: 1 client is using or hasn't closed the table properly");

SET @@session.gtid_domain_id= 0;

create table ti (a int auto_increment primary key) engine=innodb;
create table tm (a int auto_increment primary key) engine=myisam;

insert into ti set a=null;
insert into tm set a=null;

save_master_pos;

connection slave;
sync_with_master;
--source include/stop_slave.inc

select * from ti;
select * from tm;

connection master;
SET @@session.gtid_domain_id= 1;

begin;
insert into ti set a=null;
insert into tm set a=null;
commit;

SET @@session.gtid_domain_id= 0;
insert into ti set a=null;
insert into tm set a=null;

set @@global.debug_dbug="+d,crash_before_send_xid";
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect

connection slave;
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
--echo DO_DOMAIN_IDS (BEFORE)     : $do_domain_ids_before
--echo IGNORE_DOMAIN_IDS (BEFORE) : $ignore_domain_ids_before

# IGNORE_DOMAIN_IDS=(1)
CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
--source include/start_slave.inc

let $do_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
--echo DO_DOMAIN_IDS (AFTER)     : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after

connection master;
--source include/wait_until_disconnected.inc
--enable_reconnect
--let $rpl_server_number=1
--source include/rpl_start_server.inc
#--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--echo # Master has restarted successfully
set @@global.debug_dbug="-d";
save_master_pos;

--connection slave
--source include/stop_slave.inc
--source include/start_slave.inc
sync_with_master;
select * from ti;
select * from tm;

# Cleanup
--connection master
drop table ti;
drop table tm;
sync_slave_with_master;

--connection slave
--source include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO;
--source include/start_slave.inc

--source include/rpl_end.inc