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

LP:711565 - Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      When Index Condition Pushdown is employed, a single index lookup call like handler->index_read(lookup_tuple,...) can potentially enumerate lots (e.g. hundred of thousands) of index records before it finds one that satisfies the pushed index condition.

      The problems are:
      P1: MyISAM/Maria hold locks while enumerating those records, which means that one long query may stall others.
      P2: For all storage engines: the state of thd->killed is not checked. This means that if one decides to kill the query (with KILL <thread_id> statement), it may take a very long time before the query is actually killed.

      There is no testcase: Monty has found this out from the code (and provided a patch to address a problem with mi_rkey())

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            psergey Sergei Petrunia added a comment -

            Re: Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time
            Testcase note: making a mysql-test-run compatible testcase is difficult because "artificially long-running" predicates like SLEEP() actually check thd->killed. One has to use "naturally long-running" predicates, which still take fractions of second, so one also needs tables with lots of rows to observe that the query is not affected by KILL statement.

            Show
            psergey Sergei Petrunia added a comment - Re: Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time Testcase note: making a mysql-test-run compatible testcase is difficult because "artificially long-running" predicates like SLEEP() actually check thd->killed. One has to use "naturally long-running" predicates, which still take fractions of second, so one also needs tables with lots of rows to observe that the query is not affected by KILL statement.
            Hide
            psergey Sergei Petrunia added a comment -

            Re: Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time
            The fix has been pushed several months ago (revision-id: monty@askmonty.org-20110218154359-vowf21p5mcjhc68y). Updating the bug status.

            Show
            psergey Sergei Petrunia added a comment - Re: Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time The fix has been pushed several months ago (revision-id: monty@askmonty.org-20110218154359-vowf21p5mcjhc68y). Updating the bug status.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 711565

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 711565

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: