Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26223

Galera cluster node consider old server_id value even after modification of server_id [wsrep_gtid_mode=ON]

    XMLWordPrintable

    Details

      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 |
      +------------------+-----+------------+-----------+-------------+------------------------+
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jplindst Jan Lindström
              Reporter:
              pramod.mahto@mariadb.com Pramod Mahto
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.