Debian Codegraph @

mysql-test/suite/rpl/t/rpl_alter_online_debug.test

raw
1 source include/have_debug_sync.inc;
2 source include/have_innodb.inc;
3 source include/master-slave.inc;
4
5 --connection master
6 call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
7
8 --connection slave
9 call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
10
11 #
12 # Single-phase alter
13 #
14
15 --echo # MDEV-31804 Assertion `thd->m_transaction_psi == __null' fails upon
16 --echo # replicating online ALTER
17 --connection master
18 create table t (a char(8)) engine=myisam;
19 insert into t values ('foo'),('bar');
20
21 set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter';
22 set @old_slave_exec_mode= @@global.slave_exec_mode;
23 set @@global.slave_exec_mode= idempotent;
24 send alter table t force;
25
26 --connection master1
27 set debug_sync= 'now wait_for go_dml';
28 insert into t (a) values ('qux');
29 set debug_sync= 'now signal go_alter';
30
31 --connection master
32 --reap
33 --sync_slave_with_master
34
35 # Cleanup
36 --connection master
37 drop table t;
38 set global slave_exec_mode= @old_slave_exec_mode;
39 set debug_sync= reset;
40
41
42 --echo #
43 --echo # End of 11.2 tests (Single-phase alter)
44 --echo #
45
46
47 #
48 # Two-phase alter
49 #
50 --connection slave
51 source include/stop_slave.inc;
52 --let $slave_parallel_threads=`select @@global.slave_parallel_threads`
53 --let $slave_parallel_mode= `select @@global.slave_parallel_mode`
54 --let $binlog_row_image= `select @@global.binlog_row_image`
55 set global slave_parallel_threads=3;
56 set global slave_parallel_mode= optimistic;
57 set global binlog_row_image=MINIMAL;
58 --connection master
59
60
61 --echo #
62 --echo # MDEV-31755 Replica's DML event deadlocks wit online alter table
63 --echo #
64 --echo # Three threads for SA,U,CA
65
66 create table t (id int, a int, primary key (id)) engine=innodb;
67 insert into t values (1,10), (2,20);
68
69 set @@session.binlog_alter_two_phase=1;
70 set debug_sync= 'alter_table_online_downgraded signal ready wait_for go';
71 send alter table t add c text default('qqq') after id, algorithm=copy, lock=none;
72
73 --connection master1
74 set debug_sync= 'now wait_for ready';
75
76 update t set a = 1;
77
78 set debug_sync= 'now signal go';
79
80 --connection master
81 --reap
82 --source include/save_master_gtid.inc
83
84 --connection slave
85 source include/start_slave.inc;
86 --source include/sync_with_master_gtid.inc
87 select * from t;
88
89 # Cleanup
90 --connection master
91 drop table t;
92
93 --echo # MDEV-31838 Assertion fails on replica upon parallel
94 --echo # replication with two-phase alter and MINIMAL row image
95 create table t (id int, a int, primary key(id)) engine=aria;
96 insert into t values (1,0);
97
98 set @@session.binlog_alter_two_phase=1;
99 set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter';
100 send alter table t force, algorithm=copy, lock=none;
101
102 --connection master1
103 set binlog_row_image=MINIMAL;
104 set debug_sync= 'now wait_for go_dml';
105 --disable_warnings
106 update ignore t set a = 1;
107 --enable_warnings
108 set debug_sync= 'now signal go_alter';
109
110 # Cleanup
111 --connection master
112 --reap
113 drop table t;
114 --sync_slave_with_master
115 --connection master
116
117 --echo #
118 --echo # End of 11.2 tests (Two-phase alter)
119 --echo #
120
121 --connection slave
122 source include/stop_slave.inc;
123 --eval set global binlog_row_image=$binlog_row_image
124 --eval set global slave_parallel_threads=$slave_parallel_threads
125 --eval set global slave_parallel_mode= $slave_parallel_mode
126 source include/start_slave.inc;
127
128 --source include/rpl_end.inc