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

    • New Feature
    • Status: Backlog
    • Minor - P4
    • Resolution: Unresolved
    • None
    • None
    • Diagnostics, Querying
    • None

    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

              backlog-query-execution Backlog - Query Execution
              harshad.dhavale@mongodb.com Harshad Dhavale
              Votes:
              3 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated: