Allow index options to pass through the driver unaltered, to be validated directly by the server

XMLWordPrintableJSON

    • 3
    • 2
    • Not Needed
    • None
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Use Case

      As a... Mongodb user
      I want... a single source of truth in options validation
      So that... I can bring my database use to any driver and get the same outcome,
         ...and so that I can get the latest features without waiting for driver implementation

      User Experience

      The Node.js driver supports passing through all index options.

      Dependencies

      This was first raised as a request for 2d sphere index options support in mongosh, see MONGOSH-2152.

      Risks/Unknowns

      • What could go wrong while implementing this change? (e.g., performance, inadvertent behavioral changes in adjacent functionality, existing tech debt, etc)
        • Index creation that previously succeeded may start to fail. The driver currently allowlists the index options, silently dropping unknown/invalid options before they hit the server. If the driver should drop this allowlist, operations that contained a mix of valid and invalid options (which were succeeding by selecting for only the valid options) would start being rejected by the server.

      Acceptance Criteria

      Implementation Requirements

      • Add a flag to the driver to enable a new behavior (default: off) that sends all options to the server for validation.
      • The new behavior is implemented by dropping the allowlist filter from the driver.
      • Schedule full removal of the allowlist from driver for version 8.
      • The following options are confirmed to work via the driver (and implicitly, by extension, mongosh)
        • finestIndexedLevel
        • coarsestIndexedLevel
        • maxCellsInCovering (TBD, see SERVER-50172)

      Testing Requirements

      • Unit tests:
        • invalid/unknown options are silently dropped when feature flag is set to off
        • invalid/unknown options are silently dropped when the feature flag is unset (default behavior: off)
        • invalid/unknown options remain when the feature flag is set to on
      • Integration tests
        • invalid/unknown options do not interfere with the otherwise successful creation of the index when feature flag is set to off
        • invalid/unknown options do not interfere with the otherwise successful creation of the index when feature flag is unset (default behavior: off)
        • invalid/unknown options experience an error from the server when feature flag is set to on 

      Documentation Requirements

      Follow Up Requirements

      • additional tickets to file, required releases, etc
        • File a ticket to remove the feature flag in the version 8 release of the Node.js driver.
      • if node behavior differs/will differ from other drivers, confirm with dbx devs what standard to aim for and what plan, if any, exists to reconcile the diverging behavior moving forward

            Assignee:
            Sean Milligan
            Reporter:
            Anna Henningsen
            None
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: