mirror of
https://github.com/MariaDB/server.git
synced 2025-08-26 01:44:06 +03:00
MDEV-4506: Parallel replication.
Improve STOP SLAVE in parallel mode. Now, the parallel part will queue the current event group to the end, and then stop queing any more events. Each worker will complete the current event group, and then just skip any further queued events.
This commit is contained in:
@@ -117,7 +117,6 @@ include/start_slave.inc
|
||||
FLUSH LOGS;
|
||||
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
|
||||
INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7);
|
||||
SET binlog_format=@old_format;
|
||||
BEGIN;
|
||||
INSERT INTO t3 VALUES (2,102);
|
||||
BEGIN;
|
||||
@@ -211,6 +210,50 @@ slave-bin.000003 # Query # # use `test`; INSERT INTO t3 VALUES (6, foo(16,
|
||||
'group_commit_waiting_for_prior SIGNAL slave_queued3',
|
||||
''))
|
||||
slave-bin.000003 # Xid # # COMMIT /* XID */
|
||||
*** Test STOP SLAVE in parallel mode ***
|
||||
include/stop_slave.inc
|
||||
SET binlog_direct_non_transactional_updates=0;
|
||||
SET sql_log_bin=0;
|
||||
CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
|
||||
SET sql_log_bin=1;
|
||||
BEGIN;
|
||||
INSERT INTO t2 VALUES (20);
|
||||
INSERT INTO t1 VALUES (20);
|
||||
INSERT INTO t2 VALUES (21);
|
||||
INSERT INTO t3 VALUES (20, 20);
|
||||
COMMIT;
|
||||
INSERT INTO t3 VALUES(21, 21);
|
||||
INSERT INTO t3 VALUES(22, 22);
|
||||
SET binlog_format=@old_format;
|
||||
BEGIN;
|
||||
INSERT INTO t2 VALUES (21);
|
||||
START SLAVE;
|
||||
STOP SLAVE;
|
||||
ROLLBACK;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
20
|
||||
SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
20
|
||||
21
|
||||
SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
|
||||
a b
|
||||
20 20
|
||||
include/start_slave.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
20
|
||||
SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
20
|
||||
21
|
||||
SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
|
||||
a b
|
||||
20 20
|
||||
21 21
|
||||
22 22
|
||||
include/stop_slave.inc
|
||||
SET GLOBAL binlog_format=@old_format;
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
|
Reference in New Issue
Block a user