Commit a4838721 authored by Denis Protivensky's avatar Denis Protivensky Committed by Julius Goryavsky

MDEV-32633: Fix Galera cluster <-> native replication interaction

GTID events are applied without a running server transaction,
we need to set next transaction ID for Wsrep transaction.

The whole Galera cluster now has a single GTID value (including
the server ID throughout the cluster), fix the config accordingly.

Add force restart so that repeated MTR test execution prints
consistent GTID values, otherwise they would have been recovered
from the previous run.
Signed-off-by: default avatarJulius Goryavsky <julius.goryavsky@mariadb.com>
parent 0cc9b497
...@@ -166,6 +166,55 @@ cluster_domain_id node_server_id seq_no ...@@ -166,6 +166,55 @@ cluster_domain_id node_server_id seq_no
2 21 1 2 21 1
2 22 2 2 22 2
2 23 3 2 23 3
# check other nodes are consistent
connection node_2;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-4,2-21-3
select * from t1 order by 1, 2, 3;
cluster_domain_id node_server_id seq_no
1 11 2
1 12 3
1 13 4
2 21 1
2 22 2
2 23 3
connection node_3;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-4,2-21-3
select * from t1 order by 1, 2, 3;
cluster_domain_id node_server_id seq_no
1 11 2
1 12 3
1 13 4
2 21 1
2 22 2
2 23 3
connection node_5;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-4,2-21-3
select * from t1 order by 1, 2, 3;
cluster_domain_id node_server_id seq_no
1 11 2
1 12 3
1 13 4
2 21 1
2 22 2
2 23 3
connection node_6;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-4,2-21-3
select * from t1 order by 1, 2, 3;
cluster_domain_id node_server_id seq_no
1 11 2
1 12 3
1 13 4
2 21 1
2 22 2
2 23 3
cluster 1 node 1 cluster 1 node 1
connection node_1; connection node_1;
select @@gtid_binlog_state; select @@gtid_binlog_state;
...@@ -337,6 +386,55 @@ cluster_domain_id node_server_id seq_no ...@@ -337,6 +386,55 @@ cluster_domain_id node_server_id seq_no
2 21 1 2 21 1
2 22 2 2 22 2
2 23 3 2 23 3
# check other nodes are consistent
connection node_2;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-9,2-21-6
select * from t1 order by 1, 2, 3;
cluster_domain_id node_server_id seq_no
1 11 2
1 12 3
1 13 4
2 21 1
2 22 2
2 23 3
connection node_3;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-9,2-21-6
select * from t1 order by 1, 2, 3;
cluster_domain_id node_server_id seq_no
1 11 2
1 12 3
1 13 4
2 21 1
2 22 2
2 23 3
connection node_5;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-9,2-21-6
select * from t1 order by 1, 2, 3;
cluster_domain_id node_server_id seq_no
1 11 2
1 12 3
1 13 4
2 21 1
2 22 2
2 23 3
connection node_6;
select @@gtid_binlog_state;
@@gtid_binlog_state
1-11-9,2-21-6
select * from t1 order by 1, 2, 3;
cluster_domain_id node_server_id seq_no
1 11 2
1 12 3
1 13 4
2 21 1
2 22 2
2 23 3
cluster 1 node 1 cluster 1 node 1
connection node_1; connection node_1;
select @@gtid_binlog_state; select @@gtid_binlog_state;
......
...@@ -9,11 +9,11 @@ server-id=11 ...@@ -9,11 +9,11 @@ server-id=11
[mysqld.2] [mysqld.2]
wsrep_gtid_domain_id=1 wsrep_gtid_domain_id=1
server-id=12 server-id=11
[mysqld.3] [mysqld.3]
wsrep_gtid_domain_id=1 wsrep_gtid_domain_id=1
server-id=13 server-id=11
[mysqld.4] [mysqld.4]
wsrep_gtid_domain_id=2 wsrep_gtid_domain_id=2
...@@ -21,8 +21,8 @@ server-id=21 ...@@ -21,8 +21,8 @@ server-id=21
[mysqld.5] [mysqld.5]
wsrep_gtid_domain_id=2 wsrep_gtid_domain_id=2
server-id=22 server-id=21
[mysqld.6] [mysqld.6]
wsrep_gtid_domain_id=2 wsrep_gtid_domain_id=2
server-id=23 server-id=21
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
--source include/big_test.inc --source include/big_test.inc
--source include/galera_cluster.inc --source include/galera_cluster.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/force_restart.inc
--connection node_1 --connection node_1
--echo cluster 1 node 1 --echo cluster 1 node 1
...@@ -135,6 +136,19 @@ select @@gtid_binlog_state; ...@@ -135,6 +136,19 @@ select @@gtid_binlog_state;
--source include/sync_with_master_gtid.inc --source include/sync_with_master_gtid.inc
select * from t1 order by 1, 2, 3; select * from t1 order by 1, 2, 3;
--echo # check other nodes are consistent
--connection node_2
select @@gtid_binlog_state;
select * from t1 order by 1, 2, 3;
--connection node_3
select @@gtid_binlog_state;
select * from t1 order by 1, 2, 3;
--connection node_5
select @@gtid_binlog_state;
select * from t1 order by 1, 2, 3;
--connection node_6
select @@gtid_binlog_state;
select * from t1 order by 1, 2, 3;
--echo cluster 1 node 1 --echo cluster 1 node 1
--connection node_1 --connection node_1
...@@ -291,6 +305,19 @@ select @@gtid_binlog_state; ...@@ -291,6 +305,19 @@ select @@gtid_binlog_state;
--source include/sync_with_master_gtid.inc --source include/sync_with_master_gtid.inc
select * from t1 order by 1, 2, 3; select * from t1 order by 1, 2, 3;
--echo # check other nodes are consistent
--connection node_2
select @@gtid_binlog_state;
select * from t1 order by 1, 2, 3;
--connection node_3
select @@gtid_binlog_state;
select * from t1 order by 1, 2, 3;
--connection node_5
select @@gtid_binlog_state;
select * from t1 order by 1, 2, 3;
--connection node_6
select @@gtid_binlog_state;
select * from t1 order by 1, 2, 3;
--echo cluster 1 node 1 --echo cluster 1 node 1
--connection node_1 --connection node_1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment