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

Creating index on temporaray table breaks replication

Details

    • 10.2.11, 10.2.12, 10.0.34, 10.2.14, 10.1.32

    Description

      Creating an index on temporary table breaks (row based) replication.

      On the master execute the following SQL statements:

      create temporary table TMP_FOO( bar int not null) engine=memory;
      create index tmp_idx01 on TMP_FOO(bar);
      

      On the slave we get the following error:

      Error 'Table 'mmm_data.TMP_FOO' doesn't exist' on query. Default database: 'mmm_data'. Query: 'create index tmp_idx01 on TMP_FOO(bar)'
      

      Configuration of master:

      log-bin                         = mysql-bin
      server-id                       = 4
      log_bin_trust_function_creators = 1
      binlog_format                   = row
      slave_compressed_protocol       = 1
      #sync_binlog                    = 1
      expire_logs_days                = 35
      binlog-ignore-db                = mmm_temp
      

      Configuration of slave:

      server-id                       = 5
      log_bin_trust_function_creators = 1
      log-bin                         = myslave2-bin
      relay-log                       = myslave2-relay-bin
      binlog_format                   = row
      log-slave-updates               = 1
      sync_binlog                     = 1
      expire_logs_days                = 35
      slave_compressed_protocol       = 1
      

      Work a round: On the slave set slave-skip-errors in my.cnf:

      slave-skip-errors = 1146
      

      Note: The master and slave server run the same OS and MariaDB versions.

      Attachments

        Issue Links

          Activity

            water P.R. Water created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Status Open [ 1 ] Confirmed [ 10101 ]

            Thanks for the report.
            Somehow in 10.x CREATE INDEX for a temporary table ends up in the binary log, while it should not.

            Another workaround is to use ALTER TABLE .. ADD INDEX instead of CREATE INDEX.

            elenst Elena Stepanova added a comment - Thanks for the report. Somehow in 10.x CREATE INDEX for a temporary table ends up in the binary log, while it should not. Another workaround is to use ALTER TABLE .. ADD INDEX instead of CREATE INDEX .
            elenst Elena Stepanova made changes -
            Fix Version/s 10.0 [ 16000 ]
            Fix Version/s 10.1 [ 16100 ]
            Affects Version/s 10.0 [ 16000 ]
            Affects Version/s 10.1 [ 16100 ]
            Affects Version/s 10.0.22-galera [ 19801 ]
            Assignee Kristian Nielsen [ knielsen ]
            marc.langevin@usherbrooke.ca Marc added a comment - - edited

            We have also hit this issue with MariaDB 10.1.13, on Red Hat 6 64 bits.

            Since the create index on the temporary table is generated by a third party application, we used the variable replication_wild_ignore_table as a workaround.

            Any date known for the resolution of this issue?

            Regards,

            Marc

            marc.langevin@usherbrooke.ca Marc added a comment - - edited We have also hit this issue with MariaDB 10.1.13, on Red Hat 6 64 bits. Since the create index on the temporary table is generated by a third party application, we used the variable replication_wild_ignore_table as a workaround. Any date known for the resolution of this issue? Regards, Marc

            This is still happens in 10.1.28. Upstream MySQL 5.6.x (checked on 5.6.29) is NOT affected.

            valerii Valerii Kravchuk added a comment - This is still happens in 10.1.28. Upstream MySQL 5.6.x (checked on 5.6.29) is NOT affected.
            valerii Valerii Kravchuk made changes -
            Labels upstream-not-affected
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            Fix Version/s 10.2 [ 14601 ]
            Affects Version/s 10.2 [ 14601 ]
            Assignee Kristian Nielsen [ knielsen ] Andrei Elkin [ elkin ]

            10.2 and 10.3 are also affected.

            elenst Elena Stepanova added a comment - 10.2 and 10.3 are also affected.
            serg Sergei Golubchik made changes -
            Sprint 10.2.11 [ 203 ]
            valerii Valerii Kravchuk made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            Elkin Andrei Elkin made changes -
            Sprint 10.2.11 [ 203 ] 10.2.11, 10.2.12 [ 203, 216 ]
            serg Sergei Golubchik made changes -
            Sprint 10.2.11, 10.2.12 [ 203, 216 ] 10.2.11, 10.2.12, 10.0.34 [ 203, 216, 224 ]
            Elkin Andrei Elkin made changes -
            Sprint 10.2.11, 10.2.12, 10.0.34 [ 203, 216, 224 ] 10.2.11, 10.2.12, 10.0.34, 10.2.14 [ 203, 216, 224, 229 ]
            Elkin Andrei Elkin made changes -
            Sprint 10.2.11, 10.2.12, 10.0.34, 10.2.14 [ 203, 216, 224, 229 ] 10.2.11, 10.2.12, 10.0.34, 10.2.14, 10.1.32 [ 203, 216, 224, 229, 235 ]
            Elkin Andrei Elkin made changes -
            Assignee Andrei Elkin [ elkin ] Sachin Setiya [ sachin.setiya.007 ]
            sachin.setiya.007 Sachin Setiya (Inactive) added a comment - - edited

            A mtr test case

            -- source include/have_binlog_format_row.inc
            -- source include/master-slave.inc
             
            --connection master
            create temporary table t1(a int);
            create index index_t1 on t1(a);
            insert into t1 values(1);
             
            --sync_slave_with_master
            --error ER_NO_SUCH_TABLE
            select * from t1;
             
            --connection master
            drop table t1;
             
            --source include/rpl_end.inc
            
            

            sachin.setiya.007 Sachin Setiya (Inactive) added a comment - - edited A mtr test case -- source include/have_binlog_format_row.inc -- source include/master-slave.inc   --connection master create temporary table t1(a int ); create index index_t1 on t1(a); insert into t1 values (1);   --sync_slave_with_master --error ER_NO_SUCH_TABLE select * from t1;   --connection master drop table t1;   --source include/rpl_end.inc
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            sachin.setiya.007 Sachin Setiya (Inactive) added a comment - - edited http://lists.askmonty.org/pipermail/commits/2018-May/012475.html http://buildbot.askmonty.org/buildbot/grid?category=main&branch=bb-mdev-9266
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Assignee Sachin Setiya [ sachin.setiya.007 ] Andrei Elkin [ elkin ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            sachin.setiya.007 Sachin Setiya (Inactive) added a comment - latest patch http://lists.askmonty.org/pipermail/commits/2018-May/012478.html
            Elkin Andrei Elkin added a comment -

            The patch needs to address DROP INDEX as well.

            Elkin Andrei Elkin added a comment - The patch needs to address DROP INDEX as well.
            Elkin Andrei Elkin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            Elkin Andrei Elkin made changes -
            Assignee Andrei Elkin [ elkin ] Sachin Setiya [ sachin.setiya.007 ]
            julien.fritsch Julien Fritsch made changes -
            Assignee Sachin Setiya [ sachin.setiya.007 ] Sergei Golubchik [ serg ]
            julien.fritsch Julien Fritsch made changes -
            Assignee Sergei Golubchik [ serg ] Andrei Elkin [ elkin ]
            Elkin Andrei Elkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.3 [ 22126 ]
            Elkin Andrei Elkin made changes -
            Elkin Andrei Elkin added a comment -

            The rename case was attempted tackling within the current
            issue but eventually due to a number of complications I filled a dedicated ticket.

            Elkin Andrei Elkin added a comment - The rename case was attempted tackling within the current issue but eventually due to a number of complications I filled a dedicated ticket.
            Elkin Andrei Elkin made changes -
            Assignee Andrei Elkin [ elkin ] Sachin Setiya [ sachin.setiya.007 ]
            Elkin Andrei Elkin added a comment -

            The ticket returned back to sachin.setiya.007 the author of initial patch after RENAME subtask which was not required by the report is made in its own ticket due to complications potentially involving changes in the parser.

            The latest patch is good to push.

            Elkin Andrei Elkin added a comment - The ticket returned back to sachin.setiya.007 the author of initial patch after RENAME subtask which was not required by the report is made in its own ticket due to complications potentially involving changes in the parser. The latest patch is good to push.
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Fix Version/s 10.0.36 [ 22916 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.0 [ 16000 ]
            Fix Version/s 10.1 [ 16100 ]
            Fix Version/s 10.3 [ 22126 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            sachin.setiya.007 Sachin Setiya (Inactive) made changes -
            Fix Version/s 10.1.35 [ 23116 ]
            Fix Version/s 10.2.17 [ 23111 ]
            Fix Version/s 10.3.9 [ 23114 ]
            alice Alice Sherepa made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 73123 ] MariaDB v4 [ 149903 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 181796 187321 158732 182166 180786 200409

            People

              sachin.setiya.007 Sachin Setiya (Inactive)
              water P.R. Water
              Votes:
              7 Vote for this issue
              Watchers:
              14 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.