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

Galera Cluster replication stream doesn't pass along MariaDB's GTID

    XMLWordPrintable

    Details

      Description

      If a MariaDB Galera Cluster 10.0 cluster is configured as a slave of MariaDB 10.0 using GTID, GTIDs from the master do not propagate to the WSREP replication stream. This makes it difficult to use master_use_gtid=current_pos if you ever need to switch slaves, since the non-slave nodes in the cluster won't be aware of the master's GTIDs.

      Let's say we have a replication topology like this:

      | MariaDB 10.0 | --- master_use_gtid=current_pos ---> | MariaDB Galera Cluster 10.0 (galera1) | <--- WSREP ---> | MariaDB Galera Cluster 10.0 (galera2) |

      On the master:

      MariaDB [tmp]> show global variables like 'server_id';
      +---------------+-------+
      | Variable_name | Value |
      +---------------+-------+
      | server_id     | 2     |
      +---------------+-------+
      1 row in set (0.00 sec)
       
      MariaDB [tmp]> show global variables like 'gtid_domain_id';
      +----------------+-------+
      | Variable_name  | Value |
      +----------------+-------+
      | gtid_domain_id | 22    |
      +----------------+-------+
      1 row in set (0.00 sec)
       
      MariaDB [tmp]> show global variables like 'gtid_current_pos';
      +------------------+-------+
      | Variable_name    | Value |
      +------------------+-------+
      | gtid_current_pos |       |
      +------------------+-------+
      1 row in set (0.00 sec)

      On galera1:

      MariaDB [(none)]> show global variables like 'server_id';
      +---------------+-------+
      | Variable_name | Value |
      +---------------+-------+
      | server_id     | 1     |
      +---------------+-------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> show global variables like 'gtid_domain_id';
      +----------------+-------+
      | Variable_name  | Value |
      +----------------+-------+
      | gtid_domain_id | 21    |
      +----------------+-------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> show global variables like 'gtid_current_pos';
      +------------------+--------+
      | Variable_name    | Value  |
      +------------------+--------+
      | gtid_current_pos | 21-1-3 |
      +------------------+--------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> show slave status\G
      *************************** 1. row ***************************
                     Slave_IO_State: Waiting for master to send event
                        Master_Host: 192.168.1.33
                        Master_User: repl
                        Master_Port: 3306
                      Connect_Retry: 60
                    Master_Log_File: mariadb-bin.000001
                Read_Master_Log_Pos: 314
                     Relay_Log_File: localhost-relay-bin.000002
                      Relay_Log_Pos: 603
              Relay_Master_Log_File: mariadb-bin.000001
                   Slave_IO_Running: Yes
                  Slave_SQL_Running: Yes
                    Replicate_Do_DB: 
                Replicate_Ignore_DB: 
                 Replicate_Do_Table: 
             Replicate_Ignore_Table: 
            Replicate_Wild_Do_Table: 
        Replicate_Wild_Ignore_Table: 
                         Last_Errno: 0
                         Last_Error: 
                       Skip_Counter: 0
                Exec_Master_Log_Pos: 314
                    Relay_Log_Space: 904
                    Until_Condition: None
                     Until_Log_File: 
                      Until_Log_Pos: 0
                 Master_SSL_Allowed: No
                 Master_SSL_CA_File: 
                 Master_SSL_CA_Path: 
                    Master_SSL_Cert: 
                  Master_SSL_Cipher: 
                     Master_SSL_Key: 
              Seconds_Behind_Master: 0
      Master_SSL_Verify_Server_Cert: No
                      Last_IO_Errno: 0
                      Last_IO_Error: 
                     Last_SQL_Errno: 0
                     Last_SQL_Error: 
        Replicate_Ignore_Server_Ids: 
                   Master_Server_Id: 2
                     Master_SSL_Crl: 
                 Master_SSL_Crlpath: 
                         Using_Gtid: Current_Pos
                        Gtid_IO_Pos: 21-1-3
      1 row in set (0.00 sec)

      On galera2:

      MariaDB [(none)]> show global variables like 'server_id';
      +---------------+-------+
      | Variable_name | Value |
      +---------------+-------+
      | server_id     | 1     |
      +---------------+-------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> show global variables like 'gtid_domain_id';
      +----------------+-------+
      | Variable_name  | Value |
      +----------------+-------+
      | gtid_domain_id | 21    |
      +----------------+-------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> show global variables like 'gtid_current_pos';
      +------------------+---------+
      | Variable_name    | Value   |
      +------------------+---------+
      | gtid_current_pos | 21-1-10 |
      +------------------+---------+
      1 row in set (0.00 sec)

      Now let's insert some data on the master to see how it affects gtid_current_pos:

      MariaDB [tmp]> INSERT INTO tmp.test_table VALUES (1, 'str');
      Query OK, 1 row affected (0.00 sec)
       
      MariaDB [tmp]> show global variables like 'gtid_current_pos';
      +------------------+--------+
      | Variable_name    | Value  |
      +------------------+--------+
      | gtid_current_pos | 22-2-1 |
      +------------------+--------+

      On galera1:

      MariaDB [(none)]> show global variables like 'gtid_current_pos';
      +------------------+---------------+
      | Variable_name    | Value         |
      +------------------+---------------+
      | gtid_current_pos | 22-2-1,21-1-3 |
      +------------------+---------------+
      1 row in set (0.00 sec)
       
      MariaDB [(none)]> show slave status\G
      *************************** 1. row ***************************
                     Slave_IO_State: Waiting for master to send event
                        Master_Host: 192.168.1.33
                        Master_User: repl
                        Master_Port: 3306
                      Connect_Retry: 60
                    Master_Log_File: mariadb-bin.000001
                Read_Master_Log_Pos: 485
                     Relay_Log_File: localhost-relay-bin.000002
                      Relay_Log_Pos: 774
              Relay_Master_Log_File: mariadb-bin.000001
                   Slave_IO_Running: Yes
                  Slave_SQL_Running: Yes
                    Replicate_Do_DB: 
                Replicate_Ignore_DB: 
                 Replicate_Do_Table: 
             Replicate_Ignore_Table: 
            Replicate_Wild_Do_Table: 
        Replicate_Wild_Ignore_Table: 
                         Last_Errno: 0
                         Last_Error: 
                       Skip_Counter: 0
                Exec_Master_Log_Pos: 485
                    Relay_Log_Space: 1075
                    Until_Condition: None
                     Until_Log_File: 
                      Until_Log_Pos: 0
                 Master_SSL_Allowed: No
                 Master_SSL_CA_File: 
                 Master_SSL_CA_Path: 
                    Master_SSL_Cert: 
                  Master_SSL_Cipher: 
                     Master_SSL_Key: 
              Seconds_Behind_Master: 0
      Master_SSL_Verify_Server_Cert: No
                      Last_IO_Errno: 0
                      Last_IO_Error: 
                     Last_SQL_Errno: 0
                     Last_SQL_Error: 
        Replicate_Ignore_Server_Ids: 
                   Master_Server_Id: 2
                     Master_SSL_Crl: 
                 Master_SSL_Crlpath: 
                         Using_Gtid: Current_Pos
                        Gtid_IO_Pos: 21-1-3,22-2-1
      1 row in set (0.00 sec)

      On galera2 the value is now empty:

      MariaDB [(none)]> show global variables like 'gtid_current_pos';
      +------------------+-------+
      | Variable_name    | Value |
      +------------------+-------+
      | gtid_current_pos |       |
      +------------------+-------+
      1 row in set (0.00 sec)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sachin.setiya.007 Sachin Setiya
                Reporter:
                GeoffMontee Geoff Montee
              • Votes:
                7 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: