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

UNTIL clause in START SLAVE is sporadically disobeyed by parallel replication

    XMLWordPrintable

Details

    Description

      The test below has 3 different outcomes for me:

      1) SQL thread stops at the requested position, the number of rows in the table is as expected (10);
      2) SQL thread executes an extra event and then stops, the position differs from the requested one, the number of rows in the table is 12;
      3) SQL thread does not stop at all, waiting on the condition times out, the number of rows in the table is 16.

      So, run the test with --trials=N.
      For me, 5 is enough to get one of the problems, but your mileage may vary.

      --source include/master-slave.inc
      --source include/have_binlog_format_row.inc
       
      --connection slave
       
      --source include/stop_slave_sql.inc
       
      --connection master
       
      create table t1 (i int);
      flush logs;
      insert into t1 values (1),(2);
      insert into t1 values (3),(4);
      insert into t1 values (5),(6);
      insert into t1 values (7),(8);
      insert into t1 values (9),(10);
       
      --let $master_file = query_get_value(show master status,File,1)
      --let $master_pos = query_get_value(show master status,Position,1)
       
      insert into t1 values (11),(12);
      insert into t1 values (13),(14);
      insert into t1 values (15),(16);
       
      --connection slave
       
      set global slave_parallel_threads = 1;
      eval start slave until master_log_file='$master_file', master_log_pos=$master_pos;
       
      --let $show_statement = SHOW SLAVE STATUS
      --let $field = Slave_SQL_Running
      --let $condition = = 'No'
      --let $wait_timeout = 10
       
      --source include/wait_show_condition.inc
       
      if (`select COUNT(*) > 10 from t1`) 
      {
      	SELECT * FROM t1;
      	query_vertical show slave status;
      	die "Extra rows in the table";
      }
       
      drop table t1;
      set global slave_parallel_threads = DEFAULT;
      --source include/stop_slave_io.inc
       
      --connection master
      drop table t1;

      Checked on 10.0 commit 0880284bf7 and 10.1 commit 3e55ef26d.

      Attachments

        Activity

          People

            knielsen Kristian Nielsen
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.