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

'INSERT...SELECT' on MyISAM table suddenly replicated by Galera

Details

    Description

      When having local MyISAM tables on Galera cluster nodes, and the experimental MyISAM replication feature NOT enabled, no DML events for MyISAM tables are replicated with MariaDB 10.6 up to 10.6.17, as expected.

      Starting with 10.6.18 though,

      INSERT INTO ... VALUES(...)

      is not replicated, as expected, but

      INSERT INTO ... SELECT ...

      now suddenly is.

      How to reproduce:

      • create a Galera Cluster using MariaDB 10.6.18, then:

      create table t1(id serial, val varchar(100)) engine=myisam;
      insert into t1 values(null, 'a');
      insert into t1 values(null, 'b');
      insert into t1 select null, 'c';
      insert into t1 select null, 'd' from t1;
      

      After that on the node the above was executed on, as expected:

      MariaDB [test]> select * from t1;
      +----+------+
      | id | val  |
      +----+------+
      |  1 | a    |
      |  3 | b    |
      |  4 | c    |
      |  5 | d    |
      |  6 | d    |
      |  7 | d    |
      +----+------+
      

      But on the other nodes, where only the CREATE TABLE statement should have been replicated:

      MariaDB [test]> select * from t1;
      +----+------+
      | id | val  |
      +----+------+
      |  1 | c    |
      |  2 | d    |
      +----+------+
      

      Note that there is only one row with a 'd' in the 'val' column, not four.

      So looks as if the INSERT...SELECT was replicated in STATEMENT format.

      But looking at the binlog written on the original node everything was logged in ROW format there as expected:

      root@node-1:/var/lib/mysql# mysqlbinlog mysqld-bin.000003 | grep -i insert
      #Q> insert into t1 values(null, 'a')
      #Q> insert into t1 values(null, 'b')
      #Q> insert into t1 select null, 'c'
      #Q> insert into t1 select null, 'd' from t1
      

      I assume this is somehow related to MDEV-33979? Or is it actually caused by the new Galera 26.4.18 version being used by 10.6.18?

      Attachments

        Issue Links

          Activity

            hholzgra The fact that for MyISAM INSERT INTO SELECT is replicated as statement format is intended is that binlog from master? To my eyes last line looks like STATEMENT format. Normal INSERTs are replicated using ROW as expected. Decision is some DML replicated by Galera is done in server code. At the moment is is not 100% correct as for TRIGGERs, FUNCTIONs and PROCEDUREs there is not easy way to know all tables affected. I do not think this is related to MDEV-33979 and I'm sure it is not related to Galera library.

            janlindstrom Jan Lindström added a comment - hholzgra The fact that for MyISAM INSERT INTO SELECT is replicated as statement format is intended is that binlog from master? To my eyes last line looks like STATEMENT format. Normal INSERTs are replicated using ROW as expected. Decision is some DML replicated by Galera is done in server code. At the moment is is not 100% correct as for TRIGGERs, FUNCTIONs and PROCEDUREs there is not easy way to know all tables affected. I do not think this is related to MDEV-33979 and I'm sure it is not related to Galera library.
            janlindstrom Jan Lindström added a comment - - edited
            janlindstrom Jan Lindström added a comment - - edited This was regression from commit 3228c08f 10.5 : https://github.com/MariaDB/server/pull/3424 10.6+: https://github.com/MariaDB/server/pull/3423

            Thanks, review & testing done, first part already merged with head revision: https://github.com/MariaDB/server/commit/eb30a9d63391359e686cfffb36b4c0e4a7e2f5a0

            sysprg Julius Goryavsky added a comment - Thanks, review & testing done, first part already merged with head revision: https://github.com/MariaDB/server/commit/eb30a9d63391359e686cfffb36b4c0e4a7e2f5a0
            sysprg Julius Goryavsky added a comment - Fixed, https://github.com/MariaDB/server/commit/eb30a9d63391359e686cfffb36b4c0e4a7e2f5a0 https://github.com/MariaDB/server/commit/b65bbb2fae419eef54cb79584e618b3ef5409aa2 https://github.com/MariaDB/server/commit/a50a5e0f3b5e93ffa07ea13ef90a3a3356bba5d8

            People

              sysprg Julius Goryavsky
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.