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

Some replication tests quit dirty when skipped from inside the test

    XMLWordPrintable

    Details

      Description

      Some replication tests first establish and start replication, then find out that server options are not suitable and skip the rest of execution, thus leaving the replication running. It affects the next test started on the same servers when it attempts to configure replication and fails because it's not possible to do with replication already running.

      Example:

      perl ./mtr rpl.rpl_innodb_bug68220,row,xtradb rpl.rpl_not_null_innodb,row,xtradb --mysqld=--binlog-format=mixed
      ...
      rpl.rpl_innodb_bug68220 'row,xtradb'     [ skipped ]  Not ROW format
      rpl.rpl_not_null_innodb 'row,xtradb'     [ fail ]
              Test ended at 2017-01-21 16:38:53
       
      CURRENT_TEST: rpl.rpl_not_null_innodb
      mysqltest: In included file "./include/rpl_init.inc": 
      included from ./include/master-slave.inc at line 38:
      included from /data/src/10.1-bug/mysql-test/suite/rpl/t/rpl_not_null_innodb.test at line 15:
      At line 165: query 'SET GLOBAL gtid_slave_pos= ""' failed: 1198: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
       
      The result from queries just before the failure was:
      include/master-slave.inc
      

      The test rpl_innodb_bug68220.test starts this way:

      --source include/have_innodb.inc
      --source include/master-slave.inc
      --source include/have_binlog_format_row.inc
      

      An easy fix is to re-order include files, so that binlog format is checked before replication is configured:

      --source include/have_innodb.inc
      --source include/have_binlog_format_row.inc
      --source include/master-slave.inc
      

      perl ./mtr rpl.rpl_innodb_bug68220,row,xtradb rpl.rpl_not_null_innodb,row,xtradb --mysqld=--binlog-format=mixed
      ...
      ==============================================================================
       
      TEST                                      RESULT   TIME (ms) or COMMENT
      --------------------------------------------------------------------------
       
      worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      rpl.rpl_innodb_bug68220 'row,xtradb'     [ skipped ]  Not ROW format
      rpl.rpl_not_null_innodb 'row,xtradb'     [ skipped ]  Not ROW format
      --------------------------------------------------------------------------
      The servers were restarted 1 times
      Spent 0.000 of 11 seconds executing testcases
       
      Completed: All 0 tests were successful.
       
      2 tests were skipped, 2 by the test itself.
      

      A smart way, however, is to find out why MTR doesn't check the environment after a skipped test and doesn't clean-up, as it would have done if the test failed rather than was skipped.

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: