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

FR: Allow replication from MySQL 5.6+ when GTID is enabled on the master

    Details

      Description

      Currently if MySQL 5.6 is running with GTID enabled, replication to MariaDB does not work, it breaks on the first GTID-related event (e.g. 'Previous_gtids' or 'Gtid') with

      Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
      

      If it's at all possible, I think it's fairly important to be able to replicate from MySQL 5.6 with GTID to MariaDB, as one of reasonable migration scenarios is that a production has the main pair of MySQL 5.6 master and slave (using GTID), and a second MariaDB slave is running in parallel.

      Of course it would be old-style replication, not using MariaDB GTID.

      That said, replication from MySQL 5.6 GTID to MySQL 5.6 without GTID does not work either (it fails with "The slave IO thread stops because the master has @@GLOBAL.GTID_MODE ON and this server has @@GLOBAL.GTID_MODE OFF"), so maybe it's impossible.

        Attachments

          Issue Links

            Activity

            Hide
            ryno@ryno.tv Ryan O added a comment -

            I have tried this without success on a MySQL 5.6.21 master and MariaDB 10.0.22 slave when GTID is enabled on the master. The error is:

            Last_IO_Error: The slave I/O thread stops because master does not support MariaDB global transaction id. A fatal error is encountered when it tries to SELECT @@GLOBAL.gtid_domain_id. Error: Unknown system variable 'gtid_domain_id'
            

            Is there a way to have MariaDB ignore the domain id?

            Show
            ryno@ryno.tv Ryan O added a comment - I have tried this without success on a MySQL 5.6.21 master and MariaDB 10.0.22 slave when GTID is enabled on the master. The error is: Last_IO_Error: The slave I/O thread stops because master does not support MariaDB global transaction id. A fatal error is encountered when it tries to SELECT @@GLOBAL.gtid_domain_id. Error: Unknown system variable 'gtid_domain_id' Is there a way to have MariaDB ignore the domain id?
            Hide
            danblack Daniel Black added a comment -

            Ryan O the problem here is that MariaDB is asking MySQL for the gtid_domain_id.

            It appears that you have MariaDB in GTID replication mode. MariaDB and MySQL have different GTID implementations, and that these are not compatible with each other. As such MariaDB cannot replicate from a MySQL master in GTID mode. CHANGE MASTER TO MASTER_USE_GTID=no; START SLAVE; will clear the error.

            Show
            danblack Daniel Black added a comment - Ryan O the problem here is that MariaDB is asking MySQL for the gtid_domain_id. It appears that you have MariaDB in GTID replication mode. MariaDB and MySQL have different GTID implementations, and that these are not compatible with each other. As such MariaDB cannot replicate from a MySQL master in GTID mode. CHANGE MASTER TO MASTER_USE_GTID=no; START SLAVE; will clear the error.
            Hide
            ryno@ryno.tv Ryan O added a comment -

            @Daniel Black My impression from the MariaDB website was that this should work beginning with 10.0.22.

            https://mariadb.com/kb/en/mariadb/setting-up-replication/
            *Replicating from MySQL master to MariaDB slave
            *Replicating from MySQL 5.5 to MariaDB 5.5+ should just work.
            Replicating from MySQL 5.6 without GTID to MariaDB 10+ should work.
            Replication from MySQL 5.6 with GTID, binlog_rows_query_log_events and ignorable events works starting from MariaDB 10.0.22 and MariaDB 10.1.8. In this case MariaDB will remove the MySQL GTIDs and other unneeded events and instead adds its own GTIDs.

            Thanks,
            Ryan

            Show
            ryno@ryno.tv Ryan O added a comment - @Daniel Black My impression from the MariaDB website was that this should work beginning with 10.0.22. https://mariadb.com/kb/en/mariadb/setting-up-replication/ *Replicating from MySQL master to MariaDB slave *Replicating from MySQL 5.5 to MariaDB 5.5+ should just work. Replicating from MySQL 5.6 without GTID to MariaDB 10+ should work. Replication from MySQL 5.6 with GTID, binlog_rows_query_log_events and ignorable events works starting from MariaDB 10.0.22 and MariaDB 10.1.8. In this case MariaDB will remove the MySQL GTIDs and other unneeded events and instead adds its own GTIDs. Thanks, Ryan
            Hide
            elenst Elena Stepanova added a comment - - edited

            Ryan O,
            This note refers to MySQL 5.6 with GTID, not to Replication with GTID. That is, when GTID is enabled on the MySQL 5.6 master, you can now use MariaDB 10.0 as a slave.

            Using MASTER_USE_GTID with a master which does not support MariaDB GTIDs, be it MySQL (of any version), or MariaDB 5.5 or lower, is not supported.
            Getting a failure when you explicitly set MASTER_USE_GTID on the slave and connect to a master which does not support it is a right thing to do – it's impossible to use GTID for such replication, and if the slave did not fail, the user would have an illusion that GTID is in use. This failure does not cause any damage, and this configuration would not bring any advantage – you just need to unset it as Daniel wrote above.

            Show
            elenst Elena Stepanova added a comment - - edited Ryan O , This note refers to MySQL 5.6 with GTID , not to Replication with GTID . That is, when GTID is enabled on the MySQL 5.6 master, you can now use MariaDB 10.0 as a slave. Using MASTER_USE_GTID with a master which does not support MariaDB GTIDs, be it MySQL (of any version), or MariaDB 5.5 or lower, is not supported. Getting a failure when you explicitly set MASTER_USE_GTID on the slave and connect to a master which does not support it is a right thing to do – it's impossible to use GTID for such replication, and if the slave did not fail, the user would have an illusion that GTID is in use. This failure does not cause any damage, and this configuration would not bring any advantage – you just need to unset it as Daniel wrote above.
            Hide
            ryno@ryno.tv Ryan O added a comment -

            Understood. Thank you for such a quick response.

            Show
            ryno@ryno.tv Ryan O added a comment - Understood. Thank you for such a quick response.

              People

              • Assignee:
                monty Michael Widenius
                Reporter:
                elenst Elena Stepanova
              • Votes:
                11 Vote for this issue
                Watchers:
                19 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days
                  2d