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

Don't truncate 'comment' command parameter in the slow query logs

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Diagnostics, Querying
    • Labels:
      None
    • Case:

      Description

      ISSUE DESCRIPTION

       

      Currently, the following behavior is observed for the $comment field displayed in the mongodb logs.

      • The $comment field's length gets truncated to 150 characters, when it is captured in the logs.
      • Increasing the value for maxLogSizeKB, makes no difference. The $comment field length still gets truncated in the logs at 150 characters.

      REPRODUCER

       

      1. The following command can be run in the mongo shell - note the `AB` at the end of the $comment string:

       

      replset:PRIMARY> db.<collectionName>.aggregate([ { $match: { $comment: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXAB"} } ])

       

      2. In the logs it will be observed that the $comment field gets truncated (note the `...` and no `AB` at the end):

      command test.<collectionName> appName: "MongoDB Shell" command: aggregate { aggregate: "<collectionName>", pipeline: [ { $match: { $comment: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..." } } ]

      3. Performing a character count on the length of the $comment field (the "XXXX...") will show they are `150 `characters.

       


      FEATURE REQUEST

      Requesting for a feature that allows for changing the length of the $comment field displayed in the logs.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-query-execution Backlog - Query Execution
              Reporter:
              harshad.dhavale Harshad Dhavale
              Participants:
              Votes:
              3 Vote for this issue
              Watchers:
              15 Start watching this issue

                Dates

                Created:
                Updated: