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

Table lock race condition with replication

    XMLWordPrintable

Details

    Description

      We have a MariaDB server that sometimes seems to get an indefinite table lock. The only way to solve it is to kill MariaDB and restart it. It "randomly happens", so I suspect it may be a race condition. The replication thread get's stuck in state "After opening tables". The lock seems to be caused by a query on an unrelated database with 3 million MyISAM tables (not receiving data via replication) in state "Opening tables". These databases are completely separated, so they shouldn't cause a lock between each other.

      Processlist shows:

      root@server ~ # mysql -e "show full processlist"
      +----------+----------------------+-----------------------+----------------------+---------+---------+----------------------------------+-------------------------------------------------------+----------+
      | Id       | User                 | Host                  | db                   | Command | Time    | State                            | Info                                                  | Progress |
      +----------+----------------------+-----------------------+----------------------+---------+---------+----------------------------------+-------------------------------------------------------+----------+
      |        2 | system user          |                       | NULL                 | Connect | 1116538 | Waiting for master to send event | NULL                                                  |    0.000 |
      |        3 | system user          |                       | replication_database               | Connect |  264121 | After opening tables             | COMMIT                                                |    0.000 |
      | 37332419 | user1                 | localhost             | large_database          | Killed  |  264121 | Opening tables                   | DELETE FROM `my_domain` WHERE date<'2016-04-29' |    0.000 |
      | 48692447 | root                 | localhost             | NULL                 | Query   |       0 | init                             | show full processlist                                 |    0.000 |
      +----------+----------------------+-----------------------+----------------------+---------+---------+----------------------------------+-------------------------------------------------------+----------+
      root@server ~ # 
      

      Attachments

        1. global_status.txt
          26 kB
          Dreas van Donselaar
        2. patch
          6 kB
          Michael Widenius
        3. strace_170419_1.txt
          71 kB
          Dreas van Donselaar
        4. strace_170419_2.txt
          68 kB
          Dreas van Donselaar
        5. strace_170425.txt
          605 kB
          Dreas van Donselaar
        6. strace.txt
          608 kB
          Dreas van Donselaar

        Activity

          People

            monty Michael Widenius
            dreas Dreas van Donselaar
            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.