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

query timeout, executing kill only if we got a lock contention

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: OTHER
    • Labels:
      None

      Description

      now with query timeouts being implemented
      we could allow a timeout checking if any other connection have a lock contention with the current query

      at a high level (show processlist) we can know if a thread is blocking or not other query checking the tables being used (maybe mdl?) but sometimes with innodb it's difficult to find since we have row level locks

      the idea is create a method to check others process when the current query is timed out, if no other connection have a lock contention don't allow the kill command, if we found a lock contention allow the kill command and kill the current query

      in others words when thread receive a kill_timeout, we check if we could return false/true and update the process information with (killing or timedout)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              serg Sergei Golubchik added a comment -

              but there are lock timeouts, they should apply here. query timeout limits the total query duration, locks or not. that would be illogical if it will only kill during lock waits.

              Show
              serg Sergei Golubchik added a comment - but there are lock timeouts, they should apply here. query timeout limits the total query duration, locks or not. that would be illogical if it will only kill during lock waits.
              Hide
              rspadim roberto spadim added a comment -

              Hi sergei!, check the idea...

              kill timeout = 5 seconds
              (1) SELECT FROM tables ..... (will run for 600 seconds)
              .... after 33 seconds
              (2) UPDATE tables WHERE ... (wait the select ends...)
              .... after 5 seconds...
              kill (1) SELECT command cause we wait 5 seconds from the update waiting lock
              

              the idea is not limit the SELECT time, the idea is limit the SELECT time that block others queries (update/delete/insert/replace/alter/etc)
              this cause (1) to restart while someone possible changed the data
              some storage engines return a lock timeout at UPDATE clausule and software/dba must retry the UPDATE, but the idea is the oposite, allow the UPDATE to run, and kill the SELECT query

              Show
              rspadim roberto spadim added a comment - Hi sergei!, check the idea... kill timeout = 5 seconds (1) SELECT FROM tables ..... (will run for 600 seconds) .... after 33 seconds (2) UPDATE tables WHERE ... (wait the select ends...) .... after 5 seconds... kill (1) SELECT command cause we wait 5 seconds from the update waiting lock the idea is not limit the SELECT time, the idea is limit the SELECT time that block others queries (update/delete/insert/replace/alter/etc) this cause (1) to restart while someone possible changed the data some storage engines return a lock timeout at UPDATE clausule and software/dba must retry the UPDATE, but the idea is the oposite, allow the UPDATE to run, and kill the SELECT query

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  rspadim roberto spadim
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated: