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

CREATE INDEX on temporary table breaks replication slaves

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.2.9
    • N/A
    • Replication
    • None
    • CentOS 7.4

    Description

      When attempting to create an index on a temporary table, replication on any slaves breaks with a "table does not exist" error. This is easy to reproduce. With a master and slave set up with GTID (not sure if this matters - did not test non-GTID replication) and async replication, run the following statements:

      CREATE TEMPORARY TABLE `t3` (`c1` INT, `c2` INT, PRIMARY KEY(`c1`)) ENGINE=InnoDB;
      CREATE INDEX `idx1` ON `t3` (`c2`);
      DROP TEMPORARY TABLE `t3`;

      You will find that replication on the slave has broken with the following error:

      Error 'Table 'test.t3' doesn't exist' on query. Default database: 'test'. Query: 'CREATE INDEX `idx1` ON `t3` (`c2`)'

      Curiously enough, this only seems to be an issue with CREATE INDEX. This can be observed with the following statements, which do not break replication:

      CREATE TEMPORARY TABLE `t3` (`c1` INT, `c2` INT, PRIMARY KEY(`c1`)) ENGINE=InnoDB;
      ALTER TABLE `t3` ADD INDEX `idx1` (`c2`);
      DROP TEMPORARY TABLE `t3`;

      This is especially curious as the manual suggests that CREATE INDEX is merely syntactic sugar for ALTER TABLE.

      Ideally, CREATE INDEX would not break replication slaves when used on temporary tables.

      Attachments

        Issue Links

          Activity

            Thanks for the report. We already have one for it, MDEV-9266. I'll add 10.2 to the list of affected versions there.

            elenst Elena Stepanova added a comment - Thanks for the report. We already have one for it, MDEV-9266 . I'll add 10.2 to the list of affected versions there.

            This does not seem to be the same issue, and reporter may be right about GTID

            I found this issue, on 10.3.18 (Debian 10), with this chain of servers:

            Master (mysql 5.5) --> Slave1 (MariaDB ) ---gtid replication --> Slave2 (MariaDB).

            This issue appeared in Slave2 but NOT in Slave1.

            GerMalaz Gerardo Malazdrewicz added a comment - This does not seem to be the same issue, and reporter may be right about GTID I found this issue, on 10.3.18 (Debian 10), with this chain of servers: Master (mysql 5.5) --> Slave1 (MariaDB ) ---gtid replication --> Slave2 (MariaDB). This issue appeared in Slave2 but NOT in Slave1.

            It also happened with "Using_Gtid: No"

            GerMalaz Gerardo Malazdrewicz added a comment - It also happened with "Using_Gtid: No"

            People

              Unassigned Unassigned
              neiltembo Neil Skrypuch
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.