Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1208

LP #1281205: pt-query-digest reports empty hosts when using query_history_review table

    XMLWordPrintable

    Details

      Description

      **Reported in Launchpad by Francisco Bordenave last update 03-09-2014 09:37:40

      When using query_history_review table for historic results pt-query-digest prints empty host if reverse DNS failed in reported query.

      The problem appeared when tried to store Host information in table, some queries were having this field empty.

      After doing some research I've found that every slow query should be logged using this format:

      1. Time: 140103 17:00:11
      2. User@Host: prod[prod] @ ec2-54-225-196-230.compute-1.amazonaws.com [54.225.196.230]

      *notice User@host

      For some reasons, it's very often that some queries are being logged this way:

      1. Time: 140103 16:55:28
      2. User@Host: prod[prod] @ [192.168.100.114]

      *notice the blank space between @ and [ probably due a reverse DNS failure.

      pt-query-digest is having issues to report the host queries and it's printing this output:

      1. Databases pch
      1. Hosts
      1. Last errno 1264 (43/95%), 1158 (2/4%)
      1. User@Host: prod[prod] @ localhost []
      2. User@Host: prod[prod] @ [192.168.100.114]
      3. User@Host: prod[prod] @ ec2-54-225-196-230.compute-1.amazonaws.com [54.225.196.230]

      I would suggest to add some logic to query parsing and in case the @host is empty pt-query-digest should print IP information inside [ ]

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              lpjirasync lpjirasync (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: