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

--gtid-ignore-duplicate can double-apply event in case of parallel replication retry

Details

    Description

      There is a bug in retry handling in parallel replication when --gtid-ignore-duplicates, in the function retry_event_group().

      Calling cleanup_context() releases the domain (release_domain_owner()). But the code does not re-check the domain with check_duplicate_gtid() before retrying the event. If another master connection obtains the domain in the meantime, this means that the event could be double-applied (once in the retry and once normally in the other connection), which could lead to eg. "duplicate key" error for an INSERT or even silently diverge the slave from the master.

      Attachments

        Issue Links

          Activity

            MDEV-24622 is the same root cause as this bug. But the InnoDB bulk insert optimisation is not related at all to this bug, it just by accident happened to make the problem visible in an existing test case.

            knielsen Kristian Nielsen added a comment - MDEV-24622 is the same root cause as this bug. But the InnoDB bulk insert optimisation is not related at all to this bug, it just by accident happened to make the problem visible in an existing test case.

            bnestere, can you review the patch for MDEV-33475?
            Patch in bb-10.4-knielsen or commits@ mailinglist: https://lists.mariadb.org/hyperkitty/list/commits@lists.mariadb.org/thread/NCCT3K4DQ6LX5262A2TPEJG7NXBRS25Y/

            (I'm planning to fix this bug in 10.4, I think it is serious enough to go there still).

            knielsen Kristian Nielsen added a comment - bnestere , can you review the patch for MDEV-33475 ? Patch in bb-10.4-knielsen or commits@ mailinglist: https://lists.mariadb.org/hyperkitty/list/commits@lists.mariadb.org/thread/NCCT3K4DQ6LX5262A2TPEJG7NXBRS25Y/ (I'm planning to fix this bug in 10.4, I think it is serious enough to go there still).

            Reviewed gtid-ignore-duplicates underlying code and patch, left comments on Github patch a750135741b.

            bnestere Brandon Nesterenko added a comment - Reviewed gtid-ignore-duplicates underlying code and patch, left comments on Github patch a750135741b.

            People

              knielsen Kristian Nielsen
              knielsen Kristian Nielsen
              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.