-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Index Management
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.
- Is there an opportunity for better cross-driver alignment or testing in this area?
- Is there an opportunity to improve existing documentation on this subject?
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
- Being handled externally via https://github.com/10gen/docs-mongodb-internal/pull/16106
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
- Alignment on behavior (to allow all options to hit the server) being tracked in https://jira.mongodb.org/browse/DRIVERS-3569
- is depended on by
-
MONGOSH-2152 Make 2dsphere index options first class citizens in mongosh
-
- Waiting (Blocked)
-
- related to
-
SERVER-50172 Allow maxCellsInCovering index parameter
-
- Backlog
-
-
DRIVERS-3569 Clarify that drivers must not validate index creation options and rely on the server instead
-
- Backlog
-