File: rpl_generate_mts_gap.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (47 lines) | stat: -rw-r--r-- 1,642 bytes parent folder | download
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
# Following test first creates two databases (d1 and d2) and setup slave to use
# two parallel workers. The test case then insert on the slave a tuple that will
# block writes on d2 and generate gaps.

--let $slave_stop_wait=5

--echo #### I. Initialize ####

--source include/rpl_connection_slave.inc
--source include/stop_slave.inc
SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
--eval set @@global.innodb_lock_wait_timeout=$slave_stop_wait + 1000

--source include/start_slave.inc

--source include/rpl_connection_master.inc
CREATE DATABASE d1;
CREATE DATABASE d2;
CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;

--echo #### II. Prepare test scenario ####

--source include/sync_slave_sql_with_master.inc
BEGIN;
INSERT INTO d2.t VALUES (2, 'Slave local'); # Hold T3
INSERT INTO d1.t VALUES (3, 'Slave local'); # Hold T6

--source include/rpl_connection_master.inc
INSERT INTO d1.t VALUES (1, 'T1');
INSERT INTO d2.t VALUES (1, 'T2');
INSERT INTO d2.t VALUES (2, 'T3'); # This will be a gap when executed on slave
INSERT INTO d2.t VALUES (3, 'T4'); # This will be a gap when executed on slave
INSERT INTO d1.t VALUES (2, 'T5');

--source include/rpl_connection_slave1.inc
--let $table=d1.t
--let $count=2
--source include/wait_until_rows_count.inc

--echo # Now d1.t has two rows and d2.t has one row.

# Wait for coordinator to populate worker's queues.
--let $show_statement= SHOW PROCESSLIST
--let $field= State
--let $condition= = 'Replica has read all relay log; waiting for more updates'
--source include/wait_show_condition.inc