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

Start Slave on a Galera should error if master binlog_format=statement and wsrep_auto_increment_control=1

    XMLWordPrintable

    Details

      Description

      Data corruption will happen as soon as the galera cluster size change

      Let's take a table t made of single auto increment and the following binlog

      # at 770118590
      #160203 21:31:19 server id 10  end_log_pos 770118618    Intvar
      SET INSERT_ID=134024921/*!*/;
      # at 770118618
      #160203 21:31:19 server id 10  end_log_pos 770121328    Query   thread_id=961224213     exec_time=0     error_code=0
      SET TIMESTAMP=1454531479/*!*/;
      INSERT INTO t values  (NULL),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL )
        /*!*/;
      # at 770121328
      #160203 21:31:19 server id 10  end_log_pos 770121355    Xid = 701968214
      COMMIT/*!*/;
      # at 770121355
      #160203 21:31:19 server id 10  end_log_pos 770121414    Query   thread_id=961224213     exec_time=0     error_code=0
      SET TIMESTAMP=1454531479/*!*/;
      BEGIN
      /*!*/;
      # at 770121414
      #160203 21:31:19 server id 10  end_log_pos 770121442    Intvar
      SET INSERT_ID=134024933/*!*/;
      # at 770121442
      #160203 21:31:19 server id 10  end_log_pos 770124812    Query   thread_id=961224213     exec_time=0     error_code=0
      SET TIMESTAMP=1454531479/*!*/;
      INSERT INTO t values  (NULL),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL ),(NULL )
      

      Replication will break because the step of auto increment will change as soon the cluster size change. In statement base the master did not change the step and auto increment overlay will happen and corrupt the data ?

      Last_SQL_Error: Error 'Duplicate entry '134024933
       
      MariaDB [db_calameo_v2]> SELECT  ID FROM t WHERE id >= 134024921;
      +-----------+
      | LinkID    |
      +-----------+
      | 134024921 |
      | 134024923 |
      | 134024925 |
      | 134024927 |
      | 134024929 |
      | 134024931 |
      | 134024933 |
      | 134024935 |
      | 134024937 |
      | 134024939 |
      | 134024941 |
      | 134024943 |
      +-----------+
      

      So this proposal is to introduce verbose error message at replication start to either change wsrep_auto_increment_control=1 or to use ROW based .

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jplindst Jan Lindström
              Reporter:
              stephane@skysql.com VAROQUI Stephane
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: