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

slow query log won't log queries for existing client sessions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.1.38
    • N/A
    • None
    • verified in docker containers

    Description

      I have verified this bug (in the strong form described) in docker images mysql:5.5, mariadb:10.4.4-bionic, mariadb:10.1.38-bionic, and mariadb:5.5.63-trusty. It exists in a weaker form in mariadb:10.0.38-xenial and mysql:5.5.

      When using the following docker-compose.yml to bring up a container running mysqld:

      version: '3'
      services:
        db:
          image: "mariadb:10.4.4-bionic"
      #    image: "mariadb:10.1.38-bionic"
      #    image: "mariadb:10.0.38-xenial"
      #    image: "mariadb:5.5.63-trusty"
      #    image: "mysql:5.5"
          restart: always
          environment:
            MYSQL_ROOT_PASSWORD: somepass
      

      I open mysql client sessions 1 and 2. In session 1, I turn on slow query logging with:

      set global log_output = 'FILE';
      set global long_query_time = 0;
      set global slow_query_log = 'ON';
      

      Then I open client session 3. In session 2 I run a simple query:

      select sleep(1.1);
      

      and in session 3, I run:

      select sleep(1.2);
      

      and then in session 2, I run:

      select sleep(1.3);
      

      I then turn off slow query logging in session 1:

      set global slow_query_log = 'OFF';
      

      inspecting the slow query log in /var/log/mysql, only the sleep(1.2) was logged.

      The consequence of this is that in a system where processes keep client sessions open for long periods, slow query logging can not determine if those processes are causing issues unless they are bounced (or have their connections killed and have to reestablish them). That can rather disruptive.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cmarshall Christopher Lewis Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.