1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-26: Global transaction ID.

Replace CHANGE MASTER TO ... master_gtid_pos='xxx' with a new system
variable @@global.gtid_pos.

This is more logical; @@gtid_pos is global, not per-master, and it is not
affected by RESET SLAVE.

Also rename master_gtid_pos=AUTO to master_use_gtid=1, which again is more
logical.
This commit is contained in:
unknown
2013-04-05 16:20:58 +02:00
parent c2cbc9cee6
commit b7363eb4ac
25 changed files with 390 additions and 188 deletions

View File

@ -84,8 +84,8 @@ INSERT INTO t1 VALUES (2, "switch1");
INSERT INTO t3 VALUES (102, "switch1 a");
INSERT INTO t2 VALUES (2, "switch1");
INSERT INTO t3 VALUES (202, "switch1 b");
CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_gtid_pos=auto;
CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_gtid_pos=auto;
CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
SET default_master_connection = 'slave1';
START SLAVE;
include/wait_for_slave_to_start.inc
@ -102,7 +102,7 @@ INSERT INTO t3 VALUES (203, "switch 2 b");
STOP SLAVE 'slave2';
INSERT INTO t2 VALUES (4, "switch 3");
INSERT INTO t3 VALUES (204, "switch 3 b");
CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_gtid_pos=auto;
CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
START SLAVE;
SELECT * FROM t1 ORDER BY a;
a b

View File

@ -69,9 +69,9 @@ INSERT INTO t3 VALUES (202, "switch1 b");
--connection slave2
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_gtid_pos=auto;
eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_gtid_pos=auto;
eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
SET default_master_connection = 'slave1';
START SLAVE;
--source include/wait_for_slave_to_start.inc
@ -112,7 +112,7 @@ INSERT INTO t3 VALUES (204, "switch 3 b");
--connection slave1
--replace_result $SERVER_MYPORT_4 MYPORT_4
eval CHANGE MASTER TO master_port=$SERVER_MYPORT_4, master_host='127.0.0.1', master_user='root', master_gtid_pos=auto;
eval CHANGE MASTER TO master_port=$SERVER_MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=1;
START SLAVE;
--let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=3 AND (SELECT COUNT(*) FROM t2)=4 AND (SELECT COUNT(*) FROM t3)=7
--source include/wait_condition.inc