DRIVERS-3439 Remove pre-MongoDB 4.2 references from specs and tests#1929
DRIVERS-3439 Remove pre-MongoDB 4.2 references from specs and tests#1929jyemin wants to merge 2 commits into
Conversation
|
Should you drop everything specific to maxWireVersion < 9? They are not relevant for server >= 4.4
|
I don't want to remove 4.2 references until all drivers remove support for 4.2. Definitely a good followup though, once that happens. |
There was a problem hiding this comment.
Pull request overview
This PR updates the MongoDB driver specifications and associated unified/legacy test suites to reflect MongoDB 4.2 as the minimum supported server version, removing pre-4.2 (and some earlier) conditional prose and test coverage.
Changes:
- Removed pre-4.2-gated YAML/JSON spec tests (notably SDAM error templates/tests, CLM connection-id tests, CSFLE maxWireVersion tests, and various CRUD “client/server error on older server” cases).
- Simplified multiple spec documents by deleting version-conditional language that is no longer relevant with a 4.2+ baseline.
- Updated SDAM error test generator to stop producing pre-4.2 test variants.
Reviewed changes
Copilot reviewed 95 out of 95 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| source/unified-test-format/unified-test-format.md | Simplifies deprecated topology guidance by removing version gating. |
| source/transactions/transactions.md | Removes pre-4.2-era constraints; updates transaction eligibility text and other prose. |
| source/server-discovery-and-monitoring/tests/errors/pre-42.yml.template | Deletes pre-4.2 SDAM error test template. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.yml | Deletes pre-4.2 SDAM error test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.json | Deletes generated JSON for the removed pre-4.2 SDAM test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.yml | Deletes pre-4.2 SDAM error test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.json | Deletes generated JSON for the removed pre-4.2 SDAM test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.yml | Deletes pre-4.2 SDAM error test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.json | Deletes generated JSON for the removed pre-4.2 SDAM test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.yml | Deletes pre-4.2 SDAM error test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.json | Deletes generated JSON for the removed pre-4.2 SDAM test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.yml | Deletes pre-4.2 SDAM error test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.json | Deletes generated JSON for the removed pre-4.2 SDAM test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.yml | Deletes pre-4.2 SDAM error test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.json | Deletes generated JSON for the removed pre-4.2 SDAM test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.yml | Deletes pre-4.2 SDAM error test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.json | Deletes generated JSON for the removed pre-4.2 SDAM test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.yml | Deletes pre-4.2 SDAM error test. |
| source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.json | Deletes generated JSON for the removed pre-4.2 SDAM test. |
| source/server-discovery-and-monitoring/tests/errors/generate-error-tests.py | Removes pre-4.2 test generation path. |
| source/server-discovery-and-monitoring/server-discovery-and-monitoring.md | Removes pre-4.2 pool-clearing behavior language. |
| source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.md | Aligns SDAM summary with 4.2+ behavior (no pool clear). |
| source/retryable-writes/retryable-writes.md | Removes older-version gating and simplifies unsupported-operation prose. |
| source/read-write-concern/read-write-concern.md | Removes aggregate-with-write-stage readConcern pre-4.2 carveout. |
| source/mongodb-handshake/handshake.md | Removes 3.4-specific wording to reflect current baseline. |
| source/index-management/index-management.md | Removes “new in MongoDB X.Y” phrasing for index option docs. |
| source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md | Drops pre-4.2 exhaust behavior rows from tables. |
| source/enumerate-databases/enumerate-databases.md | Removes historical version introduction notes for listDatabases options. |
| source/enumerate-collections/enumerate-collections.md | Removes historical version introduction notes for listCollections options. |
| source/crud/tests/unified/updateOne-hint-unacknowledged.yml | Removes pre-4.2 test cases; reanchors shared filter/update values. |
| source/crud/tests/unified/updateOne-hint-unacknowledged.json | Regenerated JSON reflecting removal of pre-4.2 cases. |
| source/crud/tests/unified/updateOne-hint-serverError.yml | Deletes pre-4.2-only unified test. |
| source/crud/tests/unified/updateOne-hint-serverError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/updateOne-hint-clientError.yml | Deletes pre-4.2-only unified test. |
| source/crud/tests/unified/updateOne-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/updateMany-hint-unacknowledged.yml | Removes pre-4.2 test cases; reanchors shared filter/update values. |
| source/crud/tests/unified/updateMany-hint-unacknowledged.json | Regenerated JSON reflecting removal of pre-4.2 cases. |
| source/crud/tests/unified/updateMany-hint-serverError.yml | Deletes pre-4.2-only unified test. |
| source/crud/tests/unified/updateMany-hint-serverError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/updateMany-hint-clientError.yml | Deletes pre-4.2-only unified test. |
| source/crud/tests/unified/updateMany-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/replaceOne-hint-unacknowledged.yml | Removes pre-4.2 test cases; reanchors shared filter/replacement values. |
| source/crud/tests/unified/replaceOne-hint-unacknowledged.json | Regenerated JSON reflecting removal of pre-4.2 cases. |
| source/crud/tests/unified/replaceOne-dots_and_dollars.yml | Removes pre-3.6 cases from dots-and-dollars replaceOne tests. |
| source/crud/tests/unified/replaceOne-dots_and_dollars.json | Regenerated JSON reflecting removal of pre-3.6 cases. |
| source/crud/tests/unified/insertOne-dots_and_dollars.yml | Removes pre-3.6 case from dots-and-dollars insertOne tests. |
| source/crud/tests/unified/insertOne-dots_and_dollars.json | Regenerated JSON reflecting removal of pre-3.6 case. |
| source/crud/tests/unified/findOneAndUpdate-hint-clientError.yml | Deletes pre-4.2-only unified test. |
| source/crud/tests/unified/findOneAndUpdate-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/findOneAndReplace-hint-clientError.yml | Deletes pre-4.2-only unified test. |
| source/crud/tests/unified/findOneAndReplace-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/findOneAndReplace-dots_and_dollars.yml | Removes pre-3.6 cases from dots-and-dollars findOneAndReplace tests. |
| source/crud/tests/unified/findOneAndReplace-dots_and_dollars.json | Regenerated JSON reflecting removal of pre-3.6 cases. |
| source/crud/tests/unified/findOneAndDelete-hint-clientError.yml | Deletes pre-4.2-only unified test. |
| source/crud/tests/unified/findOneAndDelete-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/find-allowdiskuse-clientError.yml | Deletes pre-3.2-only unified test. |
| source/crud/tests/unified/find-allowdiskuse-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/deleteOne-hint-clientError.yml | Deletes pre-3.4-only unified test. |
| source/crud/tests/unified/deleteOne-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/deleteMany-hint-clientError.yml | Deletes pre-3.4-only unified test. |
| source/crud/tests/unified/deleteMany-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.yml | Removes pre-4.2 bulkWrite hint cases; reanchors shared values. |
| source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.json | Regenerated JSON reflecting removal of pre-4.2 cases. |
| source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.yml | Removes pre-4.2 bulkWrite hint cases; reanchors shared values. |
| source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.json | Regenerated JSON reflecting removal of pre-4.2 cases. |
| source/crud/tests/unified/bulkWrite-update-hint-serverError.yml | Deletes pre-4.2-only unified test. |
| source/crud/tests/unified/bulkWrite-update-hint-serverError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/bulkWrite-update-hint-clientError.yml | Deletes pre-3.4-only unified test. |
| source/crud/tests/unified/bulkWrite-update-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.yml | Removes pre-4.2 bulkWrite replaceOne hint cases; reanchors shared values. |
| source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.json | Regenerated JSON reflecting removal of pre-4.2 cases. |
| source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.yml | Removes pre-3.6 cases from dots-and-dollars bulkWrite replaceOne tests. |
| source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.json | Regenerated JSON reflecting removal of pre-3.6 cases. |
| source/crud/tests/unified/bulkWrite-delete-hint-clientError.yml | Deletes pre-3.4-only unified test. |
| source/crud/tests/unified/bulkWrite-delete-hint-clientError.json | Deletes generated JSON for removed unified test. |
| source/crud/tests/unified/bulkWrite-arrayFilters-clientError.yml | Deletes pre-3.6-only unified test. |
| source/crud/tests/unified/bulkWrite-arrayFilters-clientError.json | Deletes generated JSON for removed unified test. |
| source/compression/OP_COMPRESSED.md | Removes pre-4.2 historical notes and updates compressor support wording. |
| source/command-logging-and-monitoring/tests/monitoring/redacted-commands.yml | Removes tests for commands removed pre-4.2 (copydb*). |
| source/command-logging-and-monitoring/tests/monitoring/redacted-commands.json | Regenerated JSON reflecting removal of copydb* cases. |
| source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.yml | Deletes pre-4.2-only connection-id unified test. |
| source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.json | Deletes generated JSON for removed connection-id test. |
| source/command-logging-and-monitoring/tests/logging/redacted-commands.yml | Removes copydb* logging redaction cases. |
| source/command-logging-and-monitoring/tests/logging/redacted-commands.json | Regenerated JSON reflecting removal of copydb* cases. |
| source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.yml | Deletes pre-4.2-only connection-id logging test. |
| source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.json | Deletes generated JSON for removed connection-id logging test. |
| source/collation/collation.md | Removes pre-3.4/low-wire-version compatibility text now irrelevant to 4.2+. |
| source/client-side-encryption/tests/unified/maxWireVersion.yml | Deletes pre-4.2-only CSFLE maxWireVersion unified test. |
| source/client-side-encryption/tests/unified/maxWireVersion.json | Deletes generated JSON for removed CSFLE test. |
| source/client-side-encryption/tests/legacy/maxWireVersion.yml | Deletes pre-4.2-only CSFLE legacy-format test. |
| source/client-side-encryption/tests/legacy/maxWireVersion.json | Deletes generated JSON for removed legacy CSFLE test. |
| source/change-streams/change-streams.md | Removes 4.0.7-specific notes around postBatchResumeToken. |
| source/causal-consistency/causal-consistency.md | Removes 3.6+ phrasing now irrelevant to 4.2+ baseline. |
| source/bson-decimal128/decimal128.md | Removes “MongoDB 3.4 introduces” phrasing; keeps generic Decimal128 requirements. |
| source/auth/auth.md | Removes MONGODB-CR references and other pre-4.2 era version notes; simplifies defaults/mechanism sections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| startTransaction SHOULD report an error if the driver can detect that transactions are not supported by the deployment. | ||
| A deployment does not support transactions when the deployment does not support sessions, or maxWireVersion < 7, or the | ||
| maxWireVersion < 8 and the topology type is Sharded, see | ||
| A deployment does not support transactions when the deployment does not support sessions, see | ||
| [How to Tell Whether a Connection Supports Sessions](../sessions/driver-sessions.md#how-to-tell-whether-a-connection-supports-sessions). | ||
| Note that checking the maxWireVersion does not guarantee that the deployment supports transactions, for example a | ||
| MongoDB 4.0 replica set using MMAPv1 will report maxWireVersion 7 but does not support transactions. In this case, | ||
| Drivers rely on the deployment to report an error when a transaction is started. | ||
|
|
| Any command that marks the beginning of a transaction MAY include a `readConcern` argument with an optional `level` and | ||
| `afterClusterTime` fields. Read concern level 'local', 'majority', and 'snapshot' are all supported, although they will | ||
| all have the same behavior as "snapshot" in MongoDB 4.0. To support causal consistency, if `readConcern` | ||
| `afterClusterTime` is specified, then the server will ensure that the transaction’s read timestamp is after the | ||
| `afterClusterTime`. | ||
| `afterClusterTime` fields. Read concern level ‘local’, ‘majority’, and ‘snapshot’ are all supported. To support causal | ||
| consistency, if `readConcern` `afterClusterTime` is specified, then the server will ensure that the transaction’s read | ||
| timestamp is after the `afterClusterTime`. |
| The only supported retryable write commands within a transaction are `commitTransaction` and `abortTransaction`. | ||
| Therefore drivers MUST NOT retry write commands within transactions even when `retryWrites` has been set to true on the | ||
| `MongoClient`. In addition, drivers MUST NOT add the `RetryableWriteError` label to any error that occurs during a write | ||
| command within a transaction (excepting `commitTransation` and `abortTransaction`), even when `retryWrites` has been set | ||
| to true on the `MongoClient`. |
| - username | ||
|
|
||
| SHOULD NOT be provided for MongoDB 3.4+ MUST be specified and non-zero length for MongoDB prior to 3.4 | ||
| SHOULD NOT be provided | ||
|
|
There was a problem hiding this comment.
A few other sections I saw that were missed:
crud.mdhas many comments in pseudocode and interfaces that refer to unsupported server versions.transactions.mdstill has references to 4.0, such as "Starting in MongoDB 4.0, any command error may include a top level "errorLabels" field".- The "Gossipping with mixed server versions" section in
driver-sessions.mdis no longer relevant now that all supported server versions support$clusterTime. - The "Requirements for Retryable Reads" section in
retryable-reads.mdcontains content only for server version < 3.6. - The "timeoutMS cannot be overridden for startSession calls" section in
client-side-operations-timeout.mdreferences 3.6. - The
if isShutdown(code) or (error was from <4.2)pseudocode inserver-discovery-and-monitoring.md. auth.mdstill has references to older versions, such as in the "Multi-credential drivers" section.- The "Connection handshake" section in
handshake.md.
|
|
||
| #### Conversation | ||
|
|
||
| 1. Send `authenticate` command (MongoDB 3.4+) |
There was a problem hiding this comment.
| 1. Send `authenticate` command (MongoDB 3.4+) | |
| 1. Send `authenticate` command |
| ] | ||
| ``` | ||
|
|
||
| Server version between 2.7.6 (inclusive) and 4.0 (exclusive) do not support the `nameOnly` option for the |
There was a problem hiding this comment.
This entire range is no longer supported and so this clarification should be removed.
| An algorithm is specified for inspecting error codes (MongoDB 3.6+) and falling back to parsing error messages when | ||
| error codes are unavailable (MongoDB 3.4 and earlier). When the client sees such an error it knows its topology view is |
There was a problem hiding this comment.
| An algorithm is specified for inspecting error codes (MongoDB 3.6+) and falling back to parsing error messages when | |
| error codes are unavailable (MongoDB 3.4 and earlier). When the client sees such an error it knows its topology view is | |
| An algorithm is specified for inspecting error codes. When the client sees such an error it knows its topology view is |
|
|
||
| If the handshake response includes a `saslSupportedMechs` field, then drivers MUST use the contents of that field to | ||
| select a default mechanism as described later. If the command succeeds and the response does not include a | ||
| `saslSupportedMechs` field, then drivers MUST use the legacy default mechanism rules for servers older than 4.0. |
There was a problem hiding this comment.
4.0 is no longer supported, this distinction is not needed.
Summary
Removes all spec tests and prose gated on MongoDB server versions < 4.2, now that 4.2 is the minimum supported server version.
create_pre_42_tests()functionJSON files for modified YAML tests were regenerated via
makeand committed separately. Commits will be squashed before merge.DRIVERS-3439