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

gtid_ignore_duplicates treats gtid_seq_no as 32-bit

    XMLWordPrintable

Details

    Description

      gtid_ignore_duplicates treats gtid_seq_no as 32-bit.

      On the master, let's insert some data:

      MariaDB [(none)]> SET SESSION gtid_domain_id=102;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [(none)]> SET SESSION gtid_seq_no=4294967294;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [(none)]> INSERT INTO db1.test_table VALUES (1, 'str');
      Query OK, 1 row affected (0.00 sec)
       
      MariaDB [(none)]> SET SESSION gtid_domain_id=102;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [(none)]> SET SESSION gtid_seq_no=4294967295;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [(none)]> INSERT INTO db1.test_table VALUES (2, 'str');
      Query OK, 1 row affected (0.00 sec)
       
      MariaDB [(none)]> SET SESSION gtid_domain_id=102;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [(none)]> SET SESSION gtid_seq_no=4294967296;
      Query OK, 0 rows affected (0.01 sec)
       
      MariaDB [(none)]> INSERT INTO db1.test_table VALUES (3, 'str');
      Query OK, 1 row affected (0.00 sec)

      On the slave, the last insert was ignored:

      MariaDB [(none)]> SELECT * FROM db1.test_table;
      +----+------+
      | id | str  |
      +----+------+
      |  1 | str  |
      |  2 | str  |
      +----+------+
      2 rows 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.000005
                Read_Master_Log_Pos: 3192
                     Relay_Log_File: master-relay-bin.000002
                      Relay_Log_Pos: 1367
              Relay_Master_Log_File: mariadb-bin.000005
                   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: 3192
                    Relay_Log_Space: 1665
                    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: Slave_Pos
                        Gtid_IO_Pos: 101-2-4294967296,100-2-1000000000003,22-2-24,102-2-4294967296,1-2-10001
      1 row in set (0.00 sec)

      The source code appears to cast gtid_seq_no as uint32 here:

      https://github.com/MariaDB/server/blob/d258f5ff0435cbd8b000226dc7dc3ec4e9b79cbc/sql/rpl_gtid.cc#L120

      Attachments

        Activity

          People

            knielsen Kristian Nielsen
            GeoffMontee Geoff Montee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.