| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
call mtr.add_suppression("Deadlock found"); |
| 4 |
call mtr.add_suppression("Can't find record in 't.'"); |
| 5 |
connection master; |
| 6 |
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=innodb; |
| 7 |
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); |
| 8 |
connection slave; |
| 9 |
SHOW STATUS LIKE 'Slave_retried_transactions'; |
| 10 |
Variable_name Value |
| 11 |
Slave_retried_transactions 0 |
| 12 |
set @@global.slave_exec_mode= 'IDEMPOTENT'; |
| 13 |
UPDATE t1 SET a = 5, b = 47 WHERE a = 1; |
| 14 |
SELECT * FROM t1 ORDER BY a; |
| 15 |
a b |
| 16 |
2 2 |
| 17 |
3 3 |
| 18 |
4 4 |
| 19 |
5 47 |
| 20 |
connection master; |
| 21 |
UPDATE t1 SET a = 5, b = 5 WHERE a = 1; |
| 22 |
SELECT * FROM t1 ORDER BY a; |
| 23 |
a b |
| 24 |
2 2 |
| 25 |
3 3 |
| 26 |
4 4 |
| 27 |
5 5 |
| 28 |
connection slave; |
| 29 |
set @@global.slave_exec_mode= default; |
| 30 |
SHOW STATUS LIKE 'Slave_retried_transactions'; |
| 31 |
Variable_name Value |
| 32 |
Slave_retried_transactions 0 |
| 33 |
SELECT * FROM t1 ORDER BY a; |
| 34 |
a b |
| 35 |
2 2 |
| 36 |
3 3 |
| 37 |
4 4 |
| 38 |
5 47 |
| 39 |
include/check_slave_is_running.inc |
| 40 |
connection slave; |
| 41 |
call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1"); |
| 42 |
call mtr.add_suppression("Slave SQL for channel '': worker thread retried transaction"); |
| 43 |
call mtr.add_suppression("The slave coordinator and worker threads are stopped"); |
| 44 |
connection slave; |
| 45 |
set @save_innodb_lock_wait_timeout=@@global.innodb_lock_wait_timeout; |
| 46 |
set @save_slave_transaction_retries=@@global.slave_transaction_retries; |
| 47 |
set @@global.innodb_lock_wait_timeout=1; |
| 48 |
set @@global.slave_transaction_retries=2; |
| 49 |
include/restart_slave.inc |
| 50 |
connection slave1; |
| 51 |
BEGIN; |
| 52 |
INSERT INTO t1 SET a = 6, b = 7; |
| 53 |
connection master; |
| 54 |
INSERT INTO t1 SET a = 99, b = 99; |
| 55 |
XA START 'xa1'; |
| 56 |
INSERT INTO t1 SET a = 6, b = 6; |
| 57 |
XA END 'xa1'; |
| 58 |
XA PREPARE 'xa1'; |
| 59 |
connection slave; |
| 60 |
include/wait_for_slave_sql_error.inc [errno=1213,1205] |
| 61 |
set @@global.innodb_lock_wait_timeout=1; |
| 62 |
set @@global.slave_transaction_retries=100; |
| 63 |
include/restart_slave.inc |
| 64 |
Warnings: |
| 65 |
Note 1255 Slave already has been stopped |
| 66 |
connection slave1; |
| 67 |
ROLLBACK; |
| 68 |
connection master; |
| 69 |
XA COMMIT 'xa1'; |
| 70 |
include/sync_slave_sql_with_master.inc |
| 71 |
connection slave; |
| 72 |
include/assert.inc [XA transaction record must be in the table] |
| 73 |
set @@global.innodb_lock_wait_timeout=@save_innodb_lock_wait_timeout; |
| 74 |
set @@global.slave_transaction_retries= @save_slave_transaction_retries; |
| 75 |
connection master; |
| 76 |
DROP TABLE t1; |
| 77 |
connection slave; |
| 78 |
connection master; |
| 79 |
include/rpl_end.inc |