[MDEV-26223] Galera cluster node consider old server_id value even after modification of server_id [wsrep_gtid_mode=ON] Created: 2021-07-23  Updated: 2022-01-27  Resolved: 2022-01-27

Status: Closed
Project: MariaDB Server
Component/s: Galera, Server
Affects Version/s: 10.5.11, 10.6.3
Fix Version/s: 10.5.14, 10.6.6, 10.7.2

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

Attachments: Text File Reproducible_test_case_with_extracted_Binary_log.txt     File my.cnf    
Issue Links:
Relates
relates to MDEV-26240 In Galera Cluster, when init gtid do... Open
relates to MDEV-26250 Attached Slave to Galera cluster Node... Closed
relates to MDEV-26237 Actual GTID value missing with Mariab... Closed

 Description   

1. Fresh installation of 10.5.11 or 10.6.3
2. bootstrap one galera node with server-id=600
3. create one database
4. Check the server_id value with in GTID : Its 600
5. stop the node
6. change the server id=800
7. Bootstrap the node
8. create one more database
9. check gtid value : Its still taking server-id=600 rather than taking 800
10. Add another node to this Galera cluster
11. create one more database
12. check gtid value : Its still taking server-id=600 rather than taking 800

server_id=600

 
MariaDB [(none)]> show global status  like '%wsrep_cluster_s%';
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_size       | 1                                    |
| wsrep_cluster_state_uuid | ed1d4249-ee72-11eb-862d-eb9f56d82d4a |
| wsrep_cluster_status     | Primary                              |
+--------------------------+--------------------------------------+
3 rows in set (0.001 sec)
 
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 |         600 |                      1 |                 1 |
+------------------+-------------+------------------------+-------------------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> show global variables  like '%gtid%';
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| gtid_binlog_pos         |       |
| gtid_binlog_state       |       |
| gtid_cleanup_batch_size | 64    |
| gtid_current_pos        |       |
| gtid_domain_id          | 11    |
| gtid_ignore_duplicates  | ON    |
| gtid_pos_auto_engines   |       |
| gtid_slave_pos          |       |
| gtid_strict_mode        | OFF   |
| wsrep_gtid_domain_id    | 1     |
| wsrep_gtid_mode         | ON    |
+-------------------------+-------+
11 rows in set (0.001 sec)
 
MariaDB [(none)]> show master status;
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000003 |      328 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> create database sbtest;
Query OK, 1 row affected (0.001 sec)
 
MariaDB [(none)]> show global variables  like '%gtid%';
+-------------------------+---------+
| Variable_name           | Value   |
+-------------------------+---------+
| gtid_binlog_pos         | 1-600-1 |
| gtid_binlog_state       | 1-600-1 |
| gtid_cleanup_batch_size | 64      |
| gtid_current_pos        | 1-600-1 |
| gtid_domain_id          | 11      |
| gtid_ignore_duplicates  | ON      |
| gtid_pos_auto_engines   |         |
| gtid_slave_pos          |         |
| gtid_strict_mode        | OFF     |
| wsrep_gtid_domain_id    | 1       |
| wsrep_gtid_mode         | ON      |
+-------------------------+---------+
11 rows in set (0.001 sec)
 
 
 
MariaDB [(none)]> show binlog events in 'mysql-bin.000003';
+------------------+-----+-------------------+-----------+-------------+------------------------------------------------+
| Log_name         | Pos | Event_type        | Server_id | End_log_pos | Info                                           |
+------------------+-----+-------------------+-----------+-------------+------------------------------------------------+
| mysql-bin.000003 |   4 | Format_desc       |       600 |         256 | Server ver: 10.5.11-MariaDB-log, Binlog ver: 4 |
| mysql-bin.000003 | 256 | Gtid_list         |       600 |         285 | []                                             |
| mysql-bin.000003 | 285 | Binlog_checkpoint |       600 |         328 | mysql-bin.000003                               |
| mysql-bin.000003 | 328 | Gtid              |       600 |         370 | GTID 1-600-1                                   |
| mysql-bin.000003 | 370 | Query             |       600 |         466 | create database sbtest                         |
+------------------+-----+-------------------+-----------+-------------+------------------------------------------------+
5 rows in set (0.000 sec)

