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

parallel replication deadlock between DML in one domain and DDL in another

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5
    • 10.11
    • Replication
    • None

    Description

      This problem is similar to MDEV-33798, but involves DDL and not just DML.

      What happens here is that we have two DML transactions T1 and T2 in
      domain_id=0 that access a table, and an ALTER TABLE in domain_id=1 that adds
      an index to the same table.

      First T2 starts, it gets a shared metadata lock on the table and then starts
      waiting for prior commit of T1.

      Then ALTER starts, it requests an exclusive metadata lock and thus waits on
      T2.

      Then T1 starts, its request for a shared metadata lock is blocked by the
      pending lock for ALTER TABLE.

      This results in a deadlock.

      I have not yet come up with a test case, but I believe unfortunately the
      patch for MDEV-33798 will not solve this case. Because DDL uses metadata
      locks, and these locks currently do not report waits to the
      thd_rpl_deadlock_check() function and thus the T2 will not be killed and
      retried to resolve the deadlock.

      Attachments

        Issue Links

          Activity

            People

              knielsen Kristian Nielsen
              knielsen Kristian Nielsen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.