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

Make explain handling consistent between csfle and mongocryptd

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 6.0.1, 6.1.0-rc0
    • None
    • Fully Compatible
    • v6.0
    • Security 2022-05-30, Security 2022-06-13, Security 2022-06-27

    Description

      Background & Motivation

      The current expectations of the "explain" command differ between csfle and mongocryptd.

      mongocryptd expects "encryptionInformation" as a sibling of "explain":

      {
          "explain": {
              "find": "foo"
          },
          "encryptionInformation": { "fields": [] },
          "$db": "db" // Appended by driver.
      }
      

      csfle expects "encryptionInformation" nested in "explain":

      {
          "explain": {
              "find": "foo",
              "encryptionInformation": { "fields": [] },
              "$db": "db"
          },
          "$db": "db"
      }
      

      mongocryptd and csfle return "encryptionInformation" nested in "explain". Neither csfle nor mongocryptd return "$db" in the reply.

      csfle requires a "$db" field be nested in the "explain" document matching the top-level "$db".

      mongod and mongos expect "encryptionInformation" nested in "explain".

      This is not urgent. libmongocrypt works around this in MONGOCRYPT-427. The consistent behavior would help simplify libmongocrypt auto encryption logic.

      Proposed Scope

      • csfle should parse "encryptionInformation" as either a sibling of "explain" or nested inside "explain". Allowing both supports the old behavior and new behavior.
      • csfle should not require "$db" nested inside "explain".

      Attachments

        Issue Links

          Activity

            People

              erwin.pe@mongodb.com Erwin Pe
              kevin.albertson@mongodb.com Kevin Albertson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: