Debian Codegraph @

mysql-test/suite/rpl/r/rpl_mts_pending_max.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 #
7 # 0) Set REPLICA_PENDING_JOBS_SIZE_MAX to a smaller number (1024)
8 # and replica_parallel_workers to 2 to make the test easy.
9 #
10 [connection slave]
11 SET @save.replica_pending_jobs_size_max= @@global.replica_pending_jobs_size_max;
12 SET @save.replica_parallel_workers= @@global.replica_parallel_workers;
13 SET @@GLOBAL.replica_pending_jobs_size_max= 1024;
14 SET @@GLOBAL.replica_parallel_workers= 2;
15 include/start_slave.inc
16 #
17 #
18 # 1) Create initial data required for the test
19 # (two databases (db1, db2) and two tables (db1.t and db2.t)).
20 #
21 [connection master]
22 CREATE DATABASE db1;
23 CREATE DATABASE db2;
24 CREATE TABLE db1.t (a TEXT) ENGINE=INNODB;
25 CREATE TABLE db2.t (a TEXT) ENGINE=INNODB;
26 include/sync_slave_sql_with_master.inc
27 #
28 # 2) Prove that Coordinator will make a big event (bigger in size than
29 # REPLICA_PENDING_JOBS_SIZE_MAX) wait for all workers to finish
30 # their work (empty their queue) before processing the big event.
31 #
32 #
33 # 1) On Slave, lock one table so that any operation on that
34 # will be waiting for the lock to be released.
35 #
36 [connection slave1]
37 LOCK TABLE db1.t WRITE;
38 #
39 # 2) Execute query that is going to wait for the table lock.
40 #
41 [connection master]
42 INSERT INTO db1.t VALUES ('small event');
43 #
44 # 3) Wait on Slave till a worker picks this event and wait for the
45 # lock (which is acquired in step 1)
46 #
47 [connection slave]
48 #
49 # 4) Now on Master, insert another query that reaches slave.
50 #
51 [connection master]
52 INSERT INTO db2.t VALUES (REPEAT('big event', 1024));
53 #
54 # 5) Check that Coordinator waits for the query (at step 2) to be
55 # executed before dedicating this new query (at step 4) to
56 # one of the workers because of the event size limits.
57 #
58 [connection slave]
59 include/assert.inc [Check that one of the applier worker thread is waiting for the table metadata lock.]
60 #
61 # 6) Release the lock acquired in step 1, so that first query will
62 # continue it's work and once it is done, second big event
63 # will also continue it's work.
64 #
65 [connection slave1]
66 UNLOCK TABLES;
67 #
68 # 7) check that slave is able to catch up with master after releasing the
69 # lock in step 6.
70 #
71 # 7.1) Sync SQL thread with Master.
72 #
73 [connection master]
74 include/sync_slave_sql_with_master.inc
75 #
76 # 7.2) Diff all the tables involved in the test to prove
77 # that replication worked fine.
78 #
79 include/diff_tables.inc [master:db1.t,slave:db1.t]
80 include/diff_tables.inc [master: db2.t,slave: db2.t]
81 #
82 # 3) When a big event is being processed by a worker,
83 # Coordinator will make smaller events to wait until the big event
84 # is executed completely.
85 #
86 #
87 #
88 # 1) On Slave, lock one table so that any operation on that
89 # will be waiting for the lock to be released.
90 #
91 [connection slave1]
92 LOCK TABLE db1.t WRITE;
93 #
94 # 2) Execute query that is going to wait for the table lock.
95 #
96 [connection master]
97 INSERT INTO db1.t VALUES (REPEAT('big event', 1024));
98 #
99 # 3) Wait on Slave till a worker picks this event and wait for the
100 # lock (which is acquired in step 1)
101 #
102 [connection slave]
103 #
104 # 4) Now on Master, insert another query that reaches slave.
105 #
106 [connection master]
107 INSERT INTO db2.t VALUES ('small event');
108 #
109 # 5) Check that Coordinator waits for the query (at step 2) to be
110 # executed before dedicating this new query (at step 4) to
111 # one of the workers because of the event size limits.
112 #
113 [connection slave]
114 include/assert.inc [Check that one of the applier worker thread is waiting for the table metadata lock.]
115 #
116 # 6) Release the lock acquired in step 1, so that first query will
117 # continue it's work and once it is done, second big event
118 # will also continue it's work.
119 #
120 [connection slave1]
121 UNLOCK TABLES;
122 #
123 # 7) check that slave is able to catch up with master after releasing the
124 # lock in step 6.
125 #
126 # 7.1) Sync SQL thread with Master.
127 #
128 [connection master]
129 include/sync_slave_sql_with_master.inc
130 #
131 # 7.2) Diff all the tables involved in the test to prove
132 # that replication worked fine.
133 #
134 include/diff_tables.inc [master:db1.t,slave:db1.t]
135 include/diff_tables.inc [master: db2.t,slave: db2.t]
136 #
137 # 4) When a big event is being processed by a worker,
138 # Coordinator will make another big event also to wait until the
139 # first big event is executed completely.
140 #
141 #
142 # 1) On Slave, lock one table so that any operation on that
143 # will be waiting for the lock to be released.
144 #
145 [connection slave1]
146 LOCK TABLE db1.t WRITE;
147 #
148 # 2) Execute query that is going to wait for the table lock.
149 #
150 [connection master]
151 INSERT INTO db1.t VALUES (REPEAT('big event', 1024));
152 #
153 # 3) Wait on Slave till a worker picks this event and wait for the
154 # lock (which is acquired in step 1)
155 #
156 [connection slave]
157 #
158 # 4) Now on Master, insert another query that reaches slave.
159 #
160 [connection master]
161 INSERT INTO db2.t VALUES (REPEAT('big event', 1024));
162 #
163 # 5) Check that Coordinator waits for the query (at step 2) to be
164 # executed before dedicating this new query (at step 4) to
165 # one of the workers because of the event size limits.
166 #
167 [connection slave]
168 include/assert.inc [Check that one of the applier worker thread is waiting for the table metadata lock.]
169 #
170 # 6) Release the lock acquired in step 1, so that first query will
171 # continue it's work and once it is done, second big event
172 # will also continue it's work.
173 #
174 [connection slave1]
175 UNLOCK TABLES;
176 #
177 # 7) check that slave is able to catch up with master after releasing the
178 # lock in step 6.
179 #
180 # 7.1) Sync SQL thread with Master.
181 #
182 [connection master]
183 include/sync_slave_sql_with_master.inc
184 #
185 # 7.2) Diff all the tables involved in the test to prove
186 # that replication worked fine.
187 #
188 include/diff_tables.inc [master:db1.t,slave:db1.t]
189 include/diff_tables.inc [master: db2.t,slave: db2.t]
190 #
191 # 5) Cleanup (drop tables/databases and reset the variables)
192 #
193 [connection master]
194 DROP DATABASE db1;
195 DROP DATABASE db2;
196 include/sync_slave_sql_with_master.inc
197 include/stop_slave_sql.inc
198 SET @@global.replica_pending_jobs_size_max= @save.replica_pending_jobs_size_max;
199 SET @@GLOBAL.replica_parallel_workers= @save.replica_parallel_workers;
200 include/start_slave_sql.inc
201 include/rpl_end.inc