Change of server_id=800

[root@vmc11 mysql]# cat /etc/my.cnf |grep -i server-id
server-id=800
[root@vmc11 mysql]# cat /etc/my.cnf |grep -i wsrep_on
wsrep_on=1
[root@vmc11 mysql]# galera_new_cluster
[root@vmc11 mysql]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.5.11-MariaDB-log MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> show global status  like '%wsrep_cluster_s%';
+--------------------------+--------------------------------------+
| Variable_name            | Value                                |
+--------------------------+--------------------------------------+
| wsrep_cluster_size       | 1                                    |
| wsrep_cluster_state_uuid | ed1d4249-ee72-11eb-862d-eb9f56d82d4a |
| wsrep_cluster_status     | Primary                              |
+--------------------------+--------------------------------------+
3 rows in set (0.001 sec)
 
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 |         800 |                      1 |                 1 |
+------------------+-------------+------------------------+-------------------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> show global variables  like '%gtid%';
+-------------------------+---------+
| Variable_name           | Value   |
+-------------------------+---------+
| gtid_binlog_pos         | 1-600-1 |
| gtid_binlog_state       | 1-600-1 |
| gtid_cleanup_batch_size | 64      |
| gtid_current_pos        |         |
| gtid_domain_id          | 11      |
| gtid_ignore_duplicates  | ON      |
| gtid_pos_auto_engines   |         |
| gtid_slave_pos          |         |
| gtid_strict_mode        | OFF     |
| wsrep_gtid_domain_id    | 1       |
| wsrep_gtid_mode         | ON      |
+-------------------------+---------+
11 rows in set (0.001 sec)
 
MariaDB [(none)]> show master status;
+------------------+----------+--------------+------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+--------------+------------------+
| mysql-bin.000005 |      342 |              |                  |
+------------------+----------+--------------+------------------+
1 row in set (0.000 sec)
 
MariaDB [(none)]> drop database sbtest;
Query OK, 0 rows affected (0.002 sec)
 
MariaDB [(none)]> create database sbtest;
Query OK, 1 row affected (0.001 sec)
 
MariaDB [(none)]> show global variables  like '%gtid%';
+-------------------------+---------+
| Variable_name           | Value   |
+-------------------------+---------+
| gtid_binlog_pos         | 1-600-3 |
| gtid_binlog_state       | 1-600-3 |
| gtid_cleanup_batch_size | 64      |
| gtid_current_pos        |         |
| gtid_domain_id          | 11      |
| gtid_ignore_duplicates  | ON      |
| gtid_pos_auto_engines   |         |
| gtid_slave_pos          |         |
| gtid_strict_mode        | OFF     |
| wsrep_gtid_domain_id    | 1       |
| wsrep_gtid_mode         | ON      |
+-------------------------+---------+
11 rows in set (0.001 sec)
 
 
 
MariaDB [(none)]> show binlog events in 'mysql-bin.000005' from 342;
+------------------+-----+------------+-----------+-------------+------------------------+
| Log_name         | Pos | Event_type | Server_id | End_log_pos | Info                   |
+------------------+-----+------------+-----------+-------------+------------------------+
| mysql-bin.000005 | 342 | Gtid       |       600 |         384 | GTID 1-600-2           |
| mysql-bin.000005 | 384 | Query      |       600 |         478 | drop database sbtest   |
| mysql-bin.000005 | 478 | Gtid       |       600 |         520 | GTID 1-600-3           |
| mysql-bin.000005 | 520 | Query      |       600 |         616 | create database sbtest |
+------------------+-----+------------+-----------+-------------+------------------------+



 Comments   
Comment by Mario Karuza (Inactive) [ 2021-07-26 ]

Hi,

Logs and configuration files so i can take look into it.

Comment by Mario Karuza (Inactive) [ 2022-01-13 ]

Server id are not used on non bootstrap nodes (one which are not started with --wsrep-new-cluster) because having different server id on different nodes can lead to GTID inconsistency in cluster.

For bootstrap nodes, i have done manual testing and each time new server-id is taken into account when flag --wsrep-new-cluster is used.

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