diff --git a/source/auth/auth.md b/source/auth/auth.md index efaea8779c..3d7f6e170a 100644 --- a/source/auth/auth.md +++ b/source/auth/auth.md @@ -103,8 +103,8 @@ Userinfo or authentication parameters in connection options MUST NOT be interpre #### Errors Drivers SHOULD raise an error as early as possible when detecting invalid values in a credential. For instance, if a -`mechanism_property` is specified for [MONGODB-CR](#mongodb-cr), the driver should raise an error indicating that the -property does not apply. +`mechanism_property` is specified for a mechanism that does not support it, the driver should raise an error indicating +that the property does not apply. Drivers MUST raise an error if any required information for a mechanism is missing. For instance, if a `username` is not specified for SCRAM-SHA-256, the driver must raise an error indicating the the property is missing. @@ -162,8 +162,6 @@ All blocking operations executed as part of the authentication handshake MUST ap #### Mechanism Negotiation via Handshake -- Since: 4.0 - If an application provides a username but does not provide an authentication mechanism, drivers MUST negotiate a mechanism via a `hello` or legacy hello command requesting a user's supported SASL mechanisms: @@ -232,9 +230,6 @@ used when running the authentication spec tests. ### Default Authentication Methods -- Since: 3.0 -- Revised: 4.0 - If the user did not provide a mechanism via the connection string or via code, the following logic describes how to select a default. @@ -255,98 +250,19 @@ be used as the default, regardless of whether SCRAM-SHA-1 is in the list. Driver mechanism (e.g. PLAIN) as the default. If `saslSupportedMechs` is not present in the handshake response for mechanism negotiation, then SCRAM-SHA-1 MUST be -used when talking to servers >= 3.0. Prior to server 3.0, MONGODB-CR MUST be used. +used as the default. When a user has specified a mechanism, regardless of the server version, the driver MUST honor this. -#### Determining Server Version - -Drivers SHOULD use the server's wire version ranges to determine the server's version. - -### MONGODB-CR - -- Since: 1.4 -- Deprecated: 3.0 -- Removed: 4.0 - -MongoDB Challenge Response is a nonce and MD5 based system. The driver sends a `getnonce` command, encodes and hashes -the password using the returned nonce, and then sends an `authenticate` command. - -#### Conversation - -1. Send `getnonce` command - - ```javascript - CMD = { getnonce: 1 } - RESP = { nonce: } - ``` - -2. Compute key - - ```javascript - passwordDigest = HEX( MD5( UTF8( username + ':mongo:' + password ))) - key = HEX( MD5( UTF8( nonce + username + passwordDigest ))) - ``` - -3. Send `authenticate` command - - ```javascript - CMD = { authenticate: 1, nonce: nonce, user: username, key: key } - ``` - -As an example, given a username of "user" and a password of "pencil", the conversation would appear as follows: - -```javascript -CMD = {getnonce : 1} -RESP = {nonce: "2375531c32080ae8", ok: 1} -CMD = {authenticate: 1, user: "user", nonce: "2375531c32080ae8", key: "21742f26431831d5cfca035a08c5bdf6"} -RESP = {ok: 1} -``` - -#### [MongoCredential](#mongocredential) Properties - -- username - - MUST be specified and non-zero length. - -- source - - MUST be specified. Defaults to the database name if supplied on the connection string or `admin`. - -- password - - MUST be specified. - -- mechanism - - MUST be "MONGODB-CR" - -- mechanism_properties - - MUST NOT be specified. - ### MONGODB-X509 -- Since: 2.6 -- Changed: 3.4 - MONGODB-X509 is the usage of X.509 certificates to validate a client where the distinguished subject name of the client certificate acts as the username. -When connected to MongoDB 3.4: - - You MUST NOT raise an error when the application only provides an X.509 certificate and no username. - If the application does not provide a username you MUST NOT send a username to the server. - If the application provides a username you MUST send that username to the server. -When connected to MongoDB 3.2 or earlier: - -- You MUST send a username to the server. -- If no username is provided by the application, you MAY extract the username from the X.509 certificate instead of - requiring the application to provide it. -- If you choose not to automatically extract the username from the certificate you MUST error when no username is - provided by the application. - #### Conversation 1. Send `authenticate` command (MongoDB 3.4+) @@ -371,7 +287,7 @@ When connected to MongoDB 3.2 or earlier: - 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 - source @@ -393,8 +309,6 @@ TODO: Errors ### SASL Mechanisms -- Since: 2.4 Enterprise - SASL mechanisms are all implemented using the same sasl commands and interpreted as defined by the [SASL specification RFC 4422](http://tools.ietf.org/html/rfc4422). @@ -428,12 +342,6 @@ SASL mechanisms are all implemented using the same sasl commands and interpreted ### GSSAPI -- Since: - - 2.4 Enterprise - - 2.6 Enterprise on Windows - GSSAPI is kerberos authentication as defined in [RFC 4752](http://tools.ietf.org/html/rfc4752). Microsoft has a proprietary implementation called SSPI which is compatible with both Windows and Linux clients. @@ -557,8 +465,6 @@ configuration option is set to `false`. ### PLAIN -- Since: 2.6 Enterprise - The PLAIN mechanism, as defined in [RFC 4616](http://tools.ietf.org/html/rfc4616), is used in MongoDB to perform LDAP authentication. It cannot be used to perform any other type of authentication. Since the credentials are stored outside of MongoDB, the `$external` database must be used for authentication. @@ -605,8 +511,6 @@ MongoDB supports either of these forms. ### SCRAM-SHA-1 -- Since: 3.0 - SCRAM-SHA-1 is defined in [RFC 5802](http://tools.ietf.org/html/rfc5802). [Page 11 of the RFC](http://tools.ietf.org/html/rfc5802#page-11) specifies that user names be prepared with SASLprep, @@ -691,8 +595,6 @@ RESP = {conversationId: 1, payload: BinData(0,"dj1VTVdlSTI1SkQxeU5ZWlJNcFo0Vkh2a ### SCRAM-SHA-256 -- Since: 4.0 - SCRAM-SHA-256 extends [RFC 5802](http://tools.ietf.org/html/rfc5802) and is formally defined in [RFC 7677](https://tools.ietf.org/html/rfc7677). @@ -757,8 +659,6 @@ RESP = {conversationId: 1, payload: BinData(0, "dj02cnJpVFJCaTIzV3BSUi93dHVwK21N ### MONGODB-AWS -- Since: 4.4 - MONGODB-AWS authenticates using AWS IAM credentials (an access key ID and a secret access key), [temporary AWS IAM credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) obtained from an [AWS Security Token Service (STS)](https://docs.aws.amazon.com/STS/latest/APIReference/Welcome.html) @@ -1903,19 +1803,18 @@ def reauth(connection): - authMechanism - MONGODB-CR, MONGODB-X509, GSSAPI, PLAIN, SCRAM-SHA-1, SCRAM-SHA-256, MONGODB-AWS + MONGODB-X509, GSSAPI, PLAIN, SCRAM-SHA-1, SCRAM-SHA-256, MONGODB-AWS - Sets the Mechanism property on the MongoCredential. When not set, the default will be one of SCRAM-SHA-256, - SCRAM-SHA-1 or MONGODB-CR, following the auth spec default mechanism rules. + Sets the Mechanism property on the MongoCredential. When not set, the default will be SCRAM-SHA-256 or SCRAM-SHA-1, + following the auth spec default mechanism rules. - authSource Sets the Source property on the MongoCredential. For GSSAPI, MONGODB-X509 and MONGODB-AWS authMechanisms the authSource defaults to `$external`. For PLAIN the authSource -defaults to the database name if supplied on the connection string or `$external`. For MONGODB-CR, SCRAM-SHA-1 and -SCRAM-SHA-256 authMechanisms, the authSource defaults to the database name if supplied on the connection string or -`admin`. +defaults to the database name if supplied on the connection string or `$external`. For SCRAM-SHA-1 and SCRAM-SHA-256 +authMechanisms, the authSource defaults to the database name if supplied on the connection string or `admin`. - authMechanismProperties=PROPERTY_NAME:PROPERTY_VALUE,PROPERTY_NAME2:PROPERTY_VALUE2 diff --git a/source/bson-decimal128/decimal128.md b/source/bson-decimal128/decimal128.md index 88bf630635..ed64586edd 100644 --- a/source/bson-decimal128/decimal128.md +++ b/source/bson-decimal128/decimal128.md @@ -7,9 +7,9 @@ ______________________________________________________________________ ## Abstract -MongoDB 3.4 introduces a new BSON type representing high precision decimal (`"\x13"`), known as Decimal128. 3.4 -compatible drivers must support this type by creating a Value Object for it, possibly with accessor functions for -retrieving its value in data types supported by the respective languages. +Decimal128 is a BSON type representing high precision decimal (`"\x13"`). Drivers must support this type by creating a +Value Object for it, possibly with accessor functions for retrieving its value in data types supported by the respective +languages. Round-tripping Decimal128 types between driver and server MUST not change its value or representation in any way. Conversion to and from native language types is complicated and there are many pitfalls to represent Decimal128 diff --git a/source/causal-consistency/causal-consistency.md b/source/causal-consistency/causal-consistency.md index 026619b7fb..7dc9f321ee 100644 --- a/source/causal-consistency/causal-consistency.md +++ b/source/causal-consistency/causal-consistency.md @@ -196,9 +196,9 @@ started with `causalConsistency = true` then all operations using that session w There are no new server commands related to causal consistency. Instead, causal consistency is implemented by: -1. Saving the `operationTime` returned by 3.6+ servers for all operations in a property of the `ClientSession` object. - The server reports the `operationTime` whether the operation succeeded or not and drivers MUST save the - `operationTime` in the `ClientSession` whether the operation succeeded or not. +1. Saving the `operationTime` returned by servers for all operations in a property of the `ClientSession` object. The + server reports the `operationTime` whether the operation succeeded or not and drivers MUST save the `operationTime` + in the `ClientSession` whether the operation succeeded or not. 2. Passing that `operationTime` in the `afterClusterTime` field of the `readConcern` field for subsequent causally consistent read operations (for all commands that support a `readConcern`) 3. Gossiping clusterTime (described in the Driver Session Specification) @@ -283,7 +283,7 @@ that causally consistent reads are not causally consistent with unacknowledged w Below is a list of test cases to write. Note: some tests are only relevant to certain deployments. For the purpose of deciding which tests to run assume that -any deployment that is version 3.6 or higher and is either a replica set or a sharded cluster supports cluster times. +any deployment that is either a replica set or a sharded cluster supports cluster times. 1. When a `ClientSession` is first created the `operationTime` has no value. - `session = client.startSession()` @@ -373,7 +373,7 @@ any deployment that is version 3.6 or higher and is either a replica set or a sh ## Motivation -To support causal consistency. Only supported with server version 3.6 or newer. +To support causal consistency. ## Design Rationale diff --git a/source/change-streams/change-streams.md b/source/change-streams/change-streams.md index e16488d6dc..a41ed7c191 100644 --- a/source/change-streams/change-streams.md +++ b/source/change-streams/change-streams.md @@ -325,9 +325,6 @@ The responses to a change stream aggregate or getMore have the following structu ns: String, id: Int64, firstBatch: Array, - /** - * postBatchResumeToken is returned in MongoDB 4.0.7 and later. - */ postBatchResumeToken: Document }, operationTime: Timestamp, @@ -343,9 +340,6 @@ The responses to a change stream aggregate or getMore have the following structu ns: String, id: Int64, nextBatch: Array - /** - * postBatchResumeToken is returned in MongoDB 4.0.7 and later. - */ postBatchResumeToken: Document }, operationTime: Timestamp, @@ -784,11 +778,9 @@ thrown by opening, writing to, or reading from the socket. ##### Exposing All Resume Tokens -- Since: 4.0.7 - -Users can inspect the \_id on each `ChangeDocument` to use as a resume token. But since MongoDB 4.0.7, aggregate and -getMore responses also include a `postBatchResumeToken`. Drivers use one or the other when automatically resuming, as -described in [Resume Process](#resume-process). +Users can inspect the \_id on each `ChangeDocument` to use as a resume token. Aggregate and getMore responses also +include a `postBatchResumeToken`. Drivers use one or the other when automatically resuming, as described in +[Resume Process](#resume-process). Drivers MUST expose a mechanism to retrieve the same resume token that would be used to automatically resume. It MUST be possible to use this mechanism after iterating every document. It MUST be possible for users to use this mechanism diff --git a/source/client-side-encryption/tests/legacy/maxWireVersion.json b/source/client-side-encryption/tests/legacy/maxWireVersion.json deleted file mode 100644 index f04f58dffd..0000000000 --- a/source/client-side-encryption/tests/legacy/maxWireVersion.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "runOn": [ - { - "maxServerVersion": "4.0.99" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "operation fails with maxWireVersion < 8", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "extraOptions": { - "mongocryptdBypassSpawn": true - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "encrypted_string": "string0" - } - }, - "result": { - "errorContains": "Auto-encryption requires a minimum MongoDB version of 4.2" - } - } - ] - } - ] -} diff --git a/source/client-side-encryption/tests/legacy/maxWireVersion.yml b/source/client-side-encryption/tests/legacy/maxWireVersion.yml deleted file mode 100644 index 87c4c993f9..0000000000 --- a/source/client-side-encryption/tests/legacy/maxWireVersion.yml +++ /dev/null @@ -1,22 +0,0 @@ -runOn: - - maxServerVersion: "4.0.99" -database_name: &database_name "default" -collection_name: &collection_name "default" - -data: [] -key_vault_data: [{'status': 1, '_id': {'$binary': {'base64': 'AAAAAAAAAAAAAAAAAAAAAA==', 'subType': '04'}}, 'masterKey': {'provider': 'aws', 'key': 'arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0', 'region': 'us-east-1'}, 'updateDate': {'$date': {'$numberLong': '1552949630483'}}, 'keyMaterial': {'$binary': {'base64': 'AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO', 'subType': '00'}}, 'creationDate': {'$date': {'$numberLong': '1552949630483'}}, 'keyAltNames': ['altname', 'another_altname']}] - -tests: - - description: "operation fails with maxWireVersion < 8" - clientOptions: - autoEncryptOpts: - kmsProviders: - aws: {} # Credentials filled in from environment. - extraOptions: - mongocryptdBypassSpawn: true # mongocryptd probably won't be on the path - operations: - - name: insertOne - arguments: - document: { encrypted_string: "string0" } - result: - errorContains: "Auto-encryption requires a minimum MongoDB version of 4.2" \ No newline at end of file diff --git a/source/client-side-encryption/tests/unified/maxWireVersion.json b/source/client-side-encryption/tests/unified/maxWireVersion.json deleted file mode 100644 index f7a5f0b7db..0000000000 --- a/source/client-side-encryption/tests/unified/maxWireVersion.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "description": "maxWireVersion", - "schemaVersion": "1.23", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99", - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "autoEncryptOpts": { - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - } - }, - "extraOptions": { - "mongocryptdBypassSpawn": true - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "default" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "default" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ] - } - ], - "tests": [ - { - "description": "operation fails with maxWireVersion < 8", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "encrypted_string": "string0" - } - }, - "expectError": { - "errorContains": "Auto-encryption requires a minimum MongoDB version of 4.2" - } - } - ] - } - ] -} diff --git a/source/client-side-encryption/tests/unified/maxWireVersion.yml b/source/client-side-encryption/tests/unified/maxWireVersion.yml deleted file mode 100644 index b39c520993..0000000000 --- a/source/client-side-encryption/tests/unified/maxWireVersion.yml +++ /dev/null @@ -1,61 +0,0 @@ -description: maxWireVersion - -schemaVersion: "1.23" - -runOnRequirements: - - maxServerVersion: "4.0.99" - csfle: true - -createEntities: - - client: - id: &client0 client0 - autoEncryptOpts: - keyVaultNamespace: keyvault.datakeys - kmsProviders: - aws: { accessKeyId: { $$placeholder: 1 }, secretAccessKey: { $$placeholder: 1 } } - extraOptions: - mongocryptdBypassSpawn: true # mongocryptd probably won't be on the path. mongocryptd was introduced in server 4.2. - - database: - id: &database0 database0 - client: *client0 - databaseName: default - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: default - -initialData: - - databaseName: keyvault - collectionName: datakeys - documents: - - { - "status": 1, - "_id": { "$binary": { "base64": "AAAAAAAAAAAAAAAAAAAAAA==", "subType": "04" } }, - "masterKey": - { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1", - }, - "updateDate": { "$date": { "$numberLong": "1552949630483" } }, - "keyMaterial": - { - "$binary": - { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00", - }, - }, - "creationDate": { "$date": { "$numberLong": "1552949630483" } }, - "keyAltNames": ["altname", "another_altname"], - } - -tests: - - description: "operation fails with maxWireVersion < 8" - operations: - - name: insertOne - object: *collection0 - arguments: - document: { encrypted_string: "string0" } - expectError: - errorContains: "Auto-encryption requires a minimum MongoDB version of 4.2" diff --git a/source/collation/collation.md b/source/collation/collation.md index 9692995d30..bdf02e14be 100644 --- a/source/collation/collation.md +++ b/source/collation/collation.md @@ -7,12 +7,10 @@ ______________________________________________________________________ ## Abstract -As of MongoDB server version 3.4 (maxWireVersion 5), a collation option is supported by the query system for matching -and sorting on language strings in a locale-aware fashion. +A collation option is supported by the query system for matching and sorting on language strings in a locale-aware +fashion. -A driver MUST support a Collation option for each of the relevant operations in server versions >= 3.4 (maxWireVersion -5\) and MUST throw an error if a user supplies a Collation option for the operation and the selected server has -maxWireVersion < 5 or if the user is using opcode-based unacknowledged writes. +A driver MUST support a Collation option for each of the relevant operations. The CRUD and Index Management specs include the collation option in descriptions of API elements where it is supported. This document provides more details on the specific driver behavior required to handle the collation option. @@ -38,13 +36,6 @@ eventually the majority of users wishing to use Collations on all operations on with a server-side default. We chose to favor user verbosity right now over abstracting the feature for short-term gains. -### Drivers throw an error if a user supplies Collation and the selected server does not support the feature - -Server versions earlier than 3.4 don't always throw an error if an unknown option is supplied to certain operations. -Because a Collation defines how documents are matched and sorted for both read and write operations, behavior -differences between server versions are significant. Drivers therefore MUST throw an error if a user specifies a -Collation and the selected server has a maxWireVersion < 5 or if using opcode-based unacknowledged writes. - ## Specification ### Collation Document Model @@ -137,11 +128,6 @@ The collation option is sent to the server in the form of a BSON Document. See t Driver helpers manipulating or using indexes MUST support a collation option. These include creating, deleting, and hinting an index. See the [Index Management specification](../index-management/index-management.md) for details. -### Require maxWireVersion 5 - -Drivers MUST require the server's maxWireVersion >= 5 to support Collations. When a collation is explicitly specified -for a server with maxWireVersion < 5, the driver MUST raise an error. - ### Opcode-based Unacknowledged Writes The driver MUST NOT allow collation with opcodes, because the server doesn't support it. If a driver uses opcode-based @@ -158,30 +144,6 @@ db.command({ }); ``` -### BulkWrite API - -If maxWireVersion < 5, the driver MUST inspect each BulkWrite operation model for a collation and MUST raise an error -and MUST NOT send any operations to the server if a collation is explicitly specified on an operation. For example, the -user will provide BulkWrite operation models as in the following example: - -```typescript -db.collection.bulkWrite([ - {insertOne: { ... }}, - - {updateOne: { filter: { name: "PING" }, - update: { $set: { name: "pong" }}, - collation: { locale: "en_US", strength: 2 }}}, - {updateMany: {..., collation: {...}}}, - {replaceOne: {..., collation: {...}}}, - {deleteOne: {..., collation: {...}}}, - {deleteMany: {..., collation: {...}}} -]); -``` - -The driver must inspect each operation for a Collation if maxWireVersion is < 5 and fail the entire bulkWrite if a -collation was explicitly specified. In the example above, that means even the insertOne (without Collation) MUST NOT be -sent. - ## Test Plan There is no specific test plan for driver Collation support; however drivers should test each affected CRUD, Index @@ -191,9 +153,6 @@ In addition, drivers should test that two indexes can be created with identical custom name must be provided for one of them. Then, the test should ensure that the correct index is dropped when delete_one is called with an index name. -Drivers should also test that errors are raised in each place Collation can be provided to a API method and the selected -server has maxWireVersion < 5. - ## Backwards Compatibility There should be no backwards compatibility concerns. diff --git a/source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.json b/source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.json deleted file mode 100644 index d5ebd86590..0000000000 --- a/source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "pre-42-server-connection-id", - "schemaVersion": "1.13", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-server-connection-id-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "logging-tests-collection" - } - } - ], - "initialData": [ - { - "databaseName": "logging-server-connection-id-tests", - "collectionName": "logging-tests-collection", - "documents": [] - } - ], - "tests": [ - { - "description": "command log messages do not include server connection id", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "insert", - "serverConnectionId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "insert", - "serverConnectionId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "find", - "serverConnectionId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command failed", - "commandName": "find", - "serverConnectionId": { - "$$exists": false - } - } - } - ] - } - ] - } - ] -} diff --git a/source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.yml b/source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.yml deleted file mode 100644 index 7dc80eea07..0000000000 --- a/source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.yml +++ /dev/null @@ -1,66 +0,0 @@ -description: "pre-42-server-connection-id" - -schemaVersion: "1.13" - -runOnRequirements: - - maxServerVersion: "4.0.99" - -createEntities: - - client: - id: &client client - observeLogMessages: - command: debug - - database: - id: &database database - client: *client - databaseName: &databaseName logging-server-connection-id-tests - - collection: - id: &collection collection - database: *database - collectionName: &collectionName logging-tests-collection - -initialData: - - databaseName: *databaseName - collectionName: *collectionName - documents: [] - -tests: - - description: "command log messages do not include server connection id" - operations: - - name: insertOne - object: *collection - arguments: - document: { x: 1 } - - name: find - object: *collection - arguments: - filter: { $or: true } - expectError: - isError: true - expectLogMessages: - - client: *client - messages: - - level: debug - component: command - data: - message: "Command started" - commandName: insert - serverConnectionId: { $$exists: false } - - level: debug - component: command - data: - message: "Command succeeded" - commandName: insert - serverConnectionId: { $$exists: false } - - level: debug - component: command - data: - message: "Command started" - commandName: find - serverConnectionId: { $$exists: false } - - level: debug - component: command - data: - message: "Command failed" - commandName: find - serverConnectionId: { $$exists: false } diff --git a/source/command-logging-and-monitoring/tests/logging/redacted-commands.json b/source/command-logging-and-monitoring/tests/logging/redacted-commands.json index 43b9ff74f2..362c1b9161 100644 --- a/source/command-logging-and-monitoring/tests/logging/redacted-commands.json +++ b/source/command-logging-and-monitoring/tests/logging/redacted-commands.json @@ -761,387 +761,6 @@ } ] }, - { - "description": "copydbgetnonce command and resulting server-generated error are redacted", - "runOnRequirements": [ - { - "maxServerVersion": "3.6.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbgetnonce", - "command": { - "copydbgetnonce": "private" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydbgetnonce", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "copydbgetnonce", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to copydbgetnonce is not redacted", - "runOnRequirements": [ - { - "maxServerVersion": "3.6.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "copydbgetnonce" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbgetnonce", - "command": { - "copydbgetnonce": "private" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydbgetnonce", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "copydbgetnonce", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "copydbsaslstart command and resulting server-generated error are redacted", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbsaslstart", - "command": { - "copydbsaslstart": "private" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydbsaslstart", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "copydbsaslstart", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to copydbsaslstart is not redacted", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "copydbsaslstart" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbsaslstart", - "command": { - "copydbsaslstart": "private" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydbgetnonce", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "copydbgetnonce", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "copydb command and resulting server-generated error are redacted", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydb", - "command": { - "copydb": "private" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydb", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "copydb", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to copydb is not redacted", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "copydb" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydb", - "command": { - "copydb": "private" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydb", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "copydb", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, { "description": "hello with speculative authenticate command and server reply are redacted", "runOnRequirements": [ diff --git a/source/command-logging-and-monitoring/tests/logging/redacted-commands.yml b/source/command-logging-and-monitoring/tests/logging/redacted-commands.yml index 05d61465e5..9868d775b9 100644 --- a/source/command-logging-and-monitoring/tests/logging/redacted-commands.yml +++ b/source/command-logging-and-monitoring/tests/logging/redacted-commands.yml @@ -456,221 +456,7 @@ tests: commandName: updateUser failure: { $$exists: true } - - description: "copydbgetnonce command and resulting server-generated error are redacted" - runOnRequirements: - - maxServerVersion: 3.6.99 # copydbgetnonce was removed as of 4.0 via SERVER-32276 - operations: - - name: runCommand - object: *database - arguments: - commandName: copydbgetnonce - command: - copydbgetnonce: "private" - expectError: - isClientError: false - expectLogMessages: - - client: *client - messages: - - level: debug - component: command - data: - message: "Command started" - databaseName: *databaseName - commandName: copydbgetnonce - command: - $$matchAsDocument: {} - - level: debug - component: command - failureIsRedacted: true - data: - message: "Command failed" - commandName: copydbgetnonce - failure: { $$exists: true } - - - description: "network error in response to copydbgetnonce is not redacted" - runOnRequirements: - - maxServerVersion: 3.6.99 # copydbgetnonce was removed as of 4.0 via SERVER-32276 - operations: - - name: failPoint - object: testRunner - arguments: - client: *failPointClient - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: ["copydbgetnonce"] - closeConnection: true - - name: runCommand - object: *database - arguments: - commandName: copydbgetnonce - command: - copydbgetnonce: "private" - expectError: - isClientError: true - expectLogMessages: - - client: *client - messages: - - level: debug - component: command - data: - message: "Command started" - databaseName: *databaseName - commandName: copydbgetnonce - command: - $$matchAsDocument: {} - - level: debug - component: command - failureIsRedacted: false - data: - message: "Command failed" - commandName: copydbgetnonce - failure: { $$exists: true } - - - description: "copydbsaslstart command and resulting server-generated error are redacted" - runOnRequirements: - - maxServerVersion: 4.0.99 # copydbsaslstart was removed as of 4.2 via SERVER-36211 - operations: - - name: runCommand - object: *database - arguments: - commandName: copydbsaslstart - command: - copydbsaslstart: "private" - expectError: - isClientError: false - expectLogMessages: - - client: *client - messages: - - level: debug - component: command - data: - message: "Command started" - databaseName: *databaseName - commandName: copydbsaslstart - command: - $$matchAsDocument: {} - - level: debug - component: command - failureIsRedacted: true - data: - message: "Command failed" - commandName: copydbsaslstart - failure: { $$exists: true } - - description: "network error in response to copydbsaslstart is not redacted" - runOnRequirements: - - maxServerVersion: 4.0.99 # copydbsaslstart was removed as of 4.2 via SERVER-36211 - operations: - - name: failPoint - object: testRunner - arguments: - client: *failPointClient - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: ["copydbsaslstart"] - closeConnection: true - - name: runCommand - object: *database - arguments: - commandName: copydbsaslstart - command: - copydbsaslstart: "private" - expectError: - isClientError: true - expectLogMessages: - - client: *client - messages: - - level: debug - component: command - data: - message: "Command started" - databaseName: *databaseName - commandName: copydbgetnonce - command: - $$matchAsDocument: {} - - level: debug - component: command - failureIsRedacted: false - data: - message: "Command failed" - commandName: copydbgetnonce - failure: { $$exists: true } - - - description: "copydb command and resulting server-generated error are redacted" - runOnRequirements: - - maxServerVersion: 4.0.99 # copydb was removed as of 4.2 via SERVER-36257 - operations: - - name: runCommand - object: *database - arguments: - commandName: copydb - command: - copydb: "private" - expectError: - isClientError: false - expectLogMessages: - - client: *client - messages: - - level: debug - component: command - data: - message: "Command started" - databaseName: *databaseName - commandName: copydb - command: - $$matchAsDocument: {} - - level: debug - component: command - failureIsRedacted: true - data: - message: "Command failed" - commandName: copydb - failure: { $$exists: true } - - - description: "network error in response to copydb is not redacted" - runOnRequirements: - - maxServerVersion: 4.0.99 # copydb was removed as of 4.2 via SERVER-36257 - operations: - - name: failPoint - object: testRunner - arguments: - client: *failPointClient - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: ["copydb"] - closeConnection: true - - name: runCommand - object: *database - arguments: - commandName: copydb - command: - copydb: "private" - expectError: - isClientError: true - expectLogMessages: - - client: *client - messages: - - level: debug - component: command - data: - message: "Command started" - databaseName: *databaseName - commandName: copydb - command: - $$matchAsDocument: {} - - level: debug - component: command - failureIsRedacted: false - data: - message: "Command failed" - commandName: copydb - failure: { $$exists: true } - description: "hello with speculative authenticate command and server reply are redacted" runOnRequirements: diff --git a/source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.json b/source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.json deleted file mode 100644 index 141fbe584f..0000000000 --- a/source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "description": "pre-42-server-connection-id", - "schemaVersion": "1.6", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "server-connection-id-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "databaseName": "server-connection-id-tests", - "collectionName": "coll", - "documents": [] - } - ], - "tests": [ - { - "description": "command events do not include server connection id", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "hasServerConnectionId": false - } - }, - { - "commandSucceededEvent": { - "commandName": "insert", - "hasServerConnectionId": false - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "hasServerConnectionId": false - } - }, - { - "commandFailedEvent": { - "commandName": "find", - "hasServerConnectionId": false - } - } - ] - } - ] - } - ] -} diff --git a/source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.yml b/source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.yml deleted file mode 100644 index 483a8a3c19..0000000000 --- a/source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.yml +++ /dev/null @@ -1,56 +0,0 @@ -description: "pre-42-server-connection-id" - -schemaVersion: "1.6" - -runOnRequirements: - - maxServerVersion: "4.0.99" - -createEntities: - - client: - id: &client client - observeEvents: - - commandStartedEvent - - commandSucceededEvent - - commandFailedEvent - - database: - id: &database database - client: *client - databaseName: &databaseName server-connection-id-tests - - collection: - id: &collection collection - database: *database - collectionName: &collectionName coll - -initialData: - - databaseName: *databaseName - collectionName: *collectionName - documents: [] - -tests: - - description: "command events do not include server connection id" - operations: - - name: insertOne - object: *collection - arguments: - document: { x: 1 } - - name: find - object: *collection - arguments: - filter: { $or: true } - expectError: - isError: true - expectEvents: - - client: *client - events: - - commandStartedEvent: - commandName: insert - hasServerConnectionId: false - - commandSucceededEvent: - commandName: insert - hasServerConnectionId: false - - commandStartedEvent: - commandName: find - hasServerConnectionId: false - - commandFailedEvent: - commandName: find - hasServerConnectionId: false diff --git a/source/command-logging-and-monitoring/tests/monitoring/redacted-commands.json b/source/command-logging-and-monitoring/tests/monitoring/redacted-commands.json index 4302ba8900..9edbf9a826 100644 --- a/source/command-logging-and-monitoring/tests/monitoring/redacted-commands.json +++ b/source/command-logging-and-monitoring/tests/monitoring/redacted-commands.json @@ -296,126 +296,6 @@ } ] }, - { - "description": "copydbgetnonce", - "runOnRequirements": [ - { - "maxServerVersion": "3.6.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbgetnonce", - "command": { - "copydbgetnonce": "private" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "copydbgetnonce", - "command": { - "copydbgetnonce": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "copydbsaslstart", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbsaslstart", - "command": { - "copydbsaslstart": "private" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "copydbsaslstart", - "command": { - "copydbsaslstart": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "copydb", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydb", - "command": { - "copydb": "private" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "copydb", - "command": { - "copydb": { - "$$exists": false - } - } - } - } - ] - } - ] - }, { "description": "hello with speculative authenticate", "runOnRequirements": [ diff --git a/source/command-logging-and-monitoring/tests/monitoring/redacted-commands.yml b/source/command-logging-and-monitoring/tests/monitoring/redacted-commands.yml index adeab99b18..b8f90f9db0 100644 --- a/source/command-logging-and-monitoring/tests/monitoring/redacted-commands.yml +++ b/source/command-logging-and-monitoring/tests/monitoring/redacted-commands.yml @@ -160,63 +160,6 @@ tests: pwd: { $$exists: false } roles: { $$exists: false } - - description: "copydbgetnonce" - runOnRequirements: - - maxServerVersion: 3.6.99 # copydbgetnonce was removed as of 4.0 via SERVER-32276 - operations: - - name: runCommand - object: *database - arguments: - commandName: copydbgetnonce - command: - copydbgetnonce: "private" - expectError: - isError: true - expectEvents: - - client: *client - events: - - commandStartedEvent: - commandName: copydbgetnonce - command: { copydbgetnonce: { $$exists: false } } - - - description: "copydbsaslstart" - runOnRequirements: - - maxServerVersion: 4.0.99 # copydbsaslstart was removed as of 4.2 via SERVER-36211 - operations: - - name: runCommand - object: *database - arguments: - commandName: copydbsaslstart - command: - copydbsaslstart: "private" - expectError: - isError: true - expectEvents: - - client: *client - events: - - commandStartedEvent: - commandName: copydbsaslstart - command: { copydbsaslstart: { $$exists: false } } - - - description: "copydb" - runOnRequirements: - - maxServerVersion: 4.0.99 # copydb was removed as of 4.2 via SERVER-36257 - operations: - - name: runCommand - object: *database - arguments: - commandName: copydb - command: - copydb: "private" - expectError: - isError: true - expectEvents: - - client: *client - events: - - commandStartedEvent: - commandName: copydb - command: { copydb: { $$exists: false } } - - description: "hello with speculative authenticate" runOnRequirements: - minServerVersion: "4.9" diff --git a/source/compression/OP_COMPRESSED.md b/source/compression/OP_COMPRESSED.md index 67c4f920ba..91bc061640 100644 --- a/source/compression/OP_COMPRESSED.md +++ b/source/compression/OP_COMPRESSED.md @@ -167,9 +167,6 @@ therefore effectively replaces the standard `MsgHeader` of the compressed opcode There is no guarantee that a response will be compressed even though compression was negotiated for in the handshake. Clients MUST be able to parse both compressed and uncompressed responses to both compressed and uncompressed requests. -MongoDB 3.4 will always reply with a compressed response when compression has been negotiated, but future versions may -not. - A client MAY choose to implement compression for only `OP_QUERY`, `OP_REPLY`, and `OP_MSG`, and perhaps for future opcodes, but not to implement it for `OP_INSERT`, `OP_UPDATE`, `OP_DELETE`, `OP_GETMORE`, and `OP_KILLCURSORS`. @@ -204,7 +201,7 @@ In general, after implementing this functionality and the test cases, running th a server with compression enabled, and ensuring the test suite is configured to provide a valid compressor as part of the connection string, is a good idea. MongoDB-supported drivers MUST add such variant to their CI environment. -The following cases assume a standalone MongoDB 3.4 (or later) node configured with: +The following cases assume a standalone MongoDB node configured with: ```shell mongod --networkMessageCompressors "snappy" -vvv @@ -371,7 +368,7 @@ needing to (not) compress very few operations. - The server MAY reply with compressed data even if the request was not compressed? - - Yes, and this is in fact the behaviour of MongoDB 3.4 + - Yes. - Can drivers compress the initial MongoDB Handshake/hello request? @@ -383,23 +380,14 @@ needing to (not) compress very few operations. using any supported compressor, when the client announced support for compression - this includes the reply to the actual MongoDB Handshake/`hello` where the support was announced. -- This is billed a MongoDB 3.6 feature -- but I hear it works with MongoDB 3.4? - - - Yes, it does. All MongoDB versions support the `compression` argument to the initial handshake and all MongoDB - versions will reply with an intersection of compressors it supports. This works even with MongoDB 3.0, as it will - not reply with any compressors. It also works with MongoDB 3.4 which will reply with `snappy` if it was part of - the driver's list. MongoDB 3.6 will likely include zlib support. - - Which compressors are currently supported? - - MongoDB 3.4 supports `snappy` - - MongoDB 3.6 supports `snappy` and `zlib` - - MongoDB 4.2 supports `snappy`, `zlib`, and `zstd` + - All supported MongoDB versions support `snappy`, `zlib`, and `zstd`. - My language supports xyz compressor, should I announce them all in the handshake? - - No. But you are allowed to if you really want to make sure you can use that compressor with MongoDB 4.2 and your - current driver versions. + - No. But you are allowed to if you really want to make sure you can use that compressor with your current driver + versions. - My language does not support xzy compressor. What do I do? @@ -410,13 +398,7 @@ needing to (not) compress very few operations. - That is OK. You don’t have to support compressors you can’t support. All it means is you can’t compress the request, and since you never declared support for any compressor, you won’t be served with compressed responses either. -- Why did the server not support zlib in MongoDB 3.4? - - - Snappy was selected for its very low performance hit, while giving reasonable compression, resulting in quite - significant bandwidth reduction. Zlib characteristics are slightly different out-of-the-box and did not make sense - for the initial goal of reducing bandwidth between replica set nodes. - -- If snappy is preferable to zlib, why add support for zlib in MongoDB 3.6? +- If snappy is preferable to zlib, why add support for zlib? - Zlib is available on every platform known to man. Snappy is not. Having zlib support makes sense for client traffic, which could originate on any type of platform, which may or may not support snappy. diff --git a/source/crud/tests/unified/bulkWrite-arrayFilters-clientError.json b/source/crud/tests/unified/bulkWrite-arrayFilters-clientError.json deleted file mode 100644 index 63815e3233..0000000000 --- a/source/crud/tests/unified/bulkWrite-arrayFilters-clientError.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "description": "bulkWrite-arrayFilters-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.5.5" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "crud-v2" - } - } - ], - "initialData": [ - { - "collectionName": "crud-v2", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite on server that doesn't support arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": {}, - "update": { - "$set": { - "y.0.b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "BulkWrite on server that doesn't support arrayFilters with arrayFilters on second op", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": {}, - "update": { - "$set": { - "y.0.b": 2 - } - } - } - }, - { - "updateMany": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/bulkWrite-arrayFilters-clientError.yml b/source/crud/tests/unified/bulkWrite-arrayFilters-clientError.yml deleted file mode 100644 index 12bc84c704..0000000000 --- a/source/crud/tests/unified/bulkWrite-arrayFilters-clientError.yml +++ /dev/null @@ -1,95 +0,0 @@ -description: bulkWrite-arrayFilters-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 3.5.5 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name crud-v2 -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - 'y': - - - b: 3 - - - b: 1 - - - _id: 2 - 'y': - - - b: 0 - - - b: 1 -tests: - - - description: 'BulkWrite on server that doesn''t support arrayFilters' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - updateOne: - filter: { } - update: - $set: - y.0.b: 2 - arrayFilters: - - - i.b: 1 - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - - - description: 'BulkWrite on server that doesn''t support arrayFilters with arrayFilters on second op' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - updateOne: - filter: { } - update: - $set: - y.0.b: 2 - - - updateMany: - filter: { } - update: - $set: - 'y.$[i].b': 2 - arrayFilters: - - - i.b: 1 - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] diff --git a/source/crud/tests/unified/bulkWrite-delete-hint-clientError.json b/source/crud/tests/unified/bulkWrite-delete-hint-clientError.json deleted file mode 100644 index 2961b55dc0..0000000000 --- a/source/crud/tests/unified/bulkWrite-delete-hint-clientError.json +++ /dev/null @@ -1,193 +0,0 @@ -{ - "description": "bulkWrite-delete-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "BulkWrite_delete_hint" - } - } - ], - "initialData": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite deleteOne with hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - } - }, - { - "deleteOne": { - "filter": { - "_id": 2 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite deleteMany with hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "hint": "_id_" - } - }, - { - "deleteMany": { - "filter": { - "_id": { - "$gte": 4 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/bulkWrite-delete-hint-clientError.yml b/source/crud/tests/unified/bulkWrite-delete-hint-clientError.yml deleted file mode 100644 index 5c17261004..0000000000 --- a/source/crud/tests/unified/bulkWrite-delete-hint-clientError.yml +++ /dev/null @@ -1,110 +0,0 @@ -description: bulkWrite-delete-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 3.3.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name BulkWrite_delete_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - _id: 4 - x: 44 -tests: - - - description: 'BulkWrite deleteOne with hints unsupported (client-side error)' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - deleteOne: - filter: &deleteOne_filter1 - _id: 1 - hint: &hint_string _id_ - - - deleteOne: - filter: &deleteOne_filter2 - _id: 2 - hint: &hint_doc - _id: 1 - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - _id: 4 - x: 44 - - - description: 'BulkWrite deleteMany with hints unsupported (client-side error)' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - deleteMany: - filter: &deleteMany_filter1 - _id: - $lt: 3 - hint: *hint_string - - - deleteMany: - filter: &deleteMany_filter2 - _id: - $gte: 4 - hint: *hint_doc - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome diff --git a/source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.json b/source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.json index fce647d8f4..cbbc30c18c 100644 --- a/source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.json +++ b/source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.json @@ -120,80 +120,6 @@ } ] }, - { - "description": "Replacing document with top-level dotted key on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a.b": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, { "description": "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server", "runOnRequirements": [ @@ -449,84 +375,6 @@ ] } ] - }, - { - "description": "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] } ] } diff --git a/source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.yml b/source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.yml index 65c414c1d6..430d416ddd 100644 --- a/source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.yml +++ b/source/crud/tests/unified/bulkWrite-replaceOne-dots_and_dollars.yml @@ -58,22 +58,6 @@ tests: documents: - *dottedKey - - description: "Replacing document with top-level dotted key on pre-3.6 server yields server-side error" - runOnRequirements: - - maxServerVersion: "3.4.99" - operations: - - name: bulkWrite - object: *collection0 - arguments: - requests: - - replaceOne: - filter: { _id: 1 } - replacement: *dottedKey - expectError: - isClientError: false - expectEvents: *expectEventsDottedKey - outcome: *initialData - - description: "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server" runOnRequirements: - minServerVersion: "5.0" @@ -148,18 +132,3 @@ tests: documents: - *dottedKeyInEmbedded - - description: "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error" - runOnRequirements: - - maxServerVersion: "3.4.99" - operations: - - name: bulkWrite - object: *collection0 - arguments: - requests: - - replaceOne: - filter: { _id: 1 } - replacement: *dottedKeyInEmbedded - expectError: - isClientError: false - expectEvents: *expectEventsDottedKeyInEmbedded - outcome: *initialData diff --git a/source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.json b/source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.json index e54cd704df..e051c36bbd 100644 --- a/source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.json +++ b/source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.json @@ -47,88 +47,6 @@ } ], "tests": [ - { - "description": "Unacknowledged replaceOne with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged replaceOne with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, { "description": "Unacknowledged replaceOne with hint string on 4.2+ server", "runOnRequirements": [ diff --git a/source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.yml b/source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.yml index d656c5fc6b..9318fc0d64 100644 --- a/source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.yml +++ b/source/crud/tests/unified/bulkWrite-replaceOne-hint-unacknowledged.yml @@ -26,40 +26,6 @@ initialData: - { _id: 2, x: 22 } tests: - - description: "Unacknowledged replaceOne with hint string fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: bulkWrite - arguments: - requests: - - replaceOne: - filter: &filter { _id: { $gt: 1 } } - replacement: &replacement { x: 111 } - hint: _id_ - expectError: - isClientError: true - expectEvents: &noEvents - - client: *client0 - events: [] - - - description: "Unacknowledged replaceOne with hint document fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: bulkWrite - arguments: - requests: - - replaceOne: - filter: *filter - replacement: *replacement - hint: { _id: 1 } - expectError: - isClientError: true - expectEvents: *noEvents - - description: "Unacknowledged replaceOne with hint string on 4.2+ server" runOnRequirements: - minServerVersion: "4.2.0" @@ -69,8 +35,8 @@ tests: arguments: requests: - replaceOne: - filter: *filter - replacement: *replacement + filter: &filter { _id: { $gt: 1 } } + replacement: &replacement { x: 111 } hint: _id_ expectResult: &unacknowledgedResult { $$unsetOrMatches: { acknowledged: { $$unsetOrMatches: false } } } expectEvents: &events diff --git a/source/crud/tests/unified/bulkWrite-update-hint-clientError.json b/source/crud/tests/unified/bulkWrite-update-hint-clientError.json deleted file mode 100644 index d5eb71c29e..0000000000 --- a/source/crud/tests/unified/bulkWrite-update-hint-clientError.json +++ /dev/null @@ -1,284 +0,0 @@ -{ - "description": "bulkWrite-update-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_bulkwrite_update_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateOne with update hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite updateMany with update hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite replaceOne with update hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "x": 333 - }, - "hint": "_id_" - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 444 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/bulkWrite-update-hint-clientError.yml b/source/crud/tests/unified/bulkWrite-update-hint-clientError.yml deleted file mode 100644 index cf75a7c450..0000000000 --- a/source/crud/tests/unified/bulkWrite-update-hint-clientError.yml +++ /dev/null @@ -1,145 +0,0 @@ -description: bulkWrite-update-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 3.3.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name test_bulkwrite_update_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - _id: 4 - x: 44 -tests: - - - description: 'BulkWrite updateOne with update hints unsupported (client-side error)' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - updateOne: - filter: &updateOne_filter - _id: 1 - update: &updateOne_update - $inc: - x: 1 - hint: &hint_string _id_ - - - updateOne: - filter: *updateOne_filter - update: *updateOne_update - hint: &hint_doc - _id: 1 - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - _id: 4 - x: 44 - - - description: 'BulkWrite updateMany with update hints unsupported (client-side error)' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - updateMany: - filter: &updateMany_filter - _id: - $lt: 3 - update: &updateMany_update - $inc: - x: 1 - hint: *hint_string - - - updateMany: - filter: *updateMany_filter - update: *updateMany_update - hint: *hint_doc - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome - - - description: 'BulkWrite replaceOne with update hints unsupported (client-side error)' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - replaceOne: - filter: - _id: 3 - replacement: - x: 333 - hint: *hint_string - - - replaceOne: - filter: - _id: 4 - replacement: - x: 444 - hint: *hint_doc - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome diff --git a/source/crud/tests/unified/bulkWrite-update-hint-serverError.json b/source/crud/tests/unified/bulkWrite-update-hint-serverError.json deleted file mode 100644 index b0f7e1b381..0000000000 --- a/source/crud/tests/unified/bulkWrite-update-hint-serverError.json +++ /dev/null @@ -1,422 +0,0 @@ -{ - "description": "bulkWrite-update-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.1.9" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_bulkwrite_update_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateOne with update hints unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_", - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite updateMany with update hints unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": { - "$lt": 3 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": "_id_", - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$lt": 3 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": { - "_id": 1 - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite replaceOne with update hints unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "x": 333 - }, - "hint": "_id_" - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 444 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": 3 - }, - "u": { - "x": 333 - }, - "hint": "_id_", - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": 4 - }, - "u": { - "x": 444 - }, - "hint": { - "_id": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/bulkWrite-update-hint-serverError.yml b/source/crud/tests/unified/bulkWrite-update-hint-serverError.yml deleted file mode 100644 index 64310a2eaf..0000000000 --- a/source/crud/tests/unified/bulkWrite-update-hint-serverError.yml +++ /dev/null @@ -1,236 +0,0 @@ -description: bulkWrite-update-hint-serverError -schemaVersion: '1.0' -runOnRequirements: - - - minServerVersion: 3.4.0 - maxServerVersion: 4.1.9 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name test_bulkwrite_update_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - _id: 4 - x: 44 -tests: - - - description: 'BulkWrite updateOne with update hints unsupported (server-side error)' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - updateOne: - filter: &updateOne_filter - _id: 1 - update: &updateOne_update - $inc: - x: 1 - hint: &hint_string _id_ - - - updateOne: - filter: *updateOne_filter - update: *updateOne_update - hint: &hint_doc - _id: 1 - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: - - - commandStartedEvent: - command: - update: *collection_name - updates: - - - q: *updateOne_filter - u: *updateOne_update - hint: *hint_string - multi: { $$unsetOrMatches: false } - upsert: { $$unsetOrMatches: false } - - - q: *updateOne_filter - u: *updateOne_update - hint: *hint_doc - multi: { $$unsetOrMatches: false } - upsert: { $$unsetOrMatches: false } - ordered: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - _id: 4 - x: 44 - - - description: 'BulkWrite updateMany with update hints unsupported (server-side error)' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - updateMany: - filter: &updateMany_filter - _id: - $lt: 3 - update: &updateMany_update - $inc: - x: 1 - hint: *hint_string - - - updateMany: - filter: *updateMany_filter - update: *updateMany_update - hint: *hint_doc - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: - - - commandStartedEvent: - command: - update: *collection_name - updates: - - - q: *updateMany_filter - u: *updateMany_update - multi: true - hint: *hint_string - upsert: { $$unsetOrMatches: false } - - - q: *updateMany_filter - u: *updateMany_update - multi: true - hint: *hint_doc - upsert: { $$unsetOrMatches: false } - ordered: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - _id: 4 - x: 44 - - - description: 'BulkWrite replaceOne with update hints unsupported (server-side error)' - operations: - - - object: *collection0 - name: bulkWrite - arguments: - requests: - - - replaceOne: - filter: - _id: 3 - replacement: - x: 333 - hint: *hint_string - - - replaceOne: - filter: - _id: 4 - replacement: - x: 444 - hint: *hint_doc - ordered: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: - - - commandStartedEvent: - command: - update: *collection_name - updates: - - - q: - _id: 3 - u: - x: 333 - hint: *hint_string - multi: { $$unsetOrMatches: false } - upsert: { $$unsetOrMatches: false } - - - q: - _id: 4 - u: - x: 444 - hint: *hint_doc - multi: { $$unsetOrMatches: false } - upsert: { $$unsetOrMatches: false } - ordered: true - outcome: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - _id: 4 - x: 44 diff --git a/source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.json b/source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.json index 87478918d2..22f6a5b239 100644 --- a/source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.json +++ b/source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.json @@ -51,92 +51,6 @@ } ], "tests": [ - { - "description": "Unacknowledged updateMany with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateMany with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, { "description": "Unacknowledged updateMany with hint string on 4.2+ server", "runOnRequirements": [ diff --git a/source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.yml b/source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.yml index 7cb376c90c..6945bd0c47 100644 --- a/source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.yml +++ b/source/crud/tests/unified/bulkWrite-updateMany-hint-unacknowledged.yml @@ -27,40 +27,6 @@ initialData: - { _id: 3, x: 33 } tests: - - description: "Unacknowledged updateMany with hint string fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: bulkWrite - arguments: - requests: - - updateMany: - filter: &filter { _id: { $gt: 1 } } - update: &update { $inc: { x: 1 } } - hint: _id_ - expectError: - isClientError: true - expectEvents: &noEvents - - client: *client0 - events: [] - - - description: "Unacknowledged updateMany with hint document fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: bulkWrite - arguments: - requests: - - updateMany: - filter: *filter - update: *update - hint: { _id: 1 } - expectError: - isClientError: true - expectEvents: *noEvents - - description: "Unacknowledged updateMany with hint string on 4.2+ server" runOnRequirements: - minServerVersion: "4.2.0" @@ -70,8 +36,8 @@ tests: arguments: requests: - updateMany: - filter: *filter - update: *update + filter: &filter { _id: { $gt: 1 } } + update: &update { $inc: { x: 1 } } hint: _id_ expectResult: &unacknowledgedResult { $$unsetOrMatches: { acknowledged: { $$unsetOrMatches: false } } } expectEvents: &events diff --git a/source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.json b/source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.json index 1345f6b536..f296c51b99 100644 --- a/source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.json +++ b/source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.json @@ -47,92 +47,6 @@ } ], "tests": [ - { - "description": "Unacknowledged updateOne with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateOne with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, { "description": "Unacknowledged updateOne with hint string on 4.2+ server", "runOnRequirements": [ diff --git a/source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.yml b/source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.yml index 5997c54c2b..953f4dac8c 100644 --- a/source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.yml +++ b/source/crud/tests/unified/bulkWrite-updateOne-hint-unacknowledged.yml @@ -26,40 +26,6 @@ initialData: - { _id: 2, x: 22 } tests: - - description: "Unacknowledged updateOne with hint string fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: bulkWrite - arguments: - requests: - - updateOne: - filter: &filter { _id: { $gt: 1 } } - update: &update { $inc: { x: 1 } } - hint: _id_ - expectError: - isClientError: true - expectEvents: &noEvents - - client: *client0 - events: [] - - - description: "Unacknowledged updateOne with hint document fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: bulkWrite - arguments: - requests: - - updateOne: - filter: *filter - update: *update - hint: { _id: 1 } - expectError: - isClientError: true - expectEvents: *noEvents - - description: "Unacknowledged updateOne with hint string on 4.2+ server" runOnRequirements: - minServerVersion: "4.2.0" @@ -69,8 +35,8 @@ tests: arguments: requests: - updateOne: - filter: *filter - update: *update + filter: &filter { _id: { $gt: 1 } } + update: &update { $inc: { x: 1 } } hint: _id_ expectResult: &unacknowledgedResult { $$unsetOrMatches: { acknowledged: { $$unsetOrMatches: false } } } expectEvents: &events diff --git a/source/crud/tests/unified/deleteMany-hint-clientError.json b/source/crud/tests/unified/deleteMany-hint-clientError.json deleted file mode 100644 index 66320122b5..0000000000 --- a/source/crud/tests/unified/deleteMany-hint-clientError.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "description": "deleteMany-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "DeleteMany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "DeleteMany with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "DeleteMany with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/deleteMany-hint-clientError.yml b/source/crud/tests/unified/deleteMany-hint-clientError.yml deleted file mode 100644 index c04d7507e3..0000000000 --- a/source/crud/tests/unified/deleteMany-hint-clientError.yml +++ /dev/null @@ -1,84 +0,0 @@ -description: deleteMany-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 3.3.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name DeleteMany_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 -tests: - - - description: 'DeleteMany with hint string unsupported (client-side error)' - operations: - - - object: *collection0 - name: deleteMany - arguments: - filter: &filter - _id: - $gt: 1 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - description: 'DeleteMany with hint document unsupported (client-side error)' - operations: - - - object: *collection0 - name: deleteMany - arguments: - filter: *filter - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome diff --git a/source/crud/tests/unified/deleteOne-hint-clientError.json b/source/crud/tests/unified/deleteOne-hint-clientError.json deleted file mode 100644 index cf629f59e0..0000000000 --- a/source/crud/tests/unified/deleteOne-hint-clientError.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "description": "deleteOne-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "DeleteOne_hint" - } - } - ], - "initialData": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/deleteOne-hint-clientError.yml b/source/crud/tests/unified/deleteOne-hint-clientError.yml deleted file mode 100644 index 7ff6f8d961..0000000000 --- a/source/crud/tests/unified/deleteOne-hint-clientError.yml +++ /dev/null @@ -1,77 +0,0 @@ -description: deleteOne-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 3.3.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name DeleteOne_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 -tests: - - - description: 'DeleteOne with hint string unsupported (client-side error)' - operations: - - - object: *collection0 - name: deleteOne - arguments: - filter: &filter - _id: 1 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - description: 'DeleteOne with hint document unsupported (client-side error)' - operations: - - - object: *collection0 - name: deleteOne - arguments: - filter: *filter - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome diff --git a/source/crud/tests/unified/find-allowdiskuse-clientError.json b/source/crud/tests/unified/find-allowdiskuse-clientError.json deleted file mode 100644 index 5bd954e79d..0000000000 --- a/source/crud/tests/unified/find-allowdiskuse-clientError.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "description": "find-allowdiskuse-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_find_allowdiskuse_clienterror" - } - } - ], - "tests": [ - { - "description": "Find fails when allowDiskUse true is specified against pre 3.2 server", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "allowDiskUse": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Find fails when allowDiskUse false is specified against pre 3.2 server", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "allowDiskUse": false - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/find-allowdiskuse-clientError.yml b/source/crud/tests/unified/find-allowdiskuse-clientError.yml deleted file mode 100644 index da7f6365f1..0000000000 --- a/source/crud/tests/unified/find-allowdiskuse-clientError.yml +++ /dev/null @@ -1,52 +0,0 @@ -description: find-allowdiskuse-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 3.0.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name test_find_allowdiskuse_clienterror -tests: - - - description: 'Find fails when allowDiskUse true is specified against pre 3.2 server' - operations: - - - object: *collection0 - name: find - arguments: - filter: { } - allowDiskUse: true - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - - - description: 'Find fails when allowDiskUse false is specified against pre 3.2 server' - operations: - - - object: *collection0 - name: find - arguments: - filter: { } - allowDiskUse: false - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] diff --git a/source/crud/tests/unified/findOneAndDelete-hint-clientError.json b/source/crud/tests/unified/findOneAndDelete-hint-clientError.json deleted file mode 100644 index c6ff467866..0000000000 --- a/source/crud/tests/unified/findOneAndDelete-hint-clientError.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "description": "findOneAndDelete-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndDelete_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete with hint document", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/findOneAndDelete-hint-clientError.yml b/source/crud/tests/unified/findOneAndDelete-hint-clientError.yml deleted file mode 100644 index 46c7521ad8..0000000000 --- a/source/crud/tests/unified/findOneAndDelete-hint-clientError.yml +++ /dev/null @@ -1,88 +0,0 @@ -description: findOneAndDelete-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 4.0.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name findOneAndDelete_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 -tests: - - - description: 'FindOneAndDelete with hint string unsupported (client-side error)' - operations: - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: &filter - _id: 1 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - description: 'FindOneAndDelete with hint document' - operations: - - - object: *collection0 - name: findOneAndDelete - arguments: - filter: &filter - _id: 1 - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 diff --git a/source/crud/tests/unified/findOneAndReplace-dots_and_dollars.json b/source/crud/tests/unified/findOneAndReplace-dots_and_dollars.json index 19ac447f84..5a0c551e3f 100644 --- a/source/crud/tests/unified/findOneAndReplace-dots_and_dollars.json +++ b/source/crud/tests/unified/findOneAndReplace-dots_and_dollars.json @@ -99,67 +99,6 @@ } ] }, - { - "description": "Replacing document with top-level dotted key on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "_id": 1, - "a.b": 1 - }, - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, { "description": "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server", "runOnRequirements": [ @@ -360,71 +299,6 @@ ] } ] - }, - { - "description": "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] } ] } diff --git a/source/crud/tests/unified/findOneAndReplace-dots_and_dollars.yml b/source/crud/tests/unified/findOneAndReplace-dots_and_dollars.yml index 0823824cca..f96e742407 100644 --- a/source/crud/tests/unified/findOneAndReplace-dots_and_dollars.yml +++ b/source/crud/tests/unified/findOneAndReplace-dots_and_dollars.yml @@ -47,20 +47,6 @@ tests: documents: - *dottedKey - - description: "Replacing document with top-level dotted key on pre-3.6 server yields server-side error" - runOnRequirements: - - maxServerVersion: "3.4.99" - operations: - - name: findOneAndReplace - object: *collection0 - arguments: - filter: { _id: 1 } - replacement: *dottedKey - expectError: - isClientError: false - expectEvents: *expectEventsDottedKey - outcome: *initialData - - description: "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server" runOnRequirements: - minServerVersion: "5.0" @@ -125,16 +111,3 @@ tests: documents: - *dottedKeyInEmbedded - - description: "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error" - runOnRequirements: - - maxServerVersion: "3.4.99" - operations: - - name: findOneAndReplace - object: *collection0 - arguments: - filter: { _id: 1 } - replacement: *dottedKeyInEmbedded - expectError: - isClientError: false - expectEvents: *expectEventsDottedKeyInEmbedded - outcome: *initialData diff --git a/source/crud/tests/unified/findOneAndReplace-hint-clientError.json b/source/crud/tests/unified/findOneAndReplace-hint-clientError.json deleted file mode 100644 index 6b07eb1f4d..0000000000 --- a/source/crud/tests/unified/findOneAndReplace-hint-clientError.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "description": "findOneAndReplace-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndReplace_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/findOneAndReplace-hint-clientError.yml b/source/crud/tests/unified/findOneAndReplace-hint-clientError.yml deleted file mode 100644 index a0a8f94beb..0000000000 --- a/source/crud/tests/unified/findOneAndReplace-hint-clientError.yml +++ /dev/null @@ -1,80 +0,0 @@ -description: findOneAndReplace-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 4.0.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name findOneAndReplace_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 -tests: - - - description: 'FindOneAndReplace with hint string unsupported (client-side error)' - operations: - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: &filter - _id: 1 - replacement: &replacement - x: 33 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - description: 'FindOneAndReplace with hint document unsupported (client-side error)' - operations: - - - object: *collection0 - name: findOneAndReplace - arguments: - filter: *filter - replacement: *replacement - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome diff --git a/source/crud/tests/unified/findOneAndUpdate-hint-clientError.json b/source/crud/tests/unified/findOneAndUpdate-hint-clientError.json deleted file mode 100644 index d0b51313c9..0000000000 --- a/source/crud/tests/unified/findOneAndUpdate-hint-clientError.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "description": "findOneAndUpdate-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndUpdate_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/findOneAndUpdate-hint-clientError.yml b/source/crud/tests/unified/findOneAndUpdate-hint-clientError.yml deleted file mode 100644 index 77b41a165c..0000000000 --- a/source/crud/tests/unified/findOneAndUpdate-hint-clientError.yml +++ /dev/null @@ -1,81 +0,0 @@ -description: findOneAndUpdate-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 4.0.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name findOneAndUpdate_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 -tests: - - - description: 'FindOneAndUpdate with hint string unsupported (client-side error)' - operations: - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: &filter - _id: 1 - update: &update - $inc: - x: 1 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - description: 'FindOneAndUpdate with hint document unsupported (client-side error)' - operations: - - - object: *collection0 - name: findOneAndUpdate - arguments: - filter: *filter - update: *update - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome diff --git a/source/crud/tests/unified/insertOne-dots_and_dollars.json b/source/crud/tests/unified/insertOne-dots_and_dollars.json index fdc17af2e8..fa69eb28bd 100644 --- a/source/crud/tests/unified/insertOne-dots_and_dollars.json +++ b/source/crud/tests/unified/insertOne-dots_and_dollars.json @@ -439,58 +439,6 @@ } ] }, - { - "description": "Inserting document with dotted key in _id on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": { - "a.b": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": { - "a.b": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ] - }, { "description": "Inserting document with DBRef-like keys", "operations": [ diff --git a/source/crud/tests/unified/insertOne-dots_and_dollars.yml b/source/crud/tests/unified/insertOne-dots_and_dollars.yml index fcfcfc71c6..9c8e7ec779 100644 --- a/source/crud/tests/unified/insertOne-dots_and_dollars.yml +++ b/source/crud/tests/unified/insertOne-dots_and_dollars.yml @@ -172,19 +172,6 @@ tests: documents: - *dottedKeyInId - - description: "Inserting document with dotted key in _id on pre-3.6 server yields server-side error" - runOnRequirements: - - maxServerVersion: "3.4.99" - operations: - - name: insertOne - object: *collection0 - arguments: - document: *dottedKeyInId - expectError: - isClientError: false - expectEvents: *expectEventsDottedKeyInId - outcome: *initialData - - description: "Inserting document with DBRef-like keys" operations: - name: insertOne diff --git a/source/crud/tests/unified/replaceOne-dots_and_dollars.json b/source/crud/tests/unified/replaceOne-dots_and_dollars.json index d5003dc5ea..ebe34a4754 100644 --- a/source/crud/tests/unified/replaceOne-dots_and_dollars.json +++ b/source/crud/tests/unified/replaceOne-dots_and_dollars.json @@ -120,74 +120,6 @@ } ] }, - { - "description": "Replacing document with top-level dotted key on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a.b": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, { "description": "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server", "runOnRequirements": [ @@ -414,78 +346,6 @@ } ] }, - { - "description": "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, { "description": "Unacknowledged write using dollar-prefixed or dotted keys may be silently rejected on pre-5.0 server", "runOnRequirements": [ diff --git a/source/crud/tests/unified/replaceOne-dots_and_dollars.yml b/source/crud/tests/unified/replaceOne-dots_and_dollars.yml index b834e22205..caa393a6c1 100644 --- a/source/crud/tests/unified/replaceOne-dots_and_dollars.yml +++ b/source/crud/tests/unified/replaceOne-dots_and_dollars.yml @@ -58,20 +58,6 @@ tests: documents: - *dottedKey - - description: "Replacing document with top-level dotted key on pre-3.6 server yields server-side error" - runOnRequirements: - - maxServerVersion: "3.4.99" - operations: - - name: replaceOne - object: *collection0 - arguments: - filter: { _id: 1 } - replacement: *dottedKey - expectError: - isClientError: false - expectEvents: *expectEventsDottedKey - outcome: *initialData - - description: "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server" runOnRequirements: - minServerVersion: "5.0" @@ -140,20 +126,6 @@ tests: documents: - *dottedKeyInEmbedded - - description: "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error" - runOnRequirements: - - maxServerVersion: "3.4.99" - operations: - - name: replaceOne - object: *collection0 - arguments: - filter: { _id: 1 } - replacement: *dottedKeyInEmbedded - expectError: - isClientError: false - expectEvents: *expectEventsDottedKeyInEmbedded - outcome: *initialData - - description: "Unacknowledged write using dollar-prefixed or dotted keys may be silently rejected on pre-5.0 server" runOnRequirements: - maxServerVersion: "4.99" diff --git a/source/crud/tests/unified/replaceOne-hint-unacknowledged.json b/source/crud/tests/unified/replaceOne-hint-unacknowledged.json index 5c5dec64f6..88efbb6d26 100644 --- a/source/crud/tests/unified/replaceOne-hint-unacknowledged.json +++ b/source/crud/tests/unified/replaceOne-hint-unacknowledged.json @@ -47,76 +47,6 @@ } ], "tests": [ - { - "description": "Unacknowledged replaceOne with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged replaceOne with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, { "description": "Unacknowledged replaceOne with hint string on 4.2+ server", "runOnRequirements": [ diff --git a/source/crud/tests/unified/replaceOne-hint-unacknowledged.yml b/source/crud/tests/unified/replaceOne-hint-unacknowledged.yml index debb99b22f..019e0b78ec 100644 --- a/source/crud/tests/unified/replaceOne-hint-unacknowledged.yml +++ b/source/crud/tests/unified/replaceOne-hint-unacknowledged.yml @@ -26,36 +26,6 @@ initialData: - { _id: 2, x: 22 } tests: - - description: "Unacknowledged replaceOne with hint string fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: replaceOne - arguments: - filter: &filter { _id: { $gt: 1 } } - replacement: &replacement { x: 111 } - hint: _id_ - expectError: - isClientError: true - expectEvents: &noEvents - - client: *client0 - events: [] - - - description: "Unacknowledged replaceOne with hint document fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: replaceOne - arguments: - filter: *filter - replacement: *replacement - hint: { _id: 1 } - expectError: - isClientError: true - expectEvents: *noEvents - - description: "Unacknowledged replaceOne with hint string on 4.2+ server" runOnRequirements: - minServerVersion: "4.2.0" @@ -63,8 +33,8 @@ tests: - object: *collection0 name: replaceOne arguments: - filter: *filter - replacement: *replacement + filter: &filter { _id: { $gt: 1 } } + replacement: &replacement { x: 111 } hint: _id_ expectResult: &unacknowledgedResult { $$unsetOrMatches: { acknowledged: { $$unsetOrMatches: false } } } expectEvents: &events diff --git a/source/crud/tests/unified/updateMany-hint-clientError.json b/source/crud/tests/unified/updateMany-hint-clientError.json deleted file mode 100644 index 5da878e293..0000000000 --- a/source/crud/tests/unified/updateMany-hint-clientError.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "description": "updateMany-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updatemany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "UpdateMany with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/updateMany-hint-clientError.yml b/source/crud/tests/unified/updateMany-hint-clientError.yml deleted file mode 100644 index 163168ecfa..0000000000 --- a/source/crud/tests/unified/updateMany-hint-clientError.yml +++ /dev/null @@ -1,88 +0,0 @@ -description: updateMany-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 3.3.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name test_updatemany_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 -tests: - - - description: 'UpdateMany with hint string unsupported (client-side error)' - operations: - - - object: *collection0 - name: updateMany - arguments: - filter: &filter - _id: - $gt: 1 - update: &update - $inc: - x: 1 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - description: 'UpdateMany with hint document unsupported (client-side error)' - operations: - - - object: *collection0 - name: updateMany - arguments: - filter: *filter - update: *update - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome diff --git a/source/crud/tests/unified/updateMany-hint-serverError.json b/source/crud/tests/unified/updateMany-hint-serverError.json deleted file mode 100644 index c81f36b13c..0000000000 --- a/source/crud/tests/unified/updateMany-hint-serverError.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "description": "updateMany-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.1.9" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updatemany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updatemany_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": "_id_", - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "UpdateMany with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updatemany_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": { - "_id": 1 - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/updateMany-hint-serverError.yml b/source/crud/tests/unified/updateMany-hint-serverError.yml deleted file mode 100644 index 61d7179fc0..0000000000 --- a/source/crud/tests/unified/updateMany-hint-serverError.yml +++ /dev/null @@ -1,112 +0,0 @@ -description: updateMany-hint-serverError -schemaVersion: '1.0' -runOnRequirements: - - - minServerVersion: 3.4.0 - maxServerVersion: 4.1.9 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name test_updatemany_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 -tests: - - - description: 'UpdateMany with hint string unsupported (server-side error)' - operations: - - - object: *collection0 - name: updateMany - arguments: - filter: &filter - _id: - $gt: 1 - update: &update - $inc: - x: 1 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: - - - commandStartedEvent: - command: - update: *collection_name - updates: - - - q: *filter - u: *update - multi: true - hint: _id_ - upsert: { $$unsetOrMatches: false } - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - _id: 3 - x: 33 - - - description: 'UpdateMany with hint document unsupported (server-side error)' - operations: - - - object: *collection0 - name: updateMany - arguments: - filter: *filter - update: *update - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: - - - commandStartedEvent: - command: - update: *collection_name - updates: - - - q: *filter - u: *update - multi: true - hint: - _id: 1 - upsert: { $$unsetOrMatches: false } - outcome: *outcome diff --git a/source/crud/tests/unified/updateMany-hint-unacknowledged.json b/source/crud/tests/unified/updateMany-hint-unacknowledged.json index e83838aac2..02f50fa528 100644 --- a/source/crud/tests/unified/updateMany-hint-unacknowledged.json +++ b/source/crud/tests/unified/updateMany-hint-unacknowledged.json @@ -51,80 +51,6 @@ } ], "tests": [ - { - "description": "Unacknowledged updateMany with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateMany with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, { "description": "Unacknowledged updateMany with hint string on 4.2+ server", "runOnRequirements": [ diff --git a/source/crud/tests/unified/updateMany-hint-unacknowledged.yml b/source/crud/tests/unified/updateMany-hint-unacknowledged.yml index 9f15297385..1ade05e818 100644 --- a/source/crud/tests/unified/updateMany-hint-unacknowledged.yml +++ b/source/crud/tests/unified/updateMany-hint-unacknowledged.yml @@ -27,36 +27,6 @@ initialData: - { _id: 3, x: 33 } tests: - - description: "Unacknowledged updateMany with hint string fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: updateMany - arguments: - filter: &filter { _id: { $gt: 1 } } - update: &update { $inc: { x: 1 } } - hint: _id_ - expectError: - isClientError: true - expectEvents: &noEvents - - client: *client0 - events: [] - - - description: "Unacknowledged updateMany with hint document fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: updateMany - arguments: - filter: *filter - update: *update - hint: { _id: 1 } - expectError: - isClientError: true - expectEvents: *noEvents - - description: "Unacknowledged updateMany with hint string on 4.2+ server" runOnRequirements: - minServerVersion: "4.2.0" @@ -64,8 +34,8 @@ tests: - object: *collection0 name: updateMany arguments: - filter: *filter - update: *update + filter: &filter { _id: { $gt: 1 } } + update: &update { $inc: { x: 1 } } hint: _id_ expectResult: &unacknowledgedResult { $$unsetOrMatches: { acknowledged: { $$unsetOrMatches: false } } } expectEvents: &events diff --git a/source/crud/tests/unified/updateOne-hint-clientError.json b/source/crud/tests/unified/updateOne-hint-clientError.json deleted file mode 100644 index d4f1a53430..0000000000 --- a/source/crud/tests/unified/updateOne-hint-clientError.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "updateOne-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updateone_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/updateOne-hint-clientError.yml b/source/crud/tests/unified/updateOne-hint-clientError.yml deleted file mode 100644 index 5107b5f4b5..0000000000 --- a/source/crud/tests/unified/updateOne-hint-clientError.yml +++ /dev/null @@ -1,82 +0,0 @@ -description: updateOne-hint-clientError -schemaVersion: '1.0' -runOnRequirements: - - - maxServerVersion: 3.3.99 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name test_updateone_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 -tests: - - - description: 'UpdateOne with hint string unsupported (client-side error)' - operations: - - - object: *collection0 - name: updateOne - arguments: - filter: &filter - _id: - $gt: 1 - update: &update - $inc: - x: 1 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - description: 'UpdateOne with hint document unsupported (client-side error)' - operations: - - - object: *collection0 - name: updateOne - arguments: - filter: *filter - update: *update - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: [] - outcome: *outcome diff --git a/source/crud/tests/unified/updateOne-hint-serverError.json b/source/crud/tests/unified/updateOne-hint-serverError.json deleted file mode 100644 index 05fb033319..0000000000 --- a/source/crud/tests/unified/updateOne-hint-serverError.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "description": "updateOne-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.1.9" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updateone_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updateone_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_", - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updateone_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/source/crud/tests/unified/updateOne-hint-serverError.yml b/source/crud/tests/unified/updateOne-hint-serverError.yml deleted file mode 100644 index f9681ab825..0000000000 --- a/source/crud/tests/unified/updateOne-hint-serverError.yml +++ /dev/null @@ -1,106 +0,0 @@ -description: updateOne-hint-serverError -schemaVersion: '1.0' -runOnRequirements: - - - minServerVersion: 3.4.0 - maxServerVersion: 4.1.9 -createEntities: - - - client: - id: &client0 client0 - observeEvents: - - commandStartedEvent - - - database: - id: &database0 database0 - client: client0 - databaseName: &database_name crud-v2 - - - collection: - id: &collection0 collection0 - database: database0 - collectionName: &collection_name test_updateone_hint -initialData: - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 -tests: - - - description: 'UpdateOne with hint string unsupported (server-side error)' - operations: - - - object: *collection0 - name: updateOne - arguments: - filter: &filter - _id: - $gt: 1 - update: &update - $inc: - x: 1 - hint: _id_ - expectError: - isError: true - expectEvents: - - - client: *client0 - events: - - - commandStartedEvent: - command: - update: *collection_name - updates: - - - q: *filter - u: *update - hint: _id_ - multi: { $$unsetOrMatches: false } - upsert: { $$unsetOrMatches: false } - outcome: &outcome - - - collectionName: *collection_name - databaseName: *database_name - documents: - - - _id: 1 - x: 11 - - - _id: 2 - x: 22 - - - description: 'UpdateOne with hint document unsupported (server-side error)' - operations: - - - object: *collection0 - name: updateOne - arguments: - filter: *filter - update: *update - hint: - _id: 1 - expectError: - isError: true - expectEvents: - - - client: *client0 - events: - - - commandStartedEvent: - command: - update: *collection_name - updates: - - - q: *filter - u: *update - hint: - _id: 1 - multi: { $$unsetOrMatches: false } - upsert: { $$unsetOrMatches: false } - outcome: *outcome diff --git a/source/crud/tests/unified/updateOne-hint-unacknowledged.json b/source/crud/tests/unified/updateOne-hint-unacknowledged.json index 859b0f92f9..8df4d0301e 100644 --- a/source/crud/tests/unified/updateOne-hint-unacknowledged.json +++ b/source/crud/tests/unified/updateOne-hint-unacknowledged.json @@ -47,80 +47,6 @@ } ], "tests": [ - { - "description": "Unacknowledged updateOne with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateOne with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, { "description": "Unacknowledged updateOne with hint string on 4.2+ server", "runOnRequirements": [ diff --git a/source/crud/tests/unified/updateOne-hint-unacknowledged.yml b/source/crud/tests/unified/updateOne-hint-unacknowledged.yml index 77802db001..1b848583a0 100644 --- a/source/crud/tests/unified/updateOne-hint-unacknowledged.yml +++ b/source/crud/tests/unified/updateOne-hint-unacknowledged.yml @@ -26,36 +26,6 @@ initialData: - { _id: 2, x: 22 } tests: - - description: "Unacknowledged updateOne with hint string fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: updateOne - arguments: - filter: &filter { _id: { $gt: 1 } } - update: &update { $inc: { x: 1 } } - hint: _id_ - expectError: - isClientError: true - expectEvents: &noEvents - - client: *client0 - events: [] - - - description: "Unacknowledged updateOne with hint document fails with client-side error on pre-4.2 server" - runOnRequirements: - - maxServerVersion: "4.0.99" - operations: - - object: *collection0 - name: updateOne - arguments: - filter: *filter - update: *update - hint: { _id: 1 } - expectError: - isClientError: true - expectEvents: *noEvents - - description: "Unacknowledged updateOne with hint string on 4.2+ server" runOnRequirements: - minServerVersion: "4.2.0" @@ -63,8 +33,8 @@ tests: - object: *collection0 name: updateOne arguments: - filter: *filter - update: *update + filter: &filter { _id: { $gt: 1 } } + update: &update { $inc: { x: 1 } } hint: _id_ expectResult: &unacknowledgedResult { $$unsetOrMatches: { acknowledged: { $$unsetOrMatches: false } } } expectEvents: &events diff --git a/source/enumerate-collections/enumerate-collections.md b/source/enumerate-collections/enumerate-collections.md index 1f9b6c18a2..c138763dcd 100644 --- a/source/enumerate-collections/enumerate-collections.md +++ b/source/enumerate-collections/enumerate-collections.md @@ -143,8 +143,8 @@ All methods that return cursors MUST support the timeout options documented in Drivers MAY implement a MongoClient method that returns an Iterable of strings, where each string corresponds to a collection name. This method SHOULD be named `listCollectionNames`. -MongoDB 4.0 introduced a `nameOnly` boolean option to the `listCollections` database command, which limits the command -result to only include collection names. NOTE: `nameOnly` is applied before any filter is applied. +The `listCollections` database command supports a `nameOnly` boolean option, which limits the command result to only +include collection names. NOTE: `nameOnly` is applied before any filter is applied. Example return: @@ -164,8 +164,8 @@ Server version between 2.7.6 (inclusive) and 4.0 (exclusive) do not support the `nameOnly` option when they only intend to access collection names from the `listCollections` command result, except drivers MUST NOT set `nameOnly` if a filter specifies any keys other than `name`. -MongoDB 4.0 also added an `authorizedCollections` boolean option to the `listCollections` command, which can be used to -limit the command result to only include collections the user is authorized to use. Drivers MAY allow users to set the +The `listCollections` command also supports an `authorizedCollections` boolean option, which can be used to limit the +command result to only include collections the user is authorized to use. Drivers MAY allow users to set the `authorizedCollections` option on the `listCollectionNames` method. #### Getting Full Collection Information diff --git a/source/enumerate-databases/enumerate-databases.md b/source/enumerate-databases/enumerate-databases.md index b8e9948c88..a4054d9612 100644 --- a/source/enumerate-databases/enumerate-databases.md +++ b/source/enumerate-databases/enumerate-databases.md @@ -65,10 +65,9 @@ db.adminCommand({listDatabases: 1, filter: {name: /^foo/}}); ### AuthorizedDatabases -MongoDB 4.0.5 added an `authorizedDatabases` boolean option to the -[listDatabases](https://www.mongodb.com/docs/manual/reference/command/listDatabases/) database command, which can be -used to limit the command result to only include databases the user is authorized to use. Drivers SHOULD support the new -`authorizedDatabases` option when implementing the +The [listDatabases](https://www.mongodb.com/docs/manual/reference/command/listDatabases/) database command supports an +`authorizedDatabases` boolean option, which can be used to limit the command result to only include databases the user +is authorized to use. Drivers SHOULD support the `authorizedDatabases` option when implementing the [listDatabases](https://www.mongodb.com/docs/manual/reference/command/listDatabases/) database command. The possible values for `authorizedDatabases` are: @@ -138,8 +137,8 @@ Drivers SHOULD support the `filter`, `authorizedDatabases` and `comment` options #### Enumerating Database Names -MongoDB 3.6 introduced a `nameOnly` boolean option to the `listDatabases` database command, which limits the command -result to only include database names. Consider the following example: +The `listDatabases` database command supports a `nameOnly` boolean option, which limits the command result to only +include database names. Consider the following example: ```javascript > db.getSiblingDB("admin").runCommand({listDatabases:1,nameOnly:true}) @@ -205,8 +204,8 @@ The following scenarios should be run for each test environment: ## Motivation for Change Although most drivers provide a `listDatabases` command helper in their API, there was previously no spec for a database -enumeration. MongoDB 3.6 introduced a `nameOnly` option to the `listDatabases` database command. The driver API should -to be expanded to support this option. +enumeration. The `listDatabases` database command supports a `nameOnly` option, and the driver API should support this +option. ## Design Rationale diff --git a/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md b/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md index 251d5b2b38..da3d775a18 100644 --- a/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md +++ b/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md @@ -93,19 +93,17 @@ This section only applies to drivers that support exhaust cursors. The exhaust protocol differs based on the server version: -| Server version | Server behavior | -| --------------- | ------------------------------------------------------------------------------------------------------------------------- | -| 4.0 and earlier | Only supports exhaust over legacy **OP_QUERY**. The **find** command does not support the exhaust flag from **OP_QUERY**. | -| 4.2 to 5.0 | Supports exhaust both over legacy **OP_QUERY** and **OP_MSG**. | -| 5.1 and later | Supports exhaust over **OP_MSG**. | +| Server version | Server behavior | +| -------------- | -------------------------------------------------------------- | +| 4.2 to 5.0 | Supports exhaust both over legacy **OP_QUERY** and **OP_MSG**. | +| 5.1 and later | Supports exhaust over **OP_MSG**. | Therefore drivers that implement exhaust cursors: -| Server version | Driver behavior | -| --------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| 4.0 and earlier | Drivers MUST use legacy **OP_QUERY**. | -| 4.2 to 5.0 | Drivers SHOULD use **OP_MSG** but MAY use legacy **OP_QUERY**. | -| 5.1 and later | Drivers MUST only use **OP_MSG**. Alternatively, drivers MAY fallback to a non-exhaust cursor when an exhaust cursor is requested. | +| Server version | Driver behavior | +| -------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| 4.2 to 5.0 | Drivers SHOULD use **OP_MSG** but MAY use legacy **OP_QUERY**. | +| 5.1 and later | Drivers MUST only use **OP_MSG**. Alternatively, drivers MAY fallback to a non-exhaust cursor when an exhaust cursor is requested. | #### Interactions with OP_QUERY diff --git a/source/index-management/index-management.md b/source/index-management/index-management.md index 6e1872ebde..af1cfaed3b 100644 --- a/source/index-management/index-management.md +++ b/source/index-management/index-management.md @@ -710,8 +710,8 @@ interface IndexOptions { sparse: Boolean; /** - * Optionally used only in MongoDB 3.0.0 and higher. Allows users to configure the storage - * engine on a per-index basis when creating an index. + * Optionally allows users to configure the storage engine on a per-index basis when creating + * an index. */ storageEngine: Document; @@ -783,14 +783,13 @@ interface IndexOptions { /** * Optionally specifies a filter for use in a partial index. Only documents that match the - * filter expression are included in the index. New in MongoDB 3.2. + * filter expression are included in the index. */ partialFilterExpression: Document; /** - * Optionally specifies a collation to use for the index in MongoDB 3.4 and higher. - * If not specified, no collation is sent and the default collation of the collection - * server-side is used. + * Optionally specifies a collation to use for the index. If not specified, no collation is + * sent and the default collation of the collection server-side is used. */ collation: Document; diff --git a/source/message/OP_MSG.md b/source/message/OP_MSG.md index a8e8eb2edd..492bee11ac 100644 --- a/source/message/OP_MSG.md +++ b/source/message/OP_MSG.md @@ -17,15 +17,14 @@ The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SH #### Usage -`OP_MSG` is only available in MongoDB 3.6 (`maxWireVersion >= 6`) and later. MongoDB drivers MUST perform the MongoDB -handshake using `OP_MSG` if an API version was declared on the client. +MongoDB drivers MUST perform the MongoDB handshake using `OP_MSG` if an API version was declared on the client. If no API version was declared, drivers that have historically supported MongoDB 3.4 and earlier MUST perform the handshake using `OP_QUERY` to determine if the node supports `OP_MSG`. Drivers that have only ever supported MongoDB 3.6 and newer MAY default to using `OP_MSG`. -If the node supports `OP_MSG`, any and all messages MUST use `OP_MSG`, optionally compressed with `OP_COMPRESSED`. -Authentication messages MUST also use `OP_MSG` when it is supported, but MUST NOT use `OP_COMPRESSED`. +Any and all messages MUST use `OP_MSG`, optionally compressed with `OP_COMPRESSED`. Authentication messages MUST also +use `OP_MSG`, but MUST NOT use `OP_COMPRESSED`. #### OP_MSG diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 5a62627326..b8a8168840 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -7,7 +7,7 @@ ______________________________________________________________________ ## Abstract -MongoDB 3.4 has the ability to annotate connections with metadata provided by the connecting client. The intent of this +MongoDB has the ability to annotate connections with metadata provided by the connecting client. The intent of this metadata is to be able to identify client level information about the connection, such as application name, driver name and version. The provided information will be logged through the `mongo[d|s].log` and the profile logs; this should enable sysadmins to easily backtrack log entries the offending application. The active connection data will also be @@ -115,8 +115,7 @@ conn.authenticate(creds, negotiated_mechs, speculative_auth) #### Hello Command -The initial handshake, as of MongoDB 3.4, supports a new argument, `client`, provided as a BSON object. This object has -the following structure: +The initial handshake supports a `client` argument, provided as a BSON object. This object has the following structure: ```javascript { diff --git a/source/read-write-concern/read-write-concern.md b/source/read-write-concern/read-write-concern.md index ad779bf2c4..e338bc72ee 100644 --- a/source/read-write-concern/read-write-concern.md +++ b/source/read-write-concern/read-write-concern.md @@ -79,10 +79,8 @@ The read concern option is available for the following operations: - `geoNear` command - `geoSearch` command -Starting in MongoDB 4.2, an `aggregate` command with a write stage (e.g. `$out`, `$merge`) supports a `readConcern`; -however, it does not support the "linearizable" level (attempting to do so will result in a server error). - -Server versions before 4.2 do not support a `readConcern` at all for `aggregate` commands with a write stage. +An `aggregate` command with a write stage (e.g. `$out`, `$merge`) supports a `readConcern`; however, it does not support +the "linearizable" level (attempting to do so will result in a server error). The `mapReduce` command where the `out` option is anything other than `{ inline: 1 }` does not support a `readConcern`. diff --git a/source/retryable-writes/retryable-writes.md b/source/retryable-writes/retryable-writes.md index 85b2ec4cdb..d96e991ce6 100644 --- a/source/retryable-writes/retryable-writes.md +++ b/source/retryable-writes/retryable-writes.md @@ -83,22 +83,11 @@ individual write operation. #### Supported Server Versions -Like sessions, retryable writes require a MongoDB 3.6 replica set or shard cluster operating with feature compatibility -version 3.6 (i.e. the `{setFeatureCompatibilityVersion: 3.6}` administrative command has been run on the cluster). -Drivers MUST verify server eligibility by ensuring that `maxWireVersion` is at least six, the -`logicalSessionTimeoutMinutes` field is present in the server's `hello` or legacy hello response, and the server type is +Retryable writes require a server that supports sessions (i.e. the `logicalSessionTimeoutMinutes` field is present in +the server's `hello` or legacy hello response). Drivers MUST verify server eligibility by ensuring that the +`logicalSessionTimeoutMinutes` field is present in the server's `hello` or legacy hello response and the server type is not standalone. -Retryable writes are only supported by storage engines that support document-level locking. Notably, that excludes the -MMAPv1 storage engine which is available in both MongoDB 3.6 and 4.0. Since `retryWrites` defaults to `true`, Drivers -MUST raise an actionable error message when the server returns code 20 with errmsg starting with "Transaction numbers". -The replacement error message MUST be: - -```text -This MongoDB deployment does not support retryable writes. Please add -retryWrites=false to your connection string. -``` - If the server selected for the first attempt of a retryable write operation does not support retryable writes, drivers MUST execute the write as if retryable writes were not enabled. Drivers MUST NOT include a transaction ID in the write command and MUST not retry the command under any circumstances. @@ -111,7 +100,7 @@ result). This does not constitute a retryable write error. Drivers MUST relay su #### Supported Write Operations -MongoDB 3.6 will support retryability for some, but not all, write operations. +MongoDB supports retryability for some, but not all, write operations. Supported single-statement write operations include `insertOne()`, `updateOne()`, `replaceOne()`, `deleteOne()`, `findOneAndDelete()`, `findOneAndReplace()`, and `findOneAndUpdate()`. @@ -137,8 +126,7 @@ Write commands specifying an unacknowledged write concern (e.g. `{w: 0})`) do no MUST NOT add a transaction ID to any write command with an unacknowledged write concern executed within a MongoClient where retryable writes have been enabled. Drivers MUST NOT retry these commands. -Write commands where a single statement might affect multiple documents will not be initially supported by MongoDB 3.6, -although this may change in the future. This includes an +Write commands where a single statement might affect multiple documents are not supported. This includes an [update](https://www.mongodb.com/docs/manual/reference/command/update/) command where any statement in the updates sequence specifies a `multi` option of `true` or a [delete](https://www.mongodb.com/docs/manual/reference/command/delete/) command where any statement in the `deletes` @@ -151,19 +139,18 @@ eligibility for each write command sent as part of the `bulkWrite()` (after orde Write commands other than [insert](https://www.mongodb.com/docs/manual/reference/command/insert/), [update](https://www.mongodb.com/docs/manual/reference/command/update/), [delete](https://www.mongodb.com/docs/manual/reference/command/delete/), or -[findAndModify](https://www.mongodb.com/docs/manual/reference/command/findAndModify/) will not be initially supported by -MongoDB 3.6, although this may change in the future. This includes, but is not limited to, an -[aggregate](https://www.mongodb.com/docs/manual/reference/command/aggregate/) command using a write stage (e.g. `$out`, -`$merge`). Drivers MUST NOT add a transaction ID to these commands and MUST NOT retry these commands if they fail to -return a response. +[findAndModify](https://www.mongodb.com/docs/manual/reference/command/findAndModify/) are not supported. This includes, +but is not limited to, an [aggregate](https://www.mongodb.com/docs/manual/reference/command/aggregate/) command using a +write stage (e.g. `$out`, `$merge`). Drivers MUST NOT add a transaction ID to these commands and MUST NOT retry these +commands if they fail to return a response. #### Retryable Writes Within Transactions -In MongoDB 4.0 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`. +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`. ### Implementing Retryable Writes @@ -691,18 +678,6 @@ Since the initial release of retryable writes in MongoDB 3.6 testing showed that was sufficiently small that there was no risk in changing the default. Additionally, the fact that some operations continue to be unsupported for retryable writes (updateMany and deleteMany) does not seem to pose a problem in practice. -### Why do drivers have to parse errmsg to determine storage engine support? - -There is no reliable way to determine the storage engine in use for shards in a sharded cluster, and replica sets (and -shards) can have mixed deployments using different storage engines on different members. This is especially true when a -replica set or sharded cluster is being upgraded from one storage engine to another. This could be common when upgrading -to MongoDB 4.2, where MMAPv1 is no longer supported. - -The server returns error code 20 (IllegalOperation) when the storage engine doesn't support document-level locking and -txnNumbers. Error code 20 is used for a large number of different error cases in the server so we need some other way to -differentiate this error case from any other. The error code and errmsg are the same in MongoDB 3.6 and 4.0, and the -same from a replica set or sharded cluster (mongos just forwards the error from the shard's replica set). - ### Why does the driver only add the RetryableWriteError label to errors that occur on a MongoClient with retryWrites set to true? The driver does this to maintain consistency with the MongoDB server. Servers that support the RetryableWriteError label diff --git a/source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.md b/source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.md index be72be9519..7a7ac9aa8c 100644 --- a/source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.md +++ b/source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.md @@ -133,9 +133,8 @@ are. 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 out of date. It MUST mark the server type "unknown." Multi-threaded and asynchronous clients MUST re-check the server -soon, and single-threaded clients MUST request a scan before the next operation. The client MUST clear its connection -pool for the server if the server is 4.0 or earlier, and MUST NOT clear its connection pool for the server if the server -is 4.2 or later. +soon, and single-threaded clients MUST request a scan before the next operation. The client MUST NOT clear its +connection pool for the server. ## Changelog diff --git a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md index 8ddfc47cca..b758e11e04 100644 --- a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md +++ b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md @@ -935,9 +935,7 @@ the `error` field of the new `ServerDescription` object MUST include a descripti invalidated because the primary was determined to be stale. A multi-threaded client MUST [request an immediate check](server-monitoring.md#requesting-an-immediate-check) for that server as soon as possible. -If the old primary server version is 4.0 or earlier, the client MUST clear its connection pool for the old primary, too: -the connections are all bad because the old primary has closed its sockets. If the old primary server version is 4.2 or -newer, the client MUST NOT clear its connection pool for the old primary. +The client MUST NOT clear its connection pool for the old primary. See [replica set monitoring with and without a primary](#replica-set-monitoring-with-and-without-a-primary). @@ -1878,9 +1876,7 @@ These errors indicate one of these: In any case the error is a symptom that a ServerDescription's type no longer reflects reality. -On MongoDB 4.0 and earlier, a primary closes its connections when it steps down, so in many cases the next operation -causes a network error rather than "not writable primary". The driver can see a "not writable primary" error in the -following scenario: +The driver can see a "not writable primary" error in the following scenario: 1. The client discovers the primary. 2. The primary steps down. diff --git a/source/server-discovery-and-monitoring/tests/errors/generate-error-tests.py b/source/server-discovery-and-monitoring/tests/errors/generate-error-tests.py index c9323857ad..f5e87d8d54 100644 --- a/source/server-discovery-and-monitoring/tests/errors/generate-error-tests.py +++ b/source/server-discovery-and-monitoring/tests/errors/generate-error-tests.py @@ -137,16 +137,6 @@ def create_stale_generation_tests(): write_test(test_name, data) -def create_pre_42_tests(): - tmp = template('pre-42.yml.template') - # All "not writable primary"/"node is recovering" clear the pool on <4.2 - for error_name in ERR_CODES: - test_name = f'pre-42-{error_name}' - error_code, = ERR_CODES[error_name] - data = tmp.format(**locals()) - write_test(test_name, data) - - def create_post_42_tests(): tmp = template('post-42.yml.template') for error_name in ERR_CODES: @@ -165,7 +155,6 @@ def create_post_42_tests(): create_stale_tests() create_non_stale_tests() create_stale_generation_tests() -create_pre_42_tests() create_post_42_tests() print('Running make') diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.json b/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.json deleted file mode 100644 index 9f6ea212e5..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 InterruptedAtShutdown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 InterruptedAtShutdown error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.yml b/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.yml deleted file mode 100644 index 4996e9f25f..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 InterruptedAtShutdown error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 InterruptedAtShutdown error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: InterruptedAtShutdown - code: 11600 - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.json b/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.json deleted file mode 100644 index 7e5f235713..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 InterruptedDueToReplStateChange error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 InterruptedDueToReplStateChange error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.yml b/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.yml deleted file mode 100644 index ada5f1ff73..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 InterruptedDueToReplStateChange error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 InterruptedDueToReplStateChange error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: InterruptedDueToReplStateChange - code: 11602 - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.json b/source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.json deleted file mode 100644 index 1635f1a856..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 LegacyNotPrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 LegacyNotPrimary error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.yml b/source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.yml deleted file mode 100644 index e2b37b4f5f..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 LegacyNotPrimary error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 LegacyNotPrimary error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: LegacyNotPrimary - code: 10058 - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.json b/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index 0e70ede02c..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 NotPrimaryNoSecondaryOk error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 NotPrimaryNoSecondaryOk error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.yml b/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.yml deleted file mode 100644 index 867b7d3dc1..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 NotPrimaryNoSecondaryOk error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 NotPrimaryNoSecondaryOk error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: NotPrimaryNoSecondaryOk - code: 13435 - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.json b/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.json deleted file mode 100644 index 3fefb21663..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 NotPrimaryOrSecondary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 NotPrimaryOrSecondary error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.yml b/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.yml deleted file mode 100644 index 705e2339c0..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 NotPrimaryOrSecondary error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 NotPrimaryOrSecondary error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: NotPrimaryOrSecondary - code: 13436 - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.json b/source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.json deleted file mode 100644 index d010da0a5b..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 NotWritablePrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 NotWritablePrimary error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.yml b/source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.yml deleted file mode 100644 index 29669ff336..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 NotWritablePrimary error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 NotWritablePrimary error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: NotWritablePrimary - code: 10107 - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.json b/source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.json deleted file mode 100644 index 02956d201d..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 PrimarySteppedDown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 PrimarySteppedDown error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.yml b/source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.yml deleted file mode 100644 index 9176ee25c3..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 PrimarySteppedDown error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 PrimarySteppedDown error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: PrimarySteppedDown - code: 189 - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.json b/source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.json deleted file mode 100644 index fc3a5aa6fe..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 ShutdownInProgress error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 ShutdownInProgress error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.yml b/source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.yml deleted file mode 100644 index 5c64050e59..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 ShutdownInProgress error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 ShutdownInProgress error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: ShutdownInProgress - code: 91 - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/server-discovery-and-monitoring/tests/errors/pre-42.yml.template b/source/server-discovery-and-monitoring/tests/errors/pre-42.yml.template deleted file mode 100644 index 7449f68c16..0000000000 --- a/source/server-discovery-and-monitoring/tests/errors/pre-42.yml.template +++ /dev/null @@ -1,47 +0,0 @@ -# Autogenerated tests for SDAM error handling, see generate-error-tests.py -description: Pre-4.2 {error_name} error -uri: mongodb://a/?replicaSet=rs -phases: -- description: Primary A is discovered - responses: - - - a:27017 - - ok: 1 - helloOk: true - isWritablePrimary: true - hosts: - - a:27017 - setName: rs - minWireVersion: 0 - maxWireVersion: 7 - outcome: &outcome - servers: - a:27017: - type: RSPrimary - setName: rs - topologyVersion: null - pool: - generation: 0 - topologyType: ReplicaSetWithPrimary - logicalSessionTimeoutMinutes: null - setName: rs - -- description: Pre-4.2 {error_name} error marks server Unknown and clears the pool - applicationErrors: - - address: a:27017 - when: afterHandshakeCompletes - maxWireVersion: 7 - type: command - response: - ok: 0 - errmsg: {error_name} - code: {error_code} - outcome: - servers: - a:27017: - type: Unknown - topologyVersion: null - pool: - generation: 1 - topologyType: ReplicaSetNoPrimary - logicalSessionTimeoutMinutes: null - setName: rs diff --git a/source/transactions/transactions.md b/source/transactions/transactions.md index a00a68e64b..eb5bd71e86 100644 --- a/source/transactions/transactions.md +++ b/source/transactions/transactions.md @@ -229,9 +229,9 @@ The transaction’s read preference MUST override all other user configurable re drivers that allow an operation level read preference. In this case, the driver MUST respect the read preference specified by the user, allowing the server to report an error. -In MongoDB 4.0, transactions may only read from the primary. If a read is attempted and the transaction’s read -preference is not Primary drivers MUST raise an error containing the string "read preference in a transaction must be -primary". Drivers MUST NOT validate the read preference during write operations or in startTransaction. See +Transactions may only read from the primary. If a read is attempted and the transaction’s read preference is not Primary +drivers MUST raise an error containing the string "read preference in a transaction must be primary". Drivers MUST NOT +validate the read preference during write operations or in startTransaction. See [Why is readPreference part of TransactionOptions?](#why-is-readpreference-part-of-transactionoptions). ```python @@ -295,12 +295,8 @@ If this session is in the "starting transaction " or "transaction in progress" s containing the message "Transaction already in progress" without modifying any session state. 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. Drivers MUST increment the `txnNumber` for the corresponding server session. @@ -465,18 +461,17 @@ All operations within a multi-statement transaction (including commitTransaction #### Behavior of the readConcern field 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`. All commands of a multi-statement transaction subsequent to the initial command MUST NOT specify a `readConcern`, since the `readConcern` argument is only needed to establish the transaction’s read timestamp. If a `readConcern` argument is specified on a subsequent (non-initial) command, the server will return an error. -Read concern level "snapshot" is new in MongoDB 4.0 and can only be used when starting a transaction. The server will -return an error if read concern level "snapshot" is specified on a command that is not the start of a transaction. -Drivers MUST rely on the server to report an error if read concern level snapshot is used incorrectly. +Read concern level "snapshot" can only be used when starting a transaction. The server will return an error if read +concern level "snapshot" is specified on a command that is not the start of a transaction. Drivers MUST rely on the +server to report an error if read concern level snapshot is used incorrectly. #### Behavior of the writeConcern field @@ -566,9 +561,9 @@ a transaction. ### **Interaction with Retryable Writes** -In MongoDB 4.0 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 -enabled on the MongoClient, unless the server response is a +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 enabled on the MongoClient, +unless the server response is a [retryable overload error](../client-backpressure/client-backpressure.md#retryable-overload-error). In addition, drivers MUST NOT add the RetryableWriteError label to any error that occurs during a write command within a diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index df25ac5c6b..65c829f42d 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -326,9 +326,8 @@ The structure of this object is as follows: matching a "sharded" topology, test runners MUST accept any type of sharded cluster (i.e. "sharded" implies "sharded-replicaset", but not vice versa). - The "sharded-replicaset" topology type is deprecated. MongoDB 3.6+ requires that all shard servers be replica sets. - Therefore, tests SHOULD use "sharded" instead of "sharded-replicaset" when targeting 3.6+ server versions in order - to avoid unnecessary overhead. + The "sharded-replicaset" topology type is deprecated. All shard servers are required to be replica sets. Therefore, + tests SHOULD use "sharded" instead of "sharded-replicaset" to avoid unnecessary overhead. Note: load balancers were introduced in MongoDB 5.0. Therefore, any sharded cluster behind a load balancer implicitly uses replica sets for its shards.