Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-16265

Add query details to getmore entry in profiler and db.currentOp()

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.11, 3.0.4, 3.1.4
    • Component/s: Diagnostics, Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Completed:
    • Sprint:
      Quint Iteration 4
    • Case:

      Description

      It is possible to run aggregation queries with the {cursor:{batchSize:0}} option, in order to quickly get back a cursor that can subsequently be iterated. This approach is documented here.
      The problem with using this option is that it makes debugging slow queries difficult since the database profiler (set to level 1) and mongod logs only record the 'getmore' ops on the cursor, since the original query is very fast.
      I think a couple of enhancements are needed :

      • add details of the query to the getmore log entry (which is essential for the above case)
      • add the details of the query to db.currentOp()
      • add the cursorId to the original query log entry (which makes correlating a query and its associated getmores much easier)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: