Skip to content

Commit aa3dd63

Browse files
committed
Merge branch '10.6' into '10.11'
2 parents ee204ee + 8dae715 commit aa3dd63

13 files changed

+377
-12
lines changed
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
connection node_2;
2+
connection node_1;
3+
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
4+
connection node_2;
5+
START SLAVE;
6+
connection node_3;
7+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
8+
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
9+
CREATE TABLE t3 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
10+
connection node_2;
11+
connection node_1;
12+
#
13+
# Set up replication filtering this should work for slave
14+
#
15+
connection node_2;
16+
STOP SLAVE;
17+
SET GLOBAL replicate_ignore_table='test.t2,mysql.gtid_slave_pos';
18+
SELECT @@replicate_ignore_table;
19+
@@replicate_ignore_table
20+
mysql.gtid_slave_pos,test.t2
21+
START SLAVE;
22+
#
23+
# Set up replication filtering, this should not have any effect
24+
#
25+
connection node_1;
26+
SET GLOBAL replicate_ignore_table='test.t2,mysql.gtid_slave_pos';
27+
SELECT @@replicate_ignore_table;
28+
@@replicate_ignore_table
29+
mysql.gtid_slave_pos,test.t2
30+
#
31+
# Insert data to MariaDB master, inserts to t2 should not be on slave
32+
#
33+
connection node_3;
34+
INSERT INTO t1 SELECT * FROM seq_1_to_100;
35+
INSERT INTO t2 SELECT * FROM seq_1_to_100;
36+
INSERT INTO t3 SELECT * FROM seq_1_to_100;
37+
SELECT COUNT(*) FROM t1;
38+
COUNT(*)
39+
100
40+
SELECT COUNT(*) FROM t2;
41+
COUNT(*)
42+
100
43+
SELECT COUNT(*) FROM t3;
44+
COUNT(*)
45+
100
46+
connection node_2;
47+
SELECT COUNT(*) AS EXPECT_100 FROM t1;
48+
EXPECT_100
49+
100
50+
SELECT COUNT(*) AS EXPECT_0 FROM t2;
51+
EXPECT_0
52+
0
53+
SELECT COUNT(*) AS EXPECT_100 FROM t3;
54+
EXPECT_100
55+
100
56+
#
57+
# Insert data to Galera node_2, all these should be replicated
58+
#
59+
INSERT INTO t1 SELECT * FROM seq_101_to_200;
60+
INSERT INTO t2 SELECT * FROM seq_101_to_200;
61+
INSERT INTO t3 SELECT * FROM seq_101_to_200;
62+
SELECT COUNT(*) AS EXPECT_200 FROM t1;
63+
EXPECT_200
64+
200
65+
SELECT COUNT(*) AS EXPECT_100 FROM t2;
66+
EXPECT_100
67+
100
68+
SELECT COUNT(*) AS EXPECT_200 FROM t3;
69+
EXPECT_200
70+
200
71+
connection node_1;
72+
SELECT COUNT(*) AS EXPECT_200 FROM t1;
73+
EXPECT_200
74+
200
75+
SELECT COUNT(*) AS EXPECT_100 FROM t2;
76+
EXPECT_100
77+
100
78+
SELECT COUNT(*) AS EXPECT_200 FROM t3;
79+
EXPECT_200
80+
200
81+
#
82+
# Insert data to Galera node_1, all these should be replicated
83+
#
84+
INSERT INTO t1 SELECT * FROM seq_201_to_300;
85+
INSERT INTO t2 SELECT * FROM seq_201_to_300;
86+
INSERT INTO t3 SELECT * FROM seq_201_to_300;
87+
SELECT COUNT(*) AS EXPECT_300 FROM t1;
88+
EXPECT_300
89+
300
90+
SELECT COUNT(*) AS EXPECT_200 FROM t2;
91+
EXPECT_200
92+
200
93+
SELECT COUNT(*) AS EXPECT_300 FROM t3;
94+
EXPECT_300
95+
300
96+
connection node_3;
97+
SELECT @@GLOBAL.gtid_slave_pos;
98+
@@GLOBAL.gtid_slave_pos
99+
100+
connection node_1;
101+
SELECT COUNT(*) AS EXPECT_300 FROM t1;
102+
EXPECT_300
103+
300
104+
SELECT COUNT(*) AS EXPECT_200 FROM t2;
105+
EXPECT_200
106+
200
107+
SELECT COUNT(*) AS EXPECT_300 FROM t3;
108+
EXPECT_300
109+
300
110+
SELECT @@GLOBAL.gtid_slave_pos;
111+
@@GLOBAL.gtid_slave_pos
112+
0-3-6
113+
connection node_2;
114+
SELECT COUNT(*) AS EXPECT_300 FROM t1;
115+
EXPECT_300
116+
300
117+
SELECT COUNT(*) AS EXPECT_200 FROM t2;
118+
EXPECT_200
119+
200
120+
SELECT COUNT(*) AS EXPECT_300 FROM t3;
121+
EXPECT_300
122+
300
123+
SELECT @@GLOBAL.gtid_slave_pos;
124+
@@GLOBAL.gtid_slave_pos
125+
0-3-6
126+
connection node_2;
127+
STOP SLAVE;
128+
RESET SLAVE ALL;
129+
SET GLOBAL replicate_ignore_table='';
130+
connection node_1;
131+
SET GLOBAL replicate_ignore_table='';
132+
connection node_3;
133+
DROP TABLE t1,t2,t3;
134+
connection node_2;
135+
DROP TABLE t1,t2,t3;
136+
connection node_3;
137+
RESET MASTER;

mysql-test/suite/galera/r/galera_binlog_stmt_autoinc.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ wsrep_auto_increment_control ON
198198
SET GLOBAL wsrep_auto_increment_control='OFF';
199199
show variables like '%auto_increment%';
200200
Variable_name Value
201-
auto_increment_increment 1
201+
auto_increment_increment 2
202202
auto_increment_offset 2
203203
wsrep_auto_increment_control OFF
204204
SET GLOBAL wsrep_auto_increment_control='ON';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
!include ../galera_2nodes_as_slave.cnf
2+
3+
[mariadbd.1]
4+
wsrep-gtid-mode=ON
5+
log-bin
6+
log-slave-updates
7+
8+
[mariadbd.2]
9+
wsrep-gtid-mode=ON
10+
log-bin
11+
log-slave-updates
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
#
2+
# Test Galera as a slave to a MySQL master
3+
#
4+
# The galera/galera_2node_slave.cnf describes the setup of the nodes
5+
#
6+
# mariadb master (node_3) ----async replication--->galera node_2 <---galera replication-->node_1
7+
#
8+
9+
--source include/have_innodb.inc
10+
--source include/galera_cluster.inc
11+
--source include/have_sequence.inc
12+
13+
# As node #3 is not a Galera node, and galera_cluster.inc does not open connetion to it
14+
# we open the node_3 connection here
15+
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
16+
17+
--connection node_2
18+
--disable_query_log
19+
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3;
20+
--enable_query_log
21+
START SLAVE;
22+
23+
--connection node_3
24+
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
25+
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
26+
CREATE TABLE t3 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
27+
28+
--connection node_2
29+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
30+
--source include/wait_condition.inc
31+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
32+
--source include/wait_condition.inc
33+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't3';
34+
--source include/wait_condition.inc
35+
36+
--connection node_1
37+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
38+
--source include/wait_condition.inc
39+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
40+
--source include/wait_condition.inc
41+
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't3';
42+
--source include/wait_condition.inc
43+
44+
--echo #
45+
--echo # Set up replication filtering this should work for slave
46+
--echo #
47+
--connection node_2
48+
STOP SLAVE;
49+
SET GLOBAL replicate_ignore_table='test.t2,mysql.gtid_slave_pos';
50+
SELECT @@replicate_ignore_table;
51+
--disable_query_log
52+
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3;
53+
--enable_query_log
54+
START SLAVE;
55+
56+
--echo #
57+
--echo # Set up replication filtering, this should not have any effect
58+
--echo #
59+
--connection node_1
60+
SET GLOBAL replicate_ignore_table='test.t2,mysql.gtid_slave_pos';
61+
SELECT @@replicate_ignore_table;
62+
63+
--echo #
64+
--echo # Insert data to MariaDB master, inserts to t2 should not be on slave
65+
--echo #
66+
--connection node_3
67+
INSERT INTO t1 SELECT * FROM seq_1_to_100;
68+
INSERT INTO t2 SELECT * FROM seq_1_to_100;
69+
INSERT INTO t3 SELECT * FROM seq_1_to_100;
70+
SELECT COUNT(*) FROM t1;
71+
SELECT COUNT(*) FROM t2;
72+
SELECT COUNT(*) FROM t3;
73+
74+
--connection node_2
75+
--let $wait_condition = SELECT COUNT(*) = 100 FROM t1;
76+
--source include/wait_condition.inc
77+
--let $wait_condition = SELECT COUNT(*) = 100 FROM t3;
78+
--source include/wait_condition.inc
79+
80+
SELECT COUNT(*) AS EXPECT_100 FROM t1;
81+
SELECT COUNT(*) AS EXPECT_0 FROM t2;
82+
SELECT COUNT(*) AS EXPECT_100 FROM t3;
83+
84+
--echo #
85+
--echo # Insert data to Galera node_2, all these should be replicated
86+
--echo #
87+
INSERT INTO t1 SELECT * FROM seq_101_to_200;
88+
INSERT INTO t2 SELECT * FROM seq_101_to_200;
89+
INSERT INTO t3 SELECT * FROM seq_101_to_200;
90+
SELECT COUNT(*) AS EXPECT_200 FROM t1;
91+
SELECT COUNT(*) AS EXPECT_100 FROM t2;
92+
SELECT COUNT(*) AS EXPECT_200 FROM t3;
93+
94+
--connection node_1
95+
--let $wait_condition = SELECT COUNT(*) = 200 FROM t3;
96+
--source include/wait_condition.inc
97+
SELECT COUNT(*) AS EXPECT_200 FROM t1;
98+
SELECT COUNT(*) AS EXPECT_100 FROM t2;
99+
SELECT COUNT(*) AS EXPECT_200 FROM t3;
100+
101+
--echo #
102+
--echo # Insert data to Galera node_1, all these should be replicated
103+
--echo #
104+
INSERT INTO t1 SELECT * FROM seq_201_to_300;
105+
INSERT INTO t2 SELECT * FROM seq_201_to_300;
106+
INSERT INTO t3 SELECT * FROM seq_201_to_300;
107+
108+
SELECT COUNT(*) AS EXPECT_300 FROM t1;
109+
SELECT COUNT(*) AS EXPECT_200 FROM t2;
110+
SELECT COUNT(*) AS EXPECT_300 FROM t3;
111+
112+
--connection node_3
113+
SELECT @@GLOBAL.gtid_slave_pos;
114+
115+
--connection node_1
116+
--let $wait_condition = SELECT COUNT(*) = 300 FROM t3;
117+
--source include/wait_condition.inc
118+
SELECT COUNT(*) AS EXPECT_300 FROM t1;
119+
SELECT COUNT(*) AS EXPECT_200 FROM t2;
120+
SELECT COUNT(*) AS EXPECT_300 FROM t3;
121+
SELECT @@GLOBAL.gtid_slave_pos;
122+
123+
--connection node_2
124+
--let $wait_condition = SELECT COUNT(*) = 300 FROM t3;
125+
--source include/wait_condition.inc
126+
SELECT COUNT(*) AS EXPECT_300 FROM t1;
127+
SELECT COUNT(*) AS EXPECT_200 FROM t2;
128+
SELECT COUNT(*) AS EXPECT_300 FROM t3;
129+
SELECT @@GLOBAL.gtid_slave_pos;
130+
131+
--connection node_2
132+
STOP SLAVE;
133+
RESET SLAVE ALL;
134+
SET GLOBAL replicate_ignore_table='';
135+
136+
--connection node_1
137+
SET GLOBAL replicate_ignore_table='';
138+
139+
--connection node_3
140+
DROP TABLE t1,t2,t3;
141+
142+
--connection node_2
143+
DROP TABLE t1,t2,t3;
144+
145+
--connection node_3
146+
RESET MASTER;

mysql-test/suite/galera/t/galera_binlog_stmt_autoinc.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[mysqld.1]
44
auto_increment_offset=1
5-
auto_increment_increment=1
5+
auto_increment_increment=2
66

77
[mysqld.2]
88
auto_increment_offset=2
9-
auto_increment_increment=1
9+
auto_increment_increment=2

mysql-test/suite/galera/t/galera_defaults.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
--source include/force_restart.inc
1414

1515
# Make sure that the test is operating on the right version of galera library.
16-
--let $galera_version=26.4.21
16+
--let $galera_version=26.4.23
1717
source ../wsrep/include/check_galera_version.inc;
1818

1919
# Global Variables

mysql-test/suite/galera/t/galera_fk_truncate.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[mysqld.1]
44
auto_increment_offset=1
5-
auto_increment_increment=1
5+
auto_increment_increment=2
66

77
[mysqld.2]
88
auto_increment_offset=2
9-
auto_increment_increment=1
9+
auto_increment_increment=2
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
connection node_2;
2+
connection node_1;
3+
# Correct Galera library found
4+
connection node_1;
5+
connection node_2;
6+
connection node_3;
7+
connection node_3;
8+
connection node_2;
9+
connection node_3;
10+
# restart
11+
include/assert_grep.inc [DONOR]
12+
include/assert_grep.inc [DONOR]

mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
[mysqld.1]
44
wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1M'
5-
auto_increment_increment=1
5+
auto_increment_increment=3
66
auto_increment_offset=1
77
# this will force server restarts before this test
88
loose-galera-ist-gcache-rollover=1
99
wsrep-debug=1
1010

1111
[mysqld.2]
1212
wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=1M'
13-
auto_increment_increment=2
13+
auto_increment_increment=3
1414
auto_increment_offset=2
1515
loose-galera-ist-gcache-rollover=2
1616
wsrep-debug=1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
!include ../galera_3nodes.cnf
2+
3+
[mysqld.2]
4+
wsrep_provider_options="gcs.stateless=1"
5+
6+
# make node3 prefer node2 for donor, but also allow other nodes
7+
[mysqld.3]
8+
wsrep_sst_donor=node2,

0 commit comments

Comments
 (0)