Debian Codegraph @

mysql-test/suite/rpl/r/rpl_mts_database_transaction_retry.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 [connection slave]
7 include/stop_slave.inc
8 SET @saved_replica_preserve_commit_order = @@GLOBAL.replica_preserve_commit_order;
9 SET GLOBAL replica_preserve_commit_order = OFF;
10 include/start_slave.inc
11 [connection master]
12 #
13 # Initialization the test
14 #
15 CREATE DATABASE db1;
16 CREATE DATABASE db2;
17 CREATE TABLE db1.t1(c1 INT PRIMARY KEY, c2 VARCHAR(4096)) ENGINE=InnoDB;
18 CREATE TABLE db1.t2(c1 INT PRIMARY KEY, c2 VARCHAR(4096)) ENGINE=InnoDB;
19 CREATE TABLE db2.t1(c1 INT PRIMARY KEY, c2 VARCHAR(4096)) ENGINE=InnoDB;
20 INSERT INTO db1.t1 VALUES(1, NULL), (10, NULL), (100, NULL);
21 INSERT INTO db1.t2 VALUES(1, NULL), (10, NULL), (100, NULL);
22 INSERT INTO db2.t1 VALUES(1, NULL), (10, NULL), (100, NULL);
23 include/sync_slave_sql_with_master.inc
24 CALL mtr.add_suppression("Replica SQL for channel '':.*Lock wait timeout exceeded.*");
25 CALL mtr.add_suppression("Replica SQL for channel '': Worker . failed executing transaction.*");
26 CALL mtr.add_suppression("Replica SQL for channel '': .*Error_code: MY-001756");
27 CALL mtr.add_suppression("Replica SQL for channel '': worker thread retried transaction.*");
28 SET @saved_innodb_lock_wait_timeout = @@GLOBAL.innodb_lock_wait_timeout;
29 SET @saved_replica_parallel_workers = @@GLOBAL.replica_parallel_workers;
30 SET @saved_replica_parallel_type = @@GLOBAL.replica_parallel_type;
31 Warnings:
32 Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release.
33 SET @saved_max_relay_log_size = @@GLOBAL.max_relay_log_size;
34 SET @saved_replica_transaction_retries = @@GLOBAL.replica_transaction_retries;
35 SET GLOBAL innodb_lock_wait_timeout = 1;
36 SET GLOBAL replica_parallel_workers = 2;
37 SET GLOBAL max_relay_log_size = 4096;
38 include/stop_slave_sql.inc
39 SET GLOBAL replica_parallel_type = "DATABASE";
40 Warnings:
41 Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release.
42 include/start_slave_sql.inc
43 #
44 # Case 1: slave will stop if replica_transaction_retries is 0
45 #
46 SET GLOBAL replica_transaction_retries = 0;
47 BEGIN;
48 SELECT c1 FROM db1.t1 FOR UPDATE;
49 c1
50 1
51 10
52 100
53 [connection master]
54 INSERT INTO db1.t1 VALUES(2, NULL);
55 INSERT INTO db2.t1 VALUES(2, NULL);
56 include/save_master_pos.inc
57 [connection slave]
58 include/wait_for_slave_sql_error.inc [errno=1205]
59 include/assert.inc [Value 2 is not in db1.t1.]
60 ROLLBACK;
61 #
62 # Case 2: Slave will stop after retrying a transaction
63 # replica_transaction_retries times.
64 #
65 SET GLOBAL replica_transaction_retries = 2;
66 include/start_slave_sql.inc
67 include/sync_slave_sql.inc
68 BEGIN;
69 SELECT c1 FROM db1.t2 FOR UPDATE;
70 c1
71 1
72 10
73 100
74 [connection master]
75 BEGIN;
76 INSERT INTO db1.t1 VALUES(20, NULL);
77 INSERT INTO db1.t2 VALUES(20, NULL);
78 COMMIT;
79 INSERT INTO db2.t1 VALUES(20, NULL);
80 include/save_master_pos.inc
81 [connection slave]
82 include/wait_for_slave_sql_error.inc [errno=1205]
83 include/assert.inc [Value 20 is not in db1.t1.]
84 ROLLBACK;
85 #
86 # Case 3: Slave worker will not stop after retring a transaction
87 # sucessfully.
88 #
89 SET GLOBAL replica_transaction_retries = 10;
90 include/start_slave_sql.inc
91 include/sync_slave_sql.inc
92 include/check_slave_no_error.inc
93 BEGIN;
94 SELECT c1 FROM db1.t2 FOR UPDATE;
95 c1
96 1
97 10
98 20
99 100
100 [connection master]
101 BEGIN;
102 # INSERT INTO db1.t1 VALUES(30, 4096'a')
103 # INSERT INTO db1.t1 VALUES(31, 4096'a')
104 SET @str= 'abc';
105 INSERT INTO db1.t2 VALUES(30, @str);
106 COMMIT;
107 INSERT INTO db2.t1 VALUES(30, NULL);
108 include/save_master_pos.inc
109 [connection slave]
110 include/check_slave_no_error.inc
111 ROLLBACK;
112 include/sync_slave_sql.inc
113 include/check_slave_no_error.inc
114 include/rpl_diff.inc
115 include/rpl_diff.inc
116 include/rpl_diff.inc
117 [connection master]
118 INSERT INTO db1.t1 VALUES(40, NULL);
119 INSERT INTO db2.t1 VALUES(40, NULL);
120 include/sync_slave_sql_with_master.inc
121 #
122 # Case 4: Non-temporary error will stop slave workers without retrying
123 #
124 INSERT INTO db1.t1 VALUES(50, NULL);
125 [connection master]
126 INSERT INTO db1.t1 VALUES(50, NULL);
127 include/save_master_pos.inc
128 [connection slave]
129 include/wait_for_slave_sql_error.inc [errno=1062]
130 include/assert.inc [count_transactions_retries should not increase]
131 DELETE FROM db1.t1 WHERE c1 = 50;
132 include/start_slave_sql.inc
133 include/sync_slave_sql.inc
134 #
135 # Cleanup
136 #
137 SET GLOBAL innodb_lock_wait_timeout = @saved_innodb_lock_wait_timeout;
138 SET GLOBAL replica_parallel_workers = @saved_replica_parallel_workers;
139 SET GLOBAL max_relay_log_size = @saved_max_relay_log_size;
140 SET GLOBAL replica_transaction_retries = @saved_replica_transaction_retries;
141 include/stop_slave_sql.inc
142 SET GLOBAL replica_parallel_type= @saved_replica_parallel_type;
143 Warnings:
144 Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release.
145 include/start_slave_sql.inc
146 [connection master]
147 DROP DATABASE db1;
148 DROP DATABASE db2;
149 [connection slave]
150 include/stop_slave.inc
151 SET GLOBAL replica_preserve_commit_order = @saved_replica_preserve_commit_order;
152 include/start_slave.inc
153 include/rpl_end.inc