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

Deadlock with statistics tables and ANALYZE

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      (Initially found by Elena)

      I'll attach a testcase, which eventually gets three threads to be stuck in "Waiting for table level lock" state.

      The testcase must be run like this: ./mysql-test-run t/t45.test --repeat=100 (can also add --testcase-timeout=600 to ease debugging). Execution will get stuck after a minute. On my machine (pylon-fedora15), only release build gets stuck, and only when the server is started by MTR.

      Being stuck looks like this:

      +----+------+-----------------+------+---------+------+------------------------------+------------------------------------------------+----------+
      | Id | User | Host            | db   | Command | Time | State                        | Info                                           | Progress |
      +----+------+-----------------+------+---------+------+------------------------------+------------------------------------------------+----------+
      | 23 | root | localhost       | test | Sleep   |   17 |                              | NULL                                           |    0.000 |
      | 24 | root | localhost       | test | Query   |   17 | Waiting for table level lock | ANALYZE TABLE E                                |    0.000 |
      | 25 | root | localhost       | test | Query   |   17 | Waiting for table level lock | ANALYZE TABLE A                                |    0.000 |
      | 26 | root | localhost       | test | Query   |   17 | Waiting for table level lock | SELECT * FROM mysql.index_stat, test.E LIMIT 1 |    0.000 |
      | 27 | root | localhost:52086 | NULL | Query   |    0 | NULL                         | show processlist                               |    0.000 |
      +----+------+-----------------+------+---------+------+------------------------------+------------------------------------------------+----------+

        Attachments

        1. t45.test
          65 kB
        2. threads45
          17 kB

          Issue Links

            Activity

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                psergey Sergei Petrunia
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: