mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-5804: If same GTID is received on multiple master connections in multi-source replication, the event is double-executed causing corruption or replication failure
Some fixes, mainly to make it work in non-parallel replication mode also (--slave-parallel-threads=0). Patch should be fairly complete now.
This commit is contained in:
@ -151,38 +151,129 @@ a
|
||||
10
|
||||
11
|
||||
12
|
||||
*** Test also with not using parallel replication.
|
||||
SET default_master_connection = "b2a";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SET default_master_connection = "c2a";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "b2a";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "c2a";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "a2b";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SET default_master_connection = "c2b";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "a2b";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "c2b";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "a2c";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SET default_master_connection = "b2c";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "a2c";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "b2c";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "a2d";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "a2d";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
INSERT INTO t1 VALUES (21);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (22);
|
||||
INSERT INTO t1 VALUES (23);
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES (24), (25);
|
||||
INSERT INTO t1 VALUES (26);
|
||||
include/save_master_gtid.inc
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE 'c2a' stopped
|
||||
Note 1938 SLAVE 'b2a' stopped
|
||||
include/reset_master_slave.inc
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE 'a2b' stopped
|
||||
Note 1938 SLAVE 'c2b' stopped
|
||||
include/reset_master_slave.inc
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE 'a2c' stopped
|
||||
Note 1938 SLAVE 'b2c' stopped
|
||||
include/reset_master_slave.inc
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE 'a2d' stopped
|
||||
include/reset_master_slave.inc
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
DROP TABLE t1;
|
||||
include/reset_master_slave.inc
|
||||
DROP TABLE t1;
|
||||
include/reset_master_slave.inc
|
||||
DROP TABLE t1;
|
||||
include/reset_master_slave.inc
|
||||
DROP TABLE t1;
|
||||
include/reset_master_slave.inc
|
||||
|
@ -170,39 +170,135 @@ SET default_master_connection = "a2b";
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
|
||||
|
||||
--echo *** Test also with not using parallel replication.
|
||||
|
||||
--connection server_1
|
||||
SET default_master_connection = "b2a";
|
||||
STOP SLAVE;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
SET default_master_connection = "c2a";
|
||||
STOP SLAVE;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "b2a";
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "c2a";
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
|
||||
--connection server_2
|
||||
SET default_master_connection = "a2b";
|
||||
STOP SLAVE;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
SET default_master_connection = "c2b";
|
||||
STOP SLAVE;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "a2b";
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "c2b";
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
|
||||
--connection server_3
|
||||
SET default_master_connection = "a2c";
|
||||
STOP SLAVE;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
SET default_master_connection = "b2c";
|
||||
STOP SLAVE;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "a2c";
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "b2c";
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
|
||||
--connection server_4
|
||||
SET default_master_connection = "a2d";
|
||||
STOP SLAVE;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "a2d";
|
||||
START SLAVE;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
|
||||
--connection server_2
|
||||
INSERT INTO t1 VALUES (21);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (22);
|
||||
INSERT INTO t1 VALUES (23);
|
||||
COMMIT;
|
||||
INSERT INTO t1 VALUES (24), (25);
|
||||
INSERT INTO t1 VALUES (26);
|
||||
|
||||
--source include/save_master_gtid.inc
|
||||
|
||||
--connection server_1
|
||||
--source include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
|
||||
--connection server_3
|
||||
--source include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
|
||||
--connection server_4
|
||||
--source include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
|
||||
--connection server_2
|
||||
--source include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
|
||||
|
||||
# Clean up.
|
||||
--connection server_1
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
--source reset_master_slave.inc
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
DROP TABLE t1;
|
||||
--disconnect server_1
|
||||
|
||||
--connection server_2
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
--source reset_master_slave.inc
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
DROP TABLE t1;
|
||||
--disconnect server_2
|
||||
|
||||
--connection server_3
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
--source reset_master_slave.inc
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
DROP TABLE t1;
|
||||
--disconnect server_3
|
||||
|
||||
--connection server_4
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
--source reset_master_slave.inc
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
|
||||
--connection server_1
|
||||
DROP TABLE t1;
|
||||
--source reset_master_slave.inc
|
||||
--disconnect server_1
|
||||
|
||||
--connection server_2
|
||||
DROP TABLE t1;
|
||||
--source reset_master_slave.inc
|
||||
--disconnect server_2
|
||||
|
||||
--connection server_3
|
||||
DROP TABLE t1;
|
||||
--source reset_master_slave.inc
|
||||
--disconnect server_3
|
||||
|
||||
--connection server_4
|
||||
DROP TABLE t1;
|
||||
--source reset_master_slave.inc
|
||||
--disconnect server_4
|
||||
|
Reference in New Issue
Block a user