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

Log redaction does not show planSummary when slow queries are logged

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.14, 4.0.0
    • Fix Version/s: 3.4.17, 3.6.8, 4.0.2, 4.1.3
    • Component/s: Logging, Security
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.0, v3.6, v3.4
    • Case:

      Description

      At present when log redaction is enabled, the planSummary section of the log message (if it's a for a slow query) gets redacted completely:

      2018-08-07T12:10:40.348+1000 I COMMAND  [conn11] command test.t appName: "MongoDB Shell" command: find { find: "###", filter: { a: "###", b: "###" }, $db: "###" } planSummary: ### keysExamined:1 docsExamined:1 cursorExhausted:1 numYields:0 nreturned:1 reslen:138 locks:{ Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_msg 19ms
      

      That makes it difficult to understand why a query is perfoming the way it is. It should not be necessary to have planSummary redacted completely. The redaction should only happen for sensitive elements (just as we do it for the query shape), if they happen to appear under planSummary.

      This is the un-redacted message that shows that there is nothing sensitive under planSummary in this particular example:

      2018-08-07T12:11:02.992+1000 I COMMAND  [conn11] command test.t appName: "MongoDB Shell" command: find { find: "t", filter: { a: "a", b: "b" }, $db: "test" } planSummary: IXSCAN { a: 1, b: 1 } keysExamined:1 docsExamined:1 cursorExhausted:1 numYields:0 nreturned:1 reslen:138 locks:{ Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_msg 0ms
      

        Attachments

          Activity

            People

            Assignee:
            kelsey.schubert Kelsey T Schubert
            Reporter:
            dmitry.ryabtsev Dmitry Ryabtsev
            Participants:
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: