| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
# |
| 4 |
# MDEV-37453 Parallel Replication Crash During Backup |
| 5 |
# |
| 6 |
connection master; |
| 7 |
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE = innodb; |
| 8 |
INSERT INTO t1 VALUES (1, 0); |
| 9 |
INSERT INTO t1 VALUES (2, 0); |
| 10 |
connection slave; |
| 11 |
include/stop_slave.inc |
| 12 |
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; |
| 13 |
SET @old_parallel_threads = @@GLOBAL.slave_parallel_threads; |
| 14 |
SET @old_parallel_mode = @@GLOBAL.slave_parallel_mode; |
| 15 |
SET @@global.slave_parallel_threads= 2; |
| 16 |
SET @@global.slave_parallel_mode = 'optimistic'; |
| 17 |
connection master; |
| 18 |
begin /* trx1 */; |
| 19 |
delete from t1 where a = 1; |
| 20 |
update t1 set b = 1 where a = 2; |
| 21 |
commit; |
| 22 |
begin /* trx2 */; |
| 23 |
delete from t1 where a = 2; |
| 24 |
commit; |
| 25 |
connect aux_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; |
| 26 |
BEGIN; |
| 27 |
DELETE FROM t1 WHERE a = 1; |
| 28 |
connection slave; |
| 29 |
include/start_slave.inc |
| 30 |
connection aux_slave; |
| 31 |
connect backup_slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; |
| 32 |
BACKUP STAGE START; |
| 33 |
BACKUP STAGE BLOCK_COMMIT; |
| 34 |
connection aux_slave; |
| 35 |
ROLLBACK; |
| 36 |
connection aux_slave; |
| 37 |
connection backup_slave; |
| 38 |
BACKUP STAGE END; |
| 39 |
connection slave; |
| 40 |
include/diff_tables.inc [master:t1,slave:t1] |
| 41 |
connection slave; |
| 42 |
include/stop_slave.inc |
| 43 |
SET @@global.slave_parallel_threads= @old_parallel_threads; |
| 44 |
SET @@global.slave_parallel_mode = @old_parallel_mode; |
| 45 |
include/start_slave.inc |
| 46 |
connection server_1; |
| 47 |
DROP TABLE t1; |
| 48 |
include/rpl_end.inc |
| 49 |
# End of the tests |