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

MyRocks: Killing server during RESET MASTER can lose last transactions

    XMLWordPrintable

    Details

      Description

      Hit this when working on MDEV-25304:

      Apply this patch:

      diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
      index 084259d863d..fbc1e637abc 100644
      --- a/sql/sql_repl.cc
      +++ b/sql/sql_repl.cc
      @@ -3966,6 +3966,8 @@ int reset_master(THD* thd, rpl_gtid *init_state, uint32 init_state_len,
         ret= mysql_bin_log.reset_logs(thd, 1, init_state, init_state_len,
                                       next_log_number);
         repl_semisync_master.after_reset_master();
      +  DBUG_EXECUTE_IF("reset_master_done", DBUG_SUICIDE(););
      +
         return ret;
       }
       

      then run this testcase (put in storage/rocksdb/mysql-test/rocksdb/t/binlog_rotate.test ):

      --source include/have_rocksdb.inc
      --source include/have_log_bin.inc
       
      set global rocksdb_flush_log_at_trx_commit=1;
       
      create table t1 (a int, b int, key(a)) engine=rocksdb;
      insert into t1 values (1,1),(2,2);
      select * from t1;
      flush tables;
       
      --write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
      restart
      EOF
       
      set @@debug_dbug="+d,reset_master_done";
       
      --disable_reconnect
      --error 0,2013
      RESET MASTER;
      --enable_reconnect
      --source include/wait_until_connected_again.inc
      select * from t1;
       
      drop table t1;
      

      and observe:

      ...
      set global rocksdb_flush_log_at_trx_commit=1;
      create table t1 (a int, b int, key(a)) engine=rocksdb;
      insert into t1 values (1,1),(2,2);
      select * from t1;
      a       b
      1       1
      2       2
      flush tables;
      set @@debug_dbug="+d,reset_master_done";
      RESET MASTER;
      select * from t1;
      a       b
      drop table t1;
      

      The INSERTs are lost.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psergei Sergei Petrunia
              Reporter:
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: