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

--sync_slave_with_master implicitly changes to slave without returning to master

    XMLWordPrintable

Details

    Description

      --source include/master-slave.inc
      SET sql_mode='';
      CREATE TEMPORARY TABLE t (c INT);
      --sync_slave_with_master
      DROP TEMPORARY TABLE t;
      --source include/rpl_end.inc
      

      In MTR leads to:

      11.5.0 3f9182126c64bcec359bebe9ebad2a0e559b13e2 (Debug)

      include/master-slave.inc
      [connection master]
      SET sql_mode='';
      CREATE TEMPORARY TABLE t (c INT);
      connection slave;
      DROP TEMPORARY TABLE t;
      main.test3 'mix'                         [ fail ]
              Test ended at 2024-05-09 18:24:16
       
      CURRENT_TEST: main.test3
      mysqltest: At line 5: query 'DROP TEMPORARY TABLE t' failed: ER_BAD_TABLE_ERROR (1051): Unknown table 'test.t'
      

      The bug is not present if --sync_slave_with_master is removed:

      11.5.0 3f9182126c64bcec359bebe9ebad2a0e559b13e2 (Debug)

      include/master-slave.inc
      [connection master]
      SET sql_mode='';
      CREATE TEMPORARY TABLE t (c INT);
      DROP TEMPORARY TABLE t;
      include/rpl_end.inc
      main.test3 'mix'                         [ pass ]    991
      include/master-slave.inc
      [connection master]
      SET sql_mode='';
      CREATE TEMPORARY TABLE t (c INT);
      DROP TEMPORARY TABLE t;
      include/rpl_end.inc
      main.test3 'row'                         [ pass ]    938
      include/master-slave.inc
      [connection master]
      SET sql_mode='';
      CREATE TEMPORARY TABLE t (c INT);
      DROP TEMPORARY TABLE t;
      include/rpl_end.inc
      main.test3 'stmt'                        [ pass ]    966
      --------------------------------------------------------------------------
      The servers were restarted 2 times
      Spent 2.895 of 7 seconds executing testcases
       
      Completed: All 3 tests were successful.
      

      This results in some testing oddities. There may be other issues with --sync_slave_with_master.

      Attachments

        Issue Links

          Activity

            People

              Elkin Andrei Elkin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.