Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-10060

Docs for SERVER-27439: Large queries can omit comment in currentOp

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.5.5
    • None
    • Server
    • None

    Description

      Documentation Request Summary:

      Currently, our diagnostic output serializes objects which exceed a given size limit - 512 bytes in the case of currentOp, 50KB for the profiler - to an abbreviated string representation, similar to the "query" field in the following entry (shortened for clarity):

      { "op" : "query", "ns" : "profile_find.test", "query" : "{ find: \"test\", filter:

      { 0: \"aaaaaaaaaaaaaaaaaaaaa..." }

      This commit alters the format by moving the string summary to a field called "$truncated" within an enclosing object:

      { "op" : "query", "ns" : "profile_find.test", "query" : { "$truncated" : "{ find: \"test\", filter:

      { 0: \"aaaaaaaaaaaaaaaaaaaaa...", "comment" : "profile_find_comment" }

      }

      If the operation supports a comment parameter and one is present, as in the example above, it will be retained as a separate field in the enclosing object to better facilitate tracing these operations in diagnostic output.

      This change affects both currentOp and the profiler; in the latter case, it applies to the "query", "command", "originatingCommand" and "updateObj" fields. The string serialization itself remains unchanged from its previous behaviour.

      Please feel free to contact me if any of the above isn't sufficiently clear, or if further details are needed.

      Engineering Ticket Description:

      Since the main purpose of a user-specified comment is to allow a query/aggregation to be easily identified and traced through its execution, the comment should always be visible in currentOp, profiler and logs. SERVER-23260 addressed this issue for 3.4 profiler and logs, but in cases where a query is too large for currentOp it is converted to a string and truncated, which can again elide the comment.

      Attachments

        Activity

          People

            kevin.albertson@mongodb.com Kevin Albertson
            emily.hall Emily Hall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              6 years, 15 weeks, 5 days ago