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

s3_slave_ignore_updates is broken

    XMLWordPrintable

Details

    Description

      S3 engine's s3_slave_ignore_updates=1 mode is broken.

      The idea of this option is that the slave shall ignore update operations (e.g. CREATE TABLE, ALTER TABLE, etc), because the master has already made all the changes on S3.

      But what if

      • the slave is lagging behind (and executing events e.g. from yesterday)
      • the master is using a different table definition today?

      then, any statement that makes use of the table's definition will break.

      Test case:

      Put this into suite/s3/rpl_basic1.cnf

      !include suite/rpl/rpl_1slave_base.cnf
      !include include/default_client.cnf
       
      [mysqld.1]
      plugin-maturity=alpha
      plugin-load-add=ha_s3.so
      s3-host-name="s3.amazonaws.com"
      s3-protocol-version="Amazon"
      s3-bucket=...
      s3-access-key=...
      s3-secret-key=...
      s3-region=...
       
      [mysqld.2]
      plugin-maturity=alpha
      plugin-load-add=ha_s3.so
      s3-host-name="s3.amazonaws.com"
      s3-protocol-version="Amazon"
      s3-bucket=...
      s3-access-key=...
      s3-secret-key=...
      s3-region=...
      

      Put this into suite/s3/rpl_basic1-slave.opt :

      --s3_slave_ignore_updates=1
      

      Put this into suite/s3/rpl_basic1.test

      --source include/master-slave.inc
      --sync_slave_with_master
       
      connection master;
       
      --disable_warnings
      drop table if exists ten, t1;
      --enable_warnings
       
      --sync_slave_with_master
       
      connection slave;
      stop slave;
       
      connection master;
       
      create table ten(a int primary key);
      insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
       
      create table t1 (a int, b int, c int);
      insert into t1 select a,a,a from ten;
       
      alter table t1 engine=s3;
      create view v1 as select a,b from t1;
       
      drop view v1;
      drop table t1;
       
      create table t1 (x int, y int, z int) ;
      insert into t1 select a,a,a from ten;
      alter table t1 engine=s3;
       
      connection slave;
      start slave;
       
      connection master;
      --sync_slave_with_master
       
      select * from t1;
       
      connection master;
      drop table t1;
      --sync_slave_with_master
      --source include/rpl_end.inc
      

      And run.

      The test will fail with

      mysqltest: At line 37: sync_slave_with_master failed: 'select 
      master_pos_wait('master-bin.000001', 2389, 300, '')' 
      returned NULL indicating slave SQL thread failure
      

      and the slave will be stopped with:

      Last_Error      Error 'Table 'test.t1' doesn't exist' on query. Default database:
       'test'.  Query: 'CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` 
      SQL SECURITY  DEFINER VIEW `v1` AS select a,b from t1'
      

      Attachments

        Activity

          People

            monty Michael Widenius
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.