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: Julius Goryavsky <julius.goryavsky@mariadb.com>
This commit is contained in:
Denis Protivensky 2024-03-27 13:39:59 +03:00 committed by Julius Goryavsky
parent 0cc9b49751
commit a4838721a2
3 changed files with 129 additions and 4 deletions

View file

@ -166,6 +166,55 @@ cluster_domain_id node_server_id seq_no
2 21 1
2 22 2
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
connection node_1;
select @@gtid_binlog_state;
@ -337,6 +386,55 @@ cluster_domain_id node_server_id seq_no
2 21 1
2 22 2
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
connection node_1;
select @@gtid_binlog_state;

View file

@ -9,11 +9,11 @@ server-id=11
[mysqld.2]
wsrep_gtid_domain_id=1
server-id=12
server-id=11
[mysqld.3]
wsrep_gtid_domain_id=1
server-id=13
server-id=11
[mysqld.4]
wsrep_gtid_domain_id=2
@ -21,8 +21,8 @@ server-id=21
[mysqld.5]
wsrep_gtid_domain_id=2
server-id=22
server-id=21
[mysqld.6]
wsrep_gtid_domain_id=2
server-id=23
server-id=21

View file

@ -11,6 +11,7 @@
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/force_restart.inc
--connection node_1
--echo cluster 1 node 1
@ -135,6 +136,19 @@ select @@gtid_binlog_state;
--source include/sync_with_master_gtid.inc
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
--connection node_1
@ -291,6 +305,19 @@ select @@gtid_binlog_state;
--source include/sync_with_master_gtid.inc
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
--connection node_1