mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
MDEV-6720 - enable connection log in mysqltest by default
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
connect slave1,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
connect slave2,127.0.0.1,root,,,$SERVER_MYPORT_4;
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
||||
connection slave1;
|
||||
CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
|
||||
CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
|
||||
set default_master_connection = 'slave1';
|
||||
@@ -7,17 +12,21 @@ set default_master_connection = 'slave2';
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
connection slave2;
|
||||
CHANGE MASTER TO master_port=MYPORT_3, master_host='127.0.0.1', master_user='root';
|
||||
start all slaves;
|
||||
Warnings:
|
||||
Note 1937 SLAVE '' started
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection master1;
|
||||
SET GLOBAL gtid_domain_id= 1;
|
||||
SET SESSION gtid_domain_id= 1;
|
||||
CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
|
||||
INSERT INTO t1 VALUES (1, "initial");
|
||||
INSERT INTO t3 VALUES (101, "initial 1");
|
||||
connection slave1;
|
||||
connection master2;
|
||||
SET GLOBAL gtid_domain_id= 2;
|
||||
SET SESSION gtid_domain_id= 2;
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
|
||||
@@ -26,14 +35,18 @@ SET SQL_LOG_BIN=0;
|
||||
CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10));
|
||||
SET SQL_LOG_BIN=1;
|
||||
INSERT INTO t3 VALUES (201, "initial 2");
|
||||
connection slave2;
|
||||
*** Now move slave2 to replicate from both master1 and master2 instead of just slave1 ***
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE '' stopped
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (2, "switch1");
|
||||
INSERT INTO t3 VALUES (102, "switch1 a");
|
||||
connection master2;
|
||||
INSERT INTO t2 VALUES (2, "switch1");
|
||||
INSERT INTO t3 VALUES (202, "switch1 b");
|
||||
connection slave2;
|
||||
CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
|
||||
CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
|
||||
SET default_master_connection = 'slave1';
|
||||
@@ -44,16 +57,24 @@ START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
*** Move slave1 to replicate from slave2 instead of from master1 and master2 ***
|
||||
connection slave1;
|
||||
STOP SLAVE 'slave1';
|
||||
connection master1;
|
||||
INSERT INTO t1 VALUES (3, "switch 2");
|
||||
INSERT INTO t3 VALUES (103, "switch 2 a");
|
||||
connection slave2;
|
||||
connection master2;
|
||||
INSERT INTO t2 VALUES (3, "switch 2");
|
||||
INSERT INTO t3 VALUES (203, "switch 2 b");
|
||||
include/save_master_gtid.inc
|
||||
connection slave1;
|
||||
STOP SLAVE 'slave2';
|
||||
connection master2;
|
||||
INSERT INTO t2 VALUES (4, "switch 3");
|
||||
INSERT INTO t3 VALUES (204, "switch 3 b");
|
||||
connection slave2;
|
||||
include/sync_with_master_gtid.inc
|
||||
connection slave1;
|
||||
CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
|
||||
START SLAVE;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
@@ -76,24 +97,34 @@ a b
|
||||
202 switch1 b
|
||||
203 switch 2 b
|
||||
204 switch 3 b
|
||||
connection master1;
|
||||
DROP TABLE t1;
|
||||
SET SQL_LOG_BIN=0;
|
||||
DROP TABLE t3;
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection master2;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
connection slave1;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE '' stopped
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave1;
|
||||
connection slave2;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE 'slave1' stopped
|
||||
Note 1938 SLAVE 'slave2' stopped
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave2;
|
||||
connection master1;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
connection master2;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master2;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
*** Test all-to-all replication with --gtid-ignore-duplicates ***
|
||||
connect server_1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
connect server_2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
||||
connect server_3,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
connect server_4,127.0.0.1,root,,,$SERVER_MYPORT_4;
|
||||
connection server_1;
|
||||
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=5;
|
||||
SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
|
||||
@@ -14,6 +19,7 @@ set default_master_connection = 'c2a';
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
connection server_2;
|
||||
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=5;
|
||||
SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
|
||||
@@ -29,6 +35,7 @@ set default_master_connection = 'c2b';
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
connection server_3;
|
||||
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=5;
|
||||
SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
|
||||
@@ -44,6 +51,7 @@ set default_master_connection = 'b2c';
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
connection server_4;
|
||||
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
|
||||
SET GLOBAL slave_parallel_threads=5;
|
||||
SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
|
||||
@@ -55,6 +63,7 @@ set default_master_connection = 'a2d';
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
connection server_1;
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
@@ -65,6 +74,7 @@ COMMIT;
|
||||
INSERT INTO t1 VALUES (4), (5);
|
||||
INSERT INTO t1 VALUES (6);
|
||||
include/save_master_gtid.inc
|
||||
connection server_2;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
@@ -74,6 +84,7 @@ a
|
||||
4
|
||||
5
|
||||
6
|
||||
connection server_3;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
@@ -83,6 +94,7 @@ a
|
||||
4
|
||||
5
|
||||
6
|
||||
connection server_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
@@ -92,6 +104,7 @@ a
|
||||
4
|
||||
5
|
||||
6
|
||||
connection server_1;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
a
|
||||
@@ -101,8 +114,10 @@ a
|
||||
4
|
||||
5
|
||||
6
|
||||
connection server_3;
|
||||
INSERT INTO t1 VALUES (10);
|
||||
include/save_master_gtid.inc
|
||||
connection server_2;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
a
|
||||
@@ -113,8 +128,10 @@ include/wait_for_slave_to_stop.inc
|
||||
STOP SLAVE "a2b";
|
||||
SET default_master_connection = "a2b";
|
||||
include/wait_for_slave_to_stop.inc
|
||||
connection server_3;
|
||||
INSERT INTO t1 VALUES (11);
|
||||
include/save_master_gtid.inc
|
||||
connection server_1;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
a
|
||||
@@ -123,12 +140,14 @@ a
|
||||
SET default_master_connection = "b2a";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
connection server_2;
|
||||
INSERT INTO t1 VALUES (12);
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
a
|
||||
10
|
||||
12
|
||||
include/save_master_gtid.inc
|
||||
connection server_1;
|
||||
START SLAVE "b2a";
|
||||
SET default_master_connection = "b2a";
|
||||
include/wait_for_slave_to_start.inc
|
||||
@@ -138,13 +157,16 @@ a
|
||||
10
|
||||
11
|
||||
12
|
||||
connection server_2;
|
||||
START SLAVE "c2b";
|
||||
SET default_master_connection = "c2b";
|
||||
include/wait_for_slave_to_start.inc
|
||||
START SLAVE "a2b";
|
||||
SET default_master_connection = "a2b";
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection server_1;
|
||||
include/save_master_gtid.inc
|
||||
connection server_2;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
|
||||
a
|
||||
@@ -152,6 +174,7 @@ a
|
||||
11
|
||||
12
|
||||
*** Test also with not using parallel replication.
|
||||
connection server_1;
|
||||
SET default_master_connection = "b2a";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
@@ -165,6 +188,7 @@ include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "c2a";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection server_2;
|
||||
SET default_master_connection = "a2b";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
@@ -178,6 +202,7 @@ include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "c2b";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection server_3;
|
||||
SET default_master_connection = "a2c";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
@@ -191,6 +216,7 @@ include/wait_for_slave_to_start.inc
|
||||
SET default_master_connection = "b2c";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection server_4;
|
||||
SET default_master_connection = "a2d";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
@@ -198,6 +224,7 @@ SET GLOBAL slave_parallel_threads=0;
|
||||
SET default_master_connection = "a2d";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connection server_2;
|
||||
INSERT INTO t1 VALUES (21);
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES (22);
|
||||
@@ -206,6 +233,7 @@ COMMIT;
|
||||
INSERT INTO t1 VALUES (24), (25);
|
||||
INSERT INTO t1 VALUES (26);
|
||||
include/save_master_gtid.inc
|
||||
connection server_1;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
@@ -215,6 +243,7 @@ a
|
||||
24
|
||||
25
|
||||
26
|
||||
connection server_3;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
@@ -224,6 +253,7 @@ a
|
||||
24
|
||||
25
|
||||
26
|
||||
connection server_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
@@ -233,6 +263,7 @@ a
|
||||
24
|
||||
25
|
||||
26
|
||||
connection server_2;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
||||
a
|
||||
@@ -243,15 +274,18 @@ a
|
||||
25
|
||||
26
|
||||
*** MDEV-8354: out-of-order error with --gtid-ignore-duplicates and row-based replication ***
|
||||
connection server_1;
|
||||
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
|
||||
connection server_2;
|
||||
SET default_master_connection = "c2b";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
connection server_3;
|
||||
SET default_master_connection = "b2c";
|
||||
STOP SLAVE;
|
||||
include/wait_for_slave_to_stop.inc
|
||||
@@ -261,6 +295,7 @@ SET @old_strict=@@GLOBAL.gtid_strict_mode;
|
||||
SET GLOBAL gtid_strict_mode=1;
|
||||
SET @old_dbug=@@GLOBAL.debug_dbug;
|
||||
SET GLOBAL debug_dbug="+d,inject_sleep_gtid_100_x_x";
|
||||
connection server_1;
|
||||
SET @old_domain=@@SESSION.gtid_domain_id;
|
||||
SET @old_format=@@SESSION.binlog_format;
|
||||
SET SESSION gtid_domain_id=100;
|
||||
@@ -288,15 +323,18 @@ INSERT INTO t1 VALUES (49);
|
||||
SET SESSION gtid_domain_id=@old_domain;
|
||||
SET SESSION binlog_format=@old_format;
|
||||
include/save_master_gtid.inc
|
||||
connection server_2;
|
||||
include/sync_with_master_gtid.inc
|
||||
INSERT INTO t1 VALUES (50);
|
||||
include/save_master_gtid.inc
|
||||
connection server_3;
|
||||
SET default_master_connection = "b2c";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
SELECT MASTER_GTID_WAIT("GTID", 30);
|
||||
MASTER_GTID_WAIT("GTID", 30)
|
||||
0
|
||||
connection server_1;
|
||||
SET default_master_connection = "b2a";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
@@ -327,6 +365,7 @@ a
|
||||
48
|
||||
49
|
||||
50
|
||||
connection server_2;
|
||||
SET default_master_connection = "c2b";
|
||||
START SLAVE;
|
||||
include/wait_for_slave_to_start.inc
|
||||
@@ -354,6 +393,7 @@ a
|
||||
48
|
||||
49
|
||||
50
|
||||
connection server_3;
|
||||
include/sync_with_master_gtid.inc
|
||||
SET GLOBAL debug_dbug=@old_dbug;
|
||||
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
|
||||
@@ -382,6 +422,7 @@ a
|
||||
SET GLOBAL slave_exec_mode=@old_slave_mode;
|
||||
SET GLOBAL gtid_strict_mode=@old_strict;
|
||||
*** MDEV-8496: gtid_ignore_duplicates treats gtid_seq_no as 32-bit ***
|
||||
connection server_1;
|
||||
SET @old_domain= @@SESSION.gtid_domain_id;
|
||||
SET SESSION gtid_domain_id=102;
|
||||
SET SESSION gtid_seq_no=4294967294;
|
||||
@@ -390,12 +431,14 @@ INSERT INTO t1 VALUES (61);
|
||||
INSERT INTO t1 VALUES (62);
|
||||
SET SESSION gtid_domain_id= @old_domain;
|
||||
include/save_master_gtid.inc
|
||||
connection server_4;
|
||||
include/sync_with_master_gtid.inc
|
||||
SELECT * FROM t1 WHERE a >= 60 ORDER BY a;
|
||||
a
|
||||
60
|
||||
61
|
||||
62
|
||||
connection server_2;
|
||||
SET default_master_connection = "c2b";
|
||||
include/sync_with_master_gtid.inc
|
||||
SET default_master_connection = "a2b";
|
||||
@@ -405,6 +448,7 @@ a
|
||||
60
|
||||
61
|
||||
62
|
||||
connection server_3;
|
||||
SET default_master_connection = "b2c";
|
||||
include/sync_with_master_gtid.inc
|
||||
SET default_master_connection = "a2c";
|
||||
@@ -414,6 +458,7 @@ a
|
||||
60
|
||||
61
|
||||
62
|
||||
connection server_1;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
@@ -421,6 +466,7 @@ Note 1938 SLAVE 'b2a' stopped
|
||||
Note 1938 SLAVE 'c2a' stopped
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
connection server_2;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
@@ -428,6 +474,7 @@ Note 1938 SLAVE 'a2b' stopped
|
||||
Note 1938 SLAVE 'c2b' stopped
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
connection server_3;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
@@ -435,17 +482,26 @@ Note 1938 SLAVE 'a2c' stopped
|
||||
Note 1938 SLAVE 'b2c' stopped
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
connection server_4;
|
||||
SET GLOBAL gtid_domain_id=0;
|
||||
STOP ALL SLAVES;
|
||||
Warnings:
|
||||
Note 1938 SLAVE 'a2d' stopped
|
||||
SET GLOBAL slave_parallel_threads= @old_parallel;
|
||||
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
|
||||
connection server_1;
|
||||
DROP TABLE t1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect server_1;
|
||||
connection server_2;
|
||||
DROP TABLE t1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect server_2;
|
||||
connection server_3;
|
||||
DROP TABLE t1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect server_3;
|
||||
connection server_4;
|
||||
DROP TABLE t1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect server_4;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
#
|
||||
# List of files matching '*info*' pattern before starting any slaves
|
||||
multi-master.info
|
||||
@@ -31,6 +32,8 @@ master_user='root';
|
||||
start slave 'MASTER 2.2';
|
||||
set default_master_connection = 'MASTER 2.2';
|
||||
include/wait_for_slave_to_start.inc
|
||||
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
||||
connection slave;
|
||||
#
|
||||
# List of files matching '*info*' pattern
|
||||
# while 'master1' and 'MASTER 2.2' are running
|
||||
@@ -69,6 +72,8 @@ master_host='127.0.0.1',
|
||||
master_user='root';
|
||||
start slave;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
connection slave;
|
||||
#
|
||||
# List of files matching '*info*' pattern
|
||||
# while 'MASTER 2.2' and '' are running
|
||||
@@ -111,5 +116,10 @@ MASTER 2.2
|
||||
# EOF
|
||||
#
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave;
|
||||
connection master1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
connection master2;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master2;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
||||
connection slave;
|
||||
change master '' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
|
||||
change master 'master2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
|
||||
start all slaves;
|
||||
@@ -9,22 +13,38 @@ include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = 'master2';
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
connection master1;
|
||||
create table t1 (a varchar(10) character set utf8);
|
||||
load data infile '../../std_data/loaddata6.dat' into table t1;
|
||||
connection slave;
|
||||
connection master2;
|
||||
create table t2 (a varchar(10) character set utf8);
|
||||
load data infile '../../std_data/loaddata6.dat' into table t2;
|
||||
connection slave;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
1
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
1
|
||||
connection master1;
|
||||
drop table t1;
|
||||
connection master2;
|
||||
drop table t2;
|
||||
connection master1;
|
||||
connection slave;
|
||||
connection master2;
|
||||
connection slave;
|
||||
connection slave;
|
||||
stop all slaves;
|
||||
Warnings:
|
||||
Note 1938 SLAVE '' stopped
|
||||
Note 1938 SLAVE 'master2' stopped
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave;
|
||||
connection master1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
connection master2;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master2;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
change master 'abc' to relay_log_file='';
|
||||
ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
|
||||
change master 'abc2' to master_host='';
|
||||
@@ -9,6 +10,8 @@ master_user='root';
|
||||
start slave 'master1';
|
||||
set default_master_connection = 'master1';
|
||||
include/wait_for_slave_to_start.inc
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
connection slave;
|
||||
#
|
||||
# Checking SHOW SLAVE 'master1' STATUS
|
||||
#
|
||||
@@ -39,11 +42,13 @@ Last_Errno = '0'
|
||||
Last_SQL_Errno = '0'
|
||||
Slave_heartbeat_period = '60.000'
|
||||
#
|
||||
connection master1;
|
||||
drop database if exists db1;
|
||||
create database db1;
|
||||
use db1;
|
||||
create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
|
||||
insert into t1 (f1) values ('one'),('two');
|
||||
connection slave;
|
||||
select * from db1.t1;
|
||||
i f1
|
||||
1 one
|
||||
@@ -115,13 +120,18 @@ Last_SQL_Errno = '0'
|
||||
Slave_heartbeat_period = '60.000'
|
||||
Slave_heartbeat_period = '60.000'
|
||||
#
|
||||
connection master1;
|
||||
insert into t1 (f1) values ('three');
|
||||
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
||||
drop database if exists db2;
|
||||
create database db2;
|
||||
use db2;
|
||||
create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
|
||||
begin;
|
||||
insert into t1 (f1) values (1),(2);
|
||||
connection slave;
|
||||
connection master2;
|
||||
connection slave;
|
||||
select * from db1.t1;
|
||||
i f1
|
||||
1 one
|
||||
@@ -129,18 +139,24 @@ i f1
|
||||
3 three
|
||||
select * from db2.t1;
|
||||
pk f1
|
||||
connection master2;
|
||||
commit;
|
||||
connection slave;
|
||||
select * from db2.t1;
|
||||
pk f1
|
||||
1 1
|
||||
2 2
|
||||
connection master1;
|
||||
flush logs;
|
||||
connection slave;
|
||||
connection master1;
|
||||
purge binary logs to 'master-bin.000002';
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
master-bin.000002 filesize
|
||||
insert into t1 (f1) values ('four');
|
||||
create table db1.t3 (f1 int) engine=InnoDB;
|
||||
connection slave;
|
||||
#
|
||||
# Checking SHOW ALL SLAVES STATUS
|
||||
#
|
||||
@@ -188,6 +204,8 @@ mysqld-relay-bin.000002 # Gtid # # BEGIN GTID #-#-#
|
||||
mysqld-relay-bin.000002 # Intvar # # INSERT_ID=1
|
||||
mysqld-relay-bin.000002 # Query # # use `db2`; insert into t1 (f1) values (1),(2)
|
||||
mysqld-relay-bin.000002 # Xid # # COMMIT /* XID */
|
||||
disconnect slave;
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
stop slave io_thread;
|
||||
show status like 'Slave_running';
|
||||
Variable_name Value
|
||||
@@ -199,7 +217,12 @@ Slave_running ON
|
||||
drop database db1;
|
||||
drop database db2;
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave;
|
||||
connection master1;
|
||||
drop database db1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
connection master2;
|
||||
drop database db2;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master2;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
change master 'master1' to
|
||||
master_port=MYPORT_1,
|
||||
master_host='127.0.0.1',
|
||||
@@ -5,8 +6,10 @@ master_user='root';
|
||||
start slave 'master1';
|
||||
set default_master_connection = 'master1';
|
||||
include/wait_for_slave_to_start.inc
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
drop table if exists t1;
|
||||
create table t1 (i int) engine=MyISAM;
|
||||
connection slave;
|
||||
mysqld-relay-bin-master1.000001
|
||||
mysqld-relay-bin-master1.000002
|
||||
mysqld-relay-bin-master1.index
|
||||
@@ -25,6 +28,11 @@ include/show_events.inc
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
|
||||
mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
|
||||
connection master1;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave;
|
||||
connection master1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
change master 'master1' to
|
||||
master_port=MYPORT_1,
|
||||
master_host='127.0.0.1',
|
||||
@@ -5,9 +6,11 @@ master_user='root';
|
||||
start slave 'master1';
|
||||
set default_master_connection = 'master1';
|
||||
include/wait_for_slave_to_start.inc
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
drop table if exists t1;
|
||||
create table t1 (i int) engine=MyISAM;
|
||||
insert into t1 values (1),(2);
|
||||
connection slave;
|
||||
stop slave 'master1';
|
||||
show slave 'master1' status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
|
||||
@@ -24,5 +27,8 @@ show slave 'master1' status;
|
||||
ERROR HY000: There is no master connection 'master1'
|
||||
drop table t1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave;
|
||||
connection master1;
|
||||
drop table t1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
||||
connection slave;
|
||||
change master 'slave1' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
|
||||
change master 'slave2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
|
||||
start slave 'slave1';
|
||||
@@ -9,6 +13,10 @@ Warnings:
|
||||
Note 1937 SLAVE 'slave2' started
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
connection master1;
|
||||
connection slave;
|
||||
connection master2;
|
||||
connection slave;
|
||||
show all slaves status;
|
||||
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
|
||||
slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave1.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
|
||||
@@ -80,5 +88,10 @@ Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Po
|
||||
slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space1> None 0 No NULL No 0 0 2 No conservative 0 1073741824 7 0 60.000
|
||||
stop all slaves;
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave;
|
||||
connection master1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
connection master2;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master2;
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
drop database if exists db;
|
||||
create database db;
|
||||
create table db.this_will_not_be_replicated (i int) engine=MyISAM;
|
||||
create table db.t1 (i int) engine=MyISAM;
|
||||
create table db.t2 (i int) engine=MyISAM;
|
||||
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
||||
drop database if exists db;
|
||||
create database db;
|
||||
create table db.t3 (i int) engine=MyISAM;
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
change master 'master1' to
|
||||
master_port=MYPORT_1,
|
||||
master_host='127.0.0.1',
|
||||
@@ -100,6 +103,8 @@ select @@global.max_relay_log_size;
|
||||
start slave 'master2';
|
||||
include/wait_for_slave_to_start.inc
|
||||
set default_master_connection = '';
|
||||
connection master2;
|
||||
connection slave;
|
||||
show tables in db;
|
||||
Tables_in_db
|
||||
t1
|
||||
@@ -111,7 +116,12 @@ set global sql_slave_skip_counter = 0;
|
||||
set global max_relay_log_size = 1073741824;
|
||||
set global max_binlog_size = 1073741824;
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave;
|
||||
connection master1;
|
||||
drop database db;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
connection master2;
|
||||
drop database db;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master2;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
|
||||
call mtr.add_suppression("Connection 'master1' already exists");
|
||||
change master 'master1' to
|
||||
master_port=MYPORT_1,
|
||||
@@ -74,8 +75,10 @@ Slave_received_heartbeats 1
|
||||
set default_master_connection = '';
|
||||
start slave;
|
||||
include/wait_for_slave_to_start.inc
|
||||
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
|
||||
set binlog_format = statement;
|
||||
create temporary table tmp1 (i int) engine=MyISAM;
|
||||
connection slave;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 1
|
||||
@@ -83,8 +86,10 @@ set default_master_connection = 'master1';
|
||||
show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 1
|
||||
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
|
||||
set binlog_format = statement;
|
||||
create temporary table tmp1 (i int) engine=MyISAM;
|
||||
connection slave;
|
||||
show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 2
|
||||
@@ -93,5 +98,10 @@ show status like 'Slave_open_temp_tables';
|
||||
Variable_name Value
|
||||
Slave_open_temp_tables 2
|
||||
include/reset_master_slave.inc
|
||||
disconnect slave;
|
||||
connection master1;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master1;
|
||||
connection master2;
|
||||
include/reset_master_slave.inc
|
||||
disconnect master2;
|
||||
|
||||
@@ -35,6 +35,7 @@ master_pos_wait('master-bin.999999',0,2,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
NULL
|
||||
Warnings:
|
||||
Warning 1210 Incorrect arguments to MASTER_CONNECTION_NAME
|
||||
connection slave;
|
||||
#
|
||||
# checking usage of default_master_connection;
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user