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

Better support MariaDB GTID for Mariabackup's --slave-info option

    XMLWordPrintable

Details

    Description

      Mariabackup's --slave-info option writes a CHANGE MASTER command to xtrabackup_slave_info:

      https://mariadb.com/kb/en/library/mariabackup-options/#-slave-info

      https://mariadb.com/kb/en/library/files-created-by-mariabackup/#xtrabackup_slave_info

      This does not currently fully support MariaDB's GTID implementation. It only fully supports MySQL's GTID implementation.

      It *does* write the CHANGE MASTER command to use master_use_gtid=slave_pos if the gtid_slave_pos system variable is non-empty. However, just because gtid_slave_pos is non-empty, that does not mean that the current slave thread has master_use_gtid=slave_pos set.

      For MySQL's GTID, it parses the SHOW SLAVE STATUS output to determine if Executed_Gtid_Set is non-empty. If it is non-empty, then it uses MySQL's GTID in the CHANGE MASTER command. This check does guarantee that the current slave thread is using GTID.

      If we wanted to make the MariaDB GTID checks as thorough as the MySQL GTID check, then we would parse SHOW SLAVE STATUS output for the "Using_Gtid" column. If the value were "no", then we would use the old log file and position. If the value were either "Slave_Pos" or "Current_Pos", then we would use GTID.

      https://mariadb.com/kb/en/library/show-slave-status/

      See here:

      https://github.com/MariaDB/server/blob/mariadb-10.4.4/extra/mariabackup/backup_mysql.cc#L1056

      https://github.com/MariaDB/server/blob/mariadb-10.4.4/extra/mariabackup/backup_mysql.cc#L1095

      https://github.com/MariaDB/server/blob/mariadb-10.4.4/extra/mariabackup/backup_mysql.cc#L1115

      We should probably change it to remove MySQL's GTID implementation and better support MariaDB's GTID implementation at some point.

      Attachments

        Issue Links

          Activity

            People

              vlad.lesin Vladislav Lesin
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 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.