[MDEV-26250] Attached Slave to Galera cluster Node (Master) consider Master server_id and wsrep_gtid_domain_id for local (slave) Transaction Created: 2021-07-27  Updated: 2021-09-01  Resolved: 2021-08-18

Status: Closed
Project: MariaDB Server
Component/s: Galera, Replication
Affects Version/s: 10.5.11, 10.6.3
Fix Version/s: 10.5.13, 10.6.5

Type: Bug Priority: Major
Reporter: Pramod Mahto Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File Test_case_replication_GTID.txt    
Issue Links:
Relates
relates to MDEV-26237 Actual GTID value missing with Mariab... Closed
relates to MDEV-26223 Galera cluster node consider old serv... Closed

 Description   

DC1 :-

vmc11, vmc12, vmc13

DC2

vmc21 , vmc22 , vmc 23

Unidirectional Replication :-

vmc11 (server_id=1 and wsrep_gtid_domain_id=1 )--> vmc 21 (server_id=2 and wsrep_gtid_domain_id=2 )

1. Enable WSREP GTID parameters on all node of the Galera cluster

vmc11

 
MariaDB [(none)]> select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode;
+------------------+-------------+------------------------+-------------------+
| @@gtid_domain_id | @@server_id | @@wsrep_gtid_domain_id | @@wsrep_gtid_mode |
+------------------+-------------+------------------------+-------------------+
|               11 |           1 |                      1 |                 1 |
+------------------+-------------+------------------------+-------------------+

For vmc12 gtid_domain_id=12 and vmc13 gtid_domain_id=13 rest all same as mentioned above.

 
2. Bootstrap one node.
3. Perform some DDL or DML transactions on vmc11
4. Check  GTID value, its as expected one (No issue).
5. Take mariabackup and restore the same on another DC node 1 of galera cluster.
6. Stop service--> remove data dir content--> copy back --> change ownership --> bootstrap with galera_new_cluster
7. Another Cluster node is having server_id and wsrep_gtid_domain_id as 2 

vmc21

 
MariaDB [(none)]> select @@gtid_domain_id, @@server_id, @@wsrep_gtid_domain_id,@@wsrep_gtid_mode;
+------------------+-------------+------------------------+-------------------+
| @@gtid_domain_id | @@server_id | @@wsrep_gtid_domain_id | @@wsrep_gtid_mode |
+------------------+-------------+------------------------+-------------------+
|               21 |           2 |                      2 |                 1 |
+------------------+-------------+------------------------+-------------------+

8. Perform some DDL or DML transactions on local node vmc21
9. Check the GTID value, not expected value (local transactions get stored with server_id=1 and wsrep_gtid_domain_id=1 while local node server_id=2 and wsrep_gtid_domain_id=2)
10. Now lets enable the Replication from vmc11-->vmc21 with GTID.
11. Perform some DDL or DML transaction again on vmc11
12. Check the GTID value , expected value.
13. Lets perform local transaction again on vmc21

 
MariaDB [(none)]> select @@hostname;
+------------+
| @@hostname |
+------------+
| vmc21      |
+------------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> create database sbtest100;
Query OK, 1 row affected (0.001 sec)
 
MariaDB [(none)]> drop database sbtest100;
Query OK, 0 rows affected (0.002 sec)
 
MariaDB [(none)]> show binlog events in 'mysql-bin.000002' from 892;
+------------------+------+------------+-----------+-------------+---------------------------+
| Log_name         | Pos  | Event_type | Server_id | End_log_pos | Info                      |
+------------------+------+------------+-----------+-------------+---------------------------+
| mysql-bin.000002 |  892 | Gtid       |         1 |         934 | GTID 1-1-3                |
| mysql-bin.000002 |  934 | Query      |         1 |        1036 | create database sbtest100 |
| mysql-bin.000002 | 1036 | Gtid       |         1 |        1078 | GTID 1-1-4                |
| mysql-bin.000002 | 1078 | Query      |         1 |        1178 | drop database sbtest100   |
+------------------+------+------------+-----------+-------------+---------------------------+

vmc21 :- GTID value consist of server_id and wsrep_gtid_domain_id of vmc11 i.e 1 and 1 while local server_id and wsrep_gtid_domain_id is 2 .


Generated at Thu Feb 08 09:43:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.