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

'DROP DATABASE IF EXISTS' causes replication to break (does not break in MySQL)

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.0.4, 5.5.33
    • 5.5(EOL)
    • None
    • Ubuntu 5.5.31-MariaDB-1~lucid-log and 5.5.32-MariaDB-1~precise-log

    Description

      We have a script that refreshes our staging DB environment. Our staging environment is a master <-> master with each master having another slave.

      I have been replacing mysql database servers with mariadb servers (5.5) and have run in to this most interesting issue.

      masterdb1 - mysql
      masterdb2 - mariadb
      slavedb1 - mysql (slave of masterdb1)
      slavedd2 - maria (slave of masterdb2)

      This refresh script takes a dump of the production DB and loads into masterdb1 BUT it changes the database name used in the DROP DATABASE, CREATE DATABASE and USE commands so that we will not interrupt the automatic testing until we have the complete database loaded. Then we drop all of the tables in the target DB and rename all of the tables from the freshly loaded database so they are now in the correctly named database. This is only background for the bug.

      The problem is the script issues this command (in case it exited prematurely)

      DROP DATABASE IF EXISTS temp_vstreams;

      The first server I changed to mariadb was slavedb2. This worked fine.

      Then I changed masterdb2 (the master for slavedb2). The DORP DB command is issued on masterdb1 and it works (the db does not exist) and it is replicated to masterdb2 where the command is also successful. The command is replicated to slavedb2 where it fails:

      Last_SQL_Error: Query caused different errors on master and slave.     Error on master: message (format)='Cannot load from mysql.%s. The table is probably corrupted' error code=1548 ; Error on slave: actual message='no error', error code=0. Default database: 'temp_vstreams'. Query: 'DROP DATABASE IF EXISTS temp_vstreams'

      They are not exactly the same version as the os is newer on masterdb2.

      masterdb2:

       
      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 49
      Server version: 5.5.32-MariaDB-1~precise-log mariadb.org binary distribution
       
      Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

      slavedb2:

      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 313625
      Server version: 5.5.31-MariaDB-1~lucid-log mariadb.org binary distribution
       
      Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

      The replication setting appear to be identical.

      This is running in AWS and I could arrange access or run whatever diagnostics that might help you (us) figure this out.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              frankflynn Frank Flynn
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.