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

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

  1. at 770118590
    #160203 21:31:19 server id 10 end_log_pos 770118618 Intvar
    SET INSERT_ID=134024921/!/;

  2. 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 )
    /!/;

  3. at 770121328
    #160203 21:31:19 server id 10 end_log_pos 770121355 Xid = 701968214
    COMMIT/!/;

  4. 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
    /!/;

  5. at 770121414
    #160203 21:31:19 server id 10 end_log_pos 770121442 Intvar
    SET INSERT_ID=134024933/!/;

  6. 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 .

Environment

None

Status

Assignee

Nirbhay Choubey

Reporter

VAROQUI Stephane

Labels

None

External issue ID

None

External issue ID

None

Components

Affects versions

10.1.11

Priority

Critical