Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-6256

Query Analytics Dashboard: 'InvalidNamespace' EXPLAIN error with some MongoDB queries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 2.9.0
    • Fix Version/s: 2.9.1
    • Component/s: PMM Agent
    • Labels:
      None
    • Story Points:
      0
    • Sprint:
      Platform Sprint 20, Platform Sprint 21, Platform Sprint 22
    • Needs Review:
      Yes
    • Needs QA:
      Yes

      Description

      STR:
      I generated queries for the next types:
      count()
      aggregate()
      findandmodify()
      distinct()

      And it seems there are some problem with explain for these queries
      For all these types explain returns:

       (InvalidNamespace) Mismatched $db in explain command. Expected admin but got sbtest: cannot explain this type of query
      

      http://10.30.3.50/graph/d/pmm-qan/pmm-query-analytics?columns=%5B%22load%22,%22num_queries%22,%22query_time%22%5D&filter_by=b8daf18df8f8bfa4ddcb60b38d93e790&var-environment=All&var-cluster=All&var-replication_set=All&var-database=All&var-schema=All&var-node_name=All&var-node_name=bm-qanqa04.bm.int.percona.com&var-service_name=All&var-service_type=All&var-node_type=All&var-interval=$__auto_interval_interval&order_by=-load&group_by=queryid&from=now-12h&to=now&totals=false&query_selected=true&details_tab=explain

      For distinct query:

       {"service_id":"/service_id/03f30f98-5a15-4191-be5b-2f707c166f18","query":"{\"ns\":\"sbtest.inventory\",\"op\":\"command\",\"command\":{\"distinct\":\"inventory\",\"key\":\"item.sku\",\"query\":{},\"lsid\":{\"id\":{\"$binary\":{\"base64\":\"XfBTls2VQ8uoNOn4s1luPw==\",\"subType\":\"04\"}}},\"$db\":\"sbtest\"}}"}

      I executed the same queries for PMM 1.17.3 and explain worked ok:

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              nailya.kutlubaeva Nailya Kutlubaeva
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 7 hours
                  7h

                    Smart Checklist