Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-7572

Allow killing query if client disconnects

    XMLWordPrintable

Details

    • New Feature
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Problem

      When a client session disconnects from MaxScale while a query was running, the sessio is torn down and the backends are closed. For normal MariaDB protocol connections, they are closed by sending a COM_QUIT packet and closing the TCP socket. For queries that are very heavy or do a long operation, this leaves them up and running.

      Solution

      Implement an option that kills the query when it gets killed. A slightly smarter approach would be to delay the killing of the query slightly so that only the ones that exceed some configurable threshold are killed. This would allow batching of the KILL checks which should reduce the overhead.

      Original description:

      maxctrl destory session does kill exa query

      The expectation is that destroy session will kill the associated exasol queries

      Reproduce:

      docker exec -it exasoldb exaplus -c 127.0.0.1/nocertcheck:8563 -u sys -p exasol -s mariadb_exa_demo
       
      --/
      CREATE OR REPLACE PYTHON3 SCALAR SCRIPT UTIL.sleep_seconds(secs DOUBLE) 
      RETURNS INT AS
       
      def run(ctx):
          import time
          time.sleep(ctx.secs)
          return 1
      /
      ;
       
      docker exec -it mariadb mariadb --skip-ssl -h maxscale -P 3311 -paBc123%% -u admin_user
      SELECT SESSION_ID, USER_NAME, STATUS, SQL_TEXT FROM EXA_DBA_SESSIONS;
      SELECT UTIL.sleep_seconds(100) FROM DUAL;
       
      # different window
      docker exec -it maxscale bash
      maxctrl list sessions
      maxctrl destroy session $ID
       
      docker exec -it mariadb mariadb --skip-ssl -h maxscale -P 3311 -paBc123%% -u admin_user
      SELECT SESSION_ID, USER_NAME, STATUS, SQL_TEXT FROM EXA_DBA_SESSIONS;
       
      # notice exasol query wasnt killed
      

      Attachments

        Activity

          People

            johan.wikman Johan Wikman
            allen.herrera Allen Herrera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 5d
                5d
                Remaining:
                Remaining Estimate - 5d
                5d
                Logged:
                Time Spent - Not Specified
                Not Specified

                Git Integration

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