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

Mariadb Galera cluster fails when replicating from Mysql 5.7 on use of DDL

Details

    Description

      Similar to previous Jira issue MDEV-34180

      HOST: mysql, mysql 5.7.44 binlog_format=ROW
      HOST: m1, mariadb 10.6 GALERA NODE replicating from HOST mysql, Using_Gtid: No (log file and position)
      HOST: m2 mariadb 10.6 GALERA NODE
      HOST: m3 mariadb 10.6 GALERA NODE

      Run this command on mysql:

      CREATE TABLE `tt_mem` (
        `mem_id` bigint(20) NOT NULL,
        `mem_description` varchar(100) DEFAULT NULL,
        PRIMARY KEY (`mem_id`)
      ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4;
      

      Error on m1:

      2024-05-22 16:11:07 1 [ERROR] WSREP: Vote 0 (success) on 78cebda7-1876-11ef-896b-8a58fca50d36:2565 is inconsistent with group. Leaving cluster.
      

      Error on m2 and m3:

      2024-05-22 16:11:06 2 [ERROR] Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 42, event_type: -94
      2024-05-22 16:11:06 2 [ERROR] WSREP: applier could not read binlog event, seqno: 2565, len: 482
      

      OTHER COMMANDS THAT PRODUCE SIMILAR ERRORS

      CREATE TABLE `aa_tab` (
        `col1` int(11) NOT NULL,
        `col2` varchar(100) DEFAULT NULL,
        PRIMARY KEY (`col1`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
      

      rename table aa_tab to dd_tab;
      

      alter table aa_tab add column col3 varchar(10) after col2;
      

      drop table aa_tab;
      

      grant select on *.* to `edward`@`%`;
      

      Attachments

        Issue Links

          Activity

            edward Edward Stoever created issue -
            edward Edward Stoever made changes -
            Field Original Value New Value
            Description Similar to MDEV-34180

            CREATE TABLE `tt_mem` (
              `mem_id` bigint(20) NOT NULL,
              `mem_description` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`mem_id`)
            ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4;
            Similar to previous Jira issue MDEV-34180

            HOST: *mysql*, mysql 5.7.44 binlog_format=ROW
            HOST: *m1*, mariadb 10.6 GALERA NODE replicating from HOST mysql, Using_Gtid: No (log file and position)
            HOST: *m2* mariadb 10.6 GALERA NODE
            HOST: *m3* mariadb 10.6 GALERA NODE

            Run this command on mysql:
            {NOFORMAT}
            CREATE TABLE `tt_mem` (
              `mem_id` bigint(20) NOT NULL,
              `mem_description` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`mem_id`)
            ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4;
            {NOFORMAT}

            Error on m1:
            {noformat}
            2024-05-22 16:11:07 1 [ERROR] WSREP: Vote 0 (success) on 78cebda7-1876-11ef-896b-8a58fca50d36:2565 is inconsistent with group. Leaving cluster.
            {noformat}
            Error on m2 and m3:
            {noformat}
            2024-05-22 16:11:06 2 [ERROR] Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 42, event_type: -94
            2024-05-22 16:11:06 2 [ERROR] WSREP: applier could not read binlog event, seqno: 2565, len: 482
            {noformat}

            A workaround is to replicate from mysql to a stand-alone mariadb with log_slave_updates=ON then from the stand-alone replicate to the Mariadb Galera cluster. This works without error.

            edward Edward Stoever added a comment - A workaround is to replicate from mysql to a stand-alone mariadb with log_slave_updates=ON then from the stand-alone replicate to the Mariadb Galera cluster. This works without error.
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            edward Edward Stoever made changes -
            Summary Mariadb Galera cluster fails when replicating from Mysql 5.7 on use of CREATE TABLE ENGINE=MEMORY command Mariadb Galera cluster fails when replicating from Mysql 5.7 on use of DML
            edward Edward Stoever made changes -
            Description Similar to previous Jira issue MDEV-34180

            HOST: *mysql*, mysql 5.7.44 binlog_format=ROW
            HOST: *m1*, mariadb 10.6 GALERA NODE replicating from HOST mysql, Using_Gtid: No (log file and position)
            HOST: *m2* mariadb 10.6 GALERA NODE
            HOST: *m3* mariadb 10.6 GALERA NODE

            Run this command on mysql:
            {NOFORMAT}
            CREATE TABLE `tt_mem` (
              `mem_id` bigint(20) NOT NULL,
              `mem_description` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`mem_id`)
            ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4;
            {NOFORMAT}

            Error on m1:
            {noformat}
            2024-05-22 16:11:07 1 [ERROR] WSREP: Vote 0 (success) on 78cebda7-1876-11ef-896b-8a58fca50d36:2565 is inconsistent with group. Leaving cluster.
            {noformat}
            Error on m2 and m3:
            {noformat}
            2024-05-22 16:11:06 2 [ERROR] Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 42, event_type: -94
            2024-05-22 16:11:06 2 [ERROR] WSREP: applier could not read binlog event, seqno: 2565, len: 482
            {noformat}
            Similar to previous Jira issue MDEV-34180

            HOST: *mysql*, mysql 5.7.44 binlog_format=ROW
            HOST: *m1*, mariadb 10.6 GALERA NODE replicating from HOST mysql, Using_Gtid: No (log file and position)
            HOST: *m2* mariadb 10.6 GALERA NODE
            HOST: *m3* mariadb 10.6 GALERA NODE

            Run this command on mysql:
            {NOFORMAT}
            CREATE TABLE `tt_mem` (
              `mem_id` bigint(20) NOT NULL,
              `mem_description` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`mem_id`)
            ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4;
            {NOFORMAT}

            Error on m1:
            {noformat}
            2024-05-22 16:11:07 1 [ERROR] WSREP: Vote 0 (success) on 78cebda7-1876-11ef-896b-8a58fca50d36:2565 is inconsistent with group. Leaving cluster.
            {noformat}
            Error on m2 and m3:
            {noformat}
            2024-05-22 16:11:06 2 [ERROR] Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 42, event_type: -94
            2024-05-22 16:11:06 2 [ERROR] WSREP: applier could not read binlog event, seqno: 2565, len: 482
            {noformat}

            *OTHER COMMANDS THAT PRODUCE SIMILAR ERRORS*
            {noformat}
            CREATE TABLE `aa_tab` (
              `col1` int(11) NOT NULL,
              `col2` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`col1`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
            {noformat}

            {noformat}
            rename table aa_tab to dd_tab;
            {noformat}

            {noformat}
            alter table aa_tab add column col3 varchar(10) after col2;
            {noformat}

            {noformat}
            drop table aa_tab;
            {noformat}
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            julien.fritsch Julien Fritsch made changes -
            Affects Version/s 10.6 [ 24028 ]
            julien.fritsch Julien Fritsch made changes -
            Assignee Julius Goryavsky [ sysprg ]
            ltning Eirik Øverby added a comment - - edited

            I reported this issue.
            Note that it also affects 10.11 - which is the version we use.
            /Eirik

            ltning Eirik Øverby added a comment - - edited I reported this issue. Note that it also affects 10.11 - which is the version we use. /Eirik
            julien.fritsch Julien Fritsch made changes -
            Affects Version/s 10.11 [ 27614 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.11 [ 27614 ]
            julien.fritsch Julien Fritsch made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            edward Edward Stoever made changes -
            Description Similar to previous Jira issue MDEV-34180

            HOST: *mysql*, mysql 5.7.44 binlog_format=ROW
            HOST: *m1*, mariadb 10.6 GALERA NODE replicating from HOST mysql, Using_Gtid: No (log file and position)
            HOST: *m2* mariadb 10.6 GALERA NODE
            HOST: *m3* mariadb 10.6 GALERA NODE

            Run this command on mysql:
            {NOFORMAT}
            CREATE TABLE `tt_mem` (
              `mem_id` bigint(20) NOT NULL,
              `mem_description` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`mem_id`)
            ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4;
            {NOFORMAT}

            Error on m1:
            {noformat}
            2024-05-22 16:11:07 1 [ERROR] WSREP: Vote 0 (success) on 78cebda7-1876-11ef-896b-8a58fca50d36:2565 is inconsistent with group. Leaving cluster.
            {noformat}
            Error on m2 and m3:
            {noformat}
            2024-05-22 16:11:06 2 [ERROR] Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 42, event_type: -94
            2024-05-22 16:11:06 2 [ERROR] WSREP: applier could not read binlog event, seqno: 2565, len: 482
            {noformat}

            *OTHER COMMANDS THAT PRODUCE SIMILAR ERRORS*
            {noformat}
            CREATE TABLE `aa_tab` (
              `col1` int(11) NOT NULL,
              `col2` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`col1`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
            {noformat}

            {noformat}
            rename table aa_tab to dd_tab;
            {noformat}

            {noformat}
            alter table aa_tab add column col3 varchar(10) after col2;
            {noformat}

            {noformat}
            drop table aa_tab;
            {noformat}
            Similar to previous Jira issue MDEV-34180

            HOST: *mysql*, mysql 5.7.44 binlog_format=ROW
            HOST: *m1*, mariadb 10.6 GALERA NODE replicating from HOST mysql, Using_Gtid: No (log file and position)
            HOST: *m2* mariadb 10.6 GALERA NODE
            HOST: *m3* mariadb 10.6 GALERA NODE

            Run this command on mysql:
            {NOFORMAT}
            CREATE TABLE `tt_mem` (
              `mem_id` bigint(20) NOT NULL,
              `mem_description` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`mem_id`)
            ) ENGINE=MEMORY DEFAULT CHARSET=utf8mb4;
            {NOFORMAT}

            Error on m1:
            {noformat}
            2024-05-22 16:11:07 1 [ERROR] WSREP: Vote 0 (success) on 78cebda7-1876-11ef-896b-8a58fca50d36:2565 is inconsistent with group. Leaving cluster.
            {noformat}
            Error on m2 and m3:
            {noformat}
            2024-05-22 16:11:06 2 [ERROR] Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 42, event_type: -94
            2024-05-22 16:11:06 2 [ERROR] WSREP: applier could not read binlog event, seqno: 2565, len: 482
            {noformat}

            *OTHER COMMANDS THAT PRODUCE SIMILAR ERRORS*
            {noformat}
            CREATE TABLE `aa_tab` (
              `col1` int(11) NOT NULL,
              `col2` varchar(100) DEFAULT NULL,
              PRIMARY KEY (`col1`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
            {noformat}

            {noformat}
            rename table aa_tab to dd_tab;
            {noformat}

            {noformat}
            alter table aa_tab add column col3 varchar(10) after col2;
            {noformat}

            {noformat}
            drop table aa_tab;
            {noformat}

            {noformat}
            grant select on *.* to `edward`@`%`;
            {noformat}

            I just added GRANT to the list of commands.

            edward Edward Stoever added a comment - I just added GRANT to the list of commands.
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 202508

            Linking issue that look like they could be the same underlying root cause

            knielsen Kristian Nielsen added a comment - Linking issue that look like they could be the same underlying root cause
            knielsen Kristian Nielsen made changes -

            The "event_type: -94" in the error message on nodes m2 and m3 refers to a GTID_EVENT. This is the event that begins all event groups (InnoDB transactions or DDL/GRANT/etc.), and exists in the MariaDB binlogs but not in the MySQL binlogs. So the node m1 would not have seen an event type -94/GTID_EVENT (It would see a corresponding MySQL BEGIN or GTID event), and presumably m1 generated a GTID_EVENT instead to send to nodes m2/m3. So it is possible that this difference in starting event for the event group triggered the bug on m2/m3.

            (Just an observation, I have not analysed in detail what goes wrong in the Galera code).

            knielsen Kristian Nielsen added a comment - The "event_type: -94" in the error message on nodes m2 and m3 refers to a GTID_EVENT. This is the event that begins all event groups (InnoDB transactions or DDL/GRANT/etc.), and exists in the MariaDB binlogs but not in the MySQL binlogs. So the node m1 would not have seen an event type -94/GTID_EVENT (It would see a corresponding MySQL BEGIN or GTID event), and presumably m1 generated a GTID_EVENT instead to send to nodes m2/m3. So it is possible that this difference in starting event for the event group triggered the bug on m2/m3. (Just an observation, I have not analysed in detail what goes wrong in the Galera code).
            edward Edward Stoever made changes -
            Summary Mariadb Galera cluster fails when replicating from Mysql 5.7 on use of DML Mariadb Galera cluster fails when replicating from Mysql 5.7 on use of DDL
            ralf.gebhardt Ralf Gebhardt made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            janlindstrom Jan Lindström added a comment - https://github.com/MariaDB/server/pull/3736
            janlindstrom Jan Lindström made changes -
            Assignee Julius Goryavsky [ sysprg ] Jan Lindström [ JIRAUSER53125 ]
            janlindstrom Jan Lindström made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            janlindstrom Jan Lindström made changes -
            Assignee Jan Lindström [ JIRAUSER53125 ] Julius Goryavsky [ sysprg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            janlindstrom Jan Lindström made changes -
            janlindstrom Jan Lindström made changes -
            hemantdangi Hemant Dangi added a comment -

            The issue can be reproduced for mysql 5.7.44, 8.0.39 and 9.0.1.

            The patch is tested for mysql 5.7.44, 8.0.39 and 9.0.1

            hemantdangi Hemant Dangi added a comment - The issue can be reproduced for mysql 5.7.44, 8.0.39 and 9.0.1. The patch is tested for mysql 5.7.44, 8.0.39 and 9.0.1
            hemantdangi Hemant Dangi made changes -
            hemantdangi Hemant Dangi made changes -

            Thanks, the fix has been merged with the main revision: https://github.com/MariaDB/server/commit/c0b11e75fff9ea513cd6cccfe47837678cedb473

            sysprg Julius Goryavsky added a comment - Thanks, the fix has been merged with the main revision: https://github.com/MariaDB/server/commit/c0b11e75fff9ea513cd6cccfe47837678cedb473
            sysprg Julius Goryavsky made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sysprg Julius Goryavsky made changes -
            Component/s Galera [ 10124 ]
            Fix Version/s 10.5.28 [ 29952 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            JIraAutomate JiraAutomate made changes -
            Fix Version/s 10.6.21 [ 29953 ]
            Fix Version/s 10.11.11 [ 29954 ]
            Fix Version/s 11.4.5 [ 29956 ]
            Fix Version/s 11.7.2 [ 29914 ]

            People

              sysprg Julius Goryavsky
              edward Edward Stoever
              Votes:
              1 Vote for this issue
              Watchers:
              8 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.