From 02d2d3de3123bd02057fa4664ac51e2b79ab0822 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Wed, 29 Apr 2026 14:41:30 -0400 Subject: [PATCH 1/9] DRIVERS-3439 remove pre-4.2 test files --- .../tests/legacy/maxWireVersion.json | 74 --- .../tests/legacy/maxWireVersion.yml | 22 - .../tests/unified/maxWireVersion.json | 108 ----- .../tests/unified/maxWireVersion.yml | 61 --- .../logging/pre-42-server-connection-id.json | 119 ----- .../logging/pre-42-server-connection-id.yml | 66 --- .../tests/logging/redacted-commands.yml | 214 --------- .../pre-42-server-connection-id.json | 101 ----- .../pre-42-server-connection-id.yml | 56 --- .../tests/monitoring/redacted-commands.yml | 57 --- .../bulkWrite-arrayFilters-clientError.json | 151 ------- .../bulkWrite-arrayFilters-clientError.yml | 95 ---- .../bulkWrite-delete-hint-clientError.json | 193 -------- .../bulkWrite-delete-hint-clientError.yml | 110 ----- .../bulkWrite-replaceOne-dots_and_dollars.yml | 31 -- ...lkWrite-replaceOne-hint-unacknowledged.yml | 38 +- .../bulkWrite-update-hint-clientError.json | 284 ------------ .../bulkWrite-update-hint-clientError.yml | 145 ------ .../bulkWrite-update-hint-serverError.json | 422 ------------------ .../bulkWrite-update-hint-serverError.yml | 236 ---------- ...lkWrite-updateMany-hint-unacknowledged.yml | 38 +- ...ulkWrite-updateOne-hint-unacknowledged.yml | 38 +- .../unified/deleteMany-hint-clientError.json | 149 ------- .../unified/deleteMany-hint-clientError.yml | 84 ---- .../unified/deleteOne-hint-clientError.json | 133 ------ .../unified/deleteOne-hint-clientError.yml | 77 ---- .../find-allowdiskuse-clientError.json | 79 ---- .../unified/find-allowdiskuse-clientError.yml | 52 --- .../findOneAndDelete-hint-clientError.json | 133 ------ .../findOneAndDelete-hint-clientError.yml | 88 ---- .../findOneAndReplace-dots_and_dollars.yml | 27 -- .../findOneAndReplace-hint-clientError.json | 139 ------ .../findOneAndReplace-hint-clientError.yml | 80 ---- .../findOneAndUpdate-hint-clientError.json | 143 ------ .../findOneAndUpdate-hint-clientError.yml | 81 ---- .../unified/insertOne-dots_and_dollars.yml | 13 - .../unified/replaceOne-dots_and_dollars.yml | 28 -- .../replaceOne-hint-unacknowledged.yml | 34 +- .../unified/updateMany-hint-clientError.json | 159 ------- .../unified/updateMany-hint-clientError.yml | 88 ---- .../unified/updateMany-hint-serverError.json | 216 --------- .../unified/updateMany-hint-serverError.yml | 112 ----- .../updateMany-hint-unacknowledged.yml | 34 +- .../unified/updateOne-hint-clientError.json | 147 ------ .../unified/updateOne-hint-clientError.yml | 82 ---- .../unified/updateOne-hint-serverError.json | 208 --------- .../unified/updateOne-hint-serverError.yml | 106 ----- .../unified/updateOne-hint-unacknowledged.yml | 34 +- .../tests/errors/generate-error-tests.py | 11 - .../errors/pre-42-InterruptedAtShutdown.json | 70 --- .../errors/pre-42-InterruptedAtShutdown.yml | 47 -- ...re-42-InterruptedDueToReplStateChange.json | 70 --- ...pre-42-InterruptedDueToReplStateChange.yml | 47 -- .../tests/errors/pre-42-LegacyNotPrimary.json | 70 --- .../tests/errors/pre-42-LegacyNotPrimary.yml | 47 -- .../pre-42-NotPrimaryNoSecondaryOk.json | 70 --- .../errors/pre-42-NotPrimaryNoSecondaryOk.yml | 47 -- .../errors/pre-42-NotPrimaryOrSecondary.json | 70 --- .../errors/pre-42-NotPrimaryOrSecondary.yml | 47 -- .../errors/pre-42-NotWritablePrimary.json | 70 --- .../errors/pre-42-NotWritablePrimary.yml | 47 -- .../errors/pre-42-PrimarySteppedDown.json | 70 --- .../errors/pre-42-PrimarySteppedDown.yml | 47 -- .../errors/pre-42-ShutdownInProgress.json | 70 --- .../errors/pre-42-ShutdownInProgress.yml | 47 -- .../tests/errors/pre-42.yml.template | 47 -- 66 files changed, 12 insertions(+), 6167 deletions(-) delete mode 100644 source/client-side-encryption/tests/legacy/maxWireVersion.json delete mode 100644 source/client-side-encryption/tests/legacy/maxWireVersion.yml delete mode 100644 source/client-side-encryption/tests/unified/maxWireVersion.json delete mode 100644 source/client-side-encryption/tests/unified/maxWireVersion.yml delete mode 100644 source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.json delete mode 100644 source/command-logging-and-monitoring/tests/logging/pre-42-server-connection-id.yml delete mode 100644 source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.json delete mode 100644 source/command-logging-and-monitoring/tests/monitoring/pre-42-server-connection-id.yml delete mode 100644 source/crud/tests/unified/bulkWrite-arrayFilters-clientError.json delete mode 100644 source/crud/tests/unified/bulkWrite-arrayFilters-clientError.yml delete mode 100644 source/crud/tests/unified/bulkWrite-delete-hint-clientError.json delete mode 100644 source/crud/tests/unified/bulkWrite-delete-hint-clientError.yml delete mode 100644 source/crud/tests/unified/bulkWrite-update-hint-clientError.json delete mode 100644 source/crud/tests/unified/bulkWrite-update-hint-clientError.yml delete mode 100644 source/crud/tests/unified/bulkWrite-update-hint-serverError.json delete mode 100644 source/crud/tests/unified/bulkWrite-update-hint-serverError.yml delete mode 100644 source/crud/tests/unified/deleteMany-hint-clientError.json delete mode 100644 source/crud/tests/unified/deleteMany-hint-clientError.yml delete mode 100644 source/crud/tests/unified/deleteOne-hint-clientError.json delete mode 100644 source/crud/tests/unified/deleteOne-hint-clientError.yml delete mode 100644 source/crud/tests/unified/find-allowdiskuse-clientError.json delete mode 100644 source/crud/tests/unified/find-allowdiskuse-clientError.yml delete mode 100644 source/crud/tests/unified/findOneAndDelete-hint-clientError.json delete mode 100644 source/crud/tests/unified/findOneAndDelete-hint-clientError.yml delete mode 100644 source/crud/tests/unified/findOneAndReplace-hint-clientError.json delete mode 100644 source/crud/tests/unified/findOneAndReplace-hint-clientError.yml delete mode 100644 source/crud/tests/unified/findOneAndUpdate-hint-clientError.json delete mode 100644 source/crud/tests/unified/findOneAndUpdate-hint-clientError.yml delete mode 100644 source/crud/tests/unified/updateMany-hint-clientError.json delete mode 100644 source/crud/tests/unified/updateMany-hint-clientError.yml delete mode 100644 source/crud/tests/unified/updateMany-hint-serverError.json delete mode 100644 source/crud/tests/unified/updateMany-hint-serverError.yml delete mode 100644 source/crud/tests/unified/updateOne-hint-clientError.json delete mode 100644 source/crud/tests/unified/updateOne-hint-clientError.yml delete mode 100644 source/crud/tests/unified/updateOne-hint-serverError.json delete mode 100644 source/crud/tests/unified/updateOne-hint-serverError.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.json delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedAtShutdown.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.json delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-InterruptedDueToReplStateChange.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.json delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-LegacyNotPrimary.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.json delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryNoSecondaryOk.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.json delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-NotPrimaryOrSecondary.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.json delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-NotWritablePrimary.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.json delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-PrimarySteppedDown.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.json delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42-ShutdownInProgress.yml delete mode 100644 source/server-discovery-and-monitoring/tests/errors/pre-42.yml.template 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/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.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.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/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.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.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.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.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.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.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.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.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.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.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/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 From bedcf500687a116502a2d61ee570ca43a406e482 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Wed, 29 Apr 2026 15:03:33 -0400 Subject: [PATCH 2/9] DRIVERS-3439 simplify spec prose for 4.2+ minimum --- source/auth/auth.md | 117 +----- source/bson-decimal128/decimal128.md | 6 +- .../causal-consistency/causal-consistency.md | 10 +- source/change-streams/change-streams.md | 14 +- source/collation/collation.md | 47 +-- .../tests/logging/redacted-commands.json | 381 ------------------ .../tests/monitoring/redacted-commands.json | 120 ------ source/compression/OP_COMPRESSED.md | 30 +- ...bulkWrite-replaceOne-dots_and_dollars.json | 152 ------- ...kWrite-replaceOne-hint-unacknowledged.json | 82 ---- ...kWrite-updateMany-hint-unacknowledged.json | 86 ---- ...lkWrite-updateOne-hint-unacknowledged.json | 86 ---- .../findOneAndReplace-dots_and_dollars.json | 126 ------ .../unified/insertOne-dots_and_dollars.json | 52 --- .../unified/replaceOne-dots_and_dollars.json | 140 ------- .../replaceOne-hint-unacknowledged.json | 70 ---- .../updateMany-hint-unacknowledged.json | 74 ---- .../updateOne-hint-unacknowledged.json | 74 ---- .../enumerate-collections.md | 8 +- .../enumerate-databases.md | 15 +- .../find_getmore_killcursors_commands.md | 18 +- source/index-management/index-management.md | 11 +- source/mongodb-handshake/handshake.md | 5 +- .../read-write-concern/read-write-concern.md | 6 +- source/retryable-writes/retryable-writes.md | 53 +-- ...server-discovery-and-monitoring-summary.md | 5 +- .../server-discovery-and-monitoring.md | 8 +- source/transactions/transactions.md | 31 +- .../unified-test-format.md | 5 +- 29 files changed, 90 insertions(+), 1742 deletions(-) diff --git a/source/auth/auth.md b/source/auth/auth.md index efaea8779c..3e02c88381 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). @@ -1903,19 +1805,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 07f45b2715..fc7dc929ff 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 and write operations (for all commands that support a `readConcern`) 3. Gossiping clusterTime (described in the Driver Session Specification) @@ -284,7 +284,7 @@ that causally consistent operations are not causally consistent with unacknowled 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()` @@ -374,7 +374,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 39e20dddd0..2ac99c983d 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/collation/collation.md b/source/collation/collation.md index b3fade46ac..a2ed53a1bb 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 all operations before sending any to the server. If any operation specifies a Collation, the -driver MUST raise an error and MUST NOT send any operations to the server. In the example above, even the insertOne -(which has no 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/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/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/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-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-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-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-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/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/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/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-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/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/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/enumerate-collections/enumerate-collections.md b/source/enumerate-collections/enumerate-collections.md index 246644a92a..4e3857a1eb 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/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 777bb60a30..25695ec783 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 @@ -110,8 +110,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 8d1929ceef..04a4e20505 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/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. From 22ab0d5d8f919a432b62534e1cfefa2609161ebc Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Wed, 17 Jun 2026 18:37:12 -0400 Subject: [PATCH 3/9] Update source/auth/auth.md Co-authored-by: Noah Stapp --- source/auth/auth.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/auth/auth.md b/source/auth/auth.md index 3e02c88381..1fb61e3a4f 100644 --- a/source/auth/auth.md +++ b/source/auth/auth.md @@ -265,7 +265,7 @@ certificate acts as the username. #### Conversation -1. Send `authenticate` command (MongoDB 3.4+) +1. Send `authenticate` command ```javascript CMD = {"authenticate": 1, "mechanism": "MONGODB-X509"} From a236f15234ce8d16afea3fa1633c33521a5e089f Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Wed, 17 Jun 2026 18:45:47 -0400 Subject: [PATCH 4/9] Update source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.md Co-authored-by: Noah Stapp --- .../server-discovery-and-monitoring-summary.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 7a7ac9aa8c..9583a914a1 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 @@ -130,8 +130,7 @@ operation. The `hello` or legacy hello call is retried once, immediately, before In either case the client MUST clear its connection pool for the server: if one socket is bad, it is likely that all 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 +An algorithm is specified for inspecting error codes. 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 NOT clear its connection pool for the server. From 35ab9e5d2fd08df71d4d31911ba5bc9a632c3c80 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Fri, 26 Jun 2026 11:46:07 -0400 Subject: [PATCH 5/9] DRIVERS-3439 address review comments --- source/auth/auth.md | 20 +-- source/bson-decimal128/decimal128.md | 1 - .../causal-consistency/causal-consistency.md | 1 - source/change-streams/change-streams.md | 1 - .../client-side-operations-timeout.md | 13 +- source/collation/collation.md | 1 - source/compression/OP_COMPRESSED.md | 2 - source/crud/crud.md | 158 ++---------------- .../enumerate-collections.md | 8 +- .../enumerate-databases.md | 1 - .../find_getmore_killcursors_commands.md | 1 - source/index-management/index-management.md | 1 - source/mongodb-handshake/handshake.md | 18 +- .../read-write-concern/read-write-concern.md | 1 - source/retryable-reads/retryable-reads.md | 18 +- source/retryable-writes/retryable-writes.md | 10 +- ...server-discovery-and-monitoring-summary.md | 4 +- .../server-discovery-and-monitoring.md | 7 +- source/sessions/driver-sessions.md | 9 +- source/transactions/transactions.md | 22 +-- 20 files changed, 65 insertions(+), 232 deletions(-) diff --git a/source/auth/auth.md b/source/auth/auth.md index 1fb61e3a4f..d3db053f4c 100644 --- a/source/auth/auth.md +++ b/source/auth/auth.md @@ -1,7 +1,6 @@ # Authentication - Status: Accepted -- Minimum Server Version: 2.6 ______________________________________________________________________ @@ -147,8 +146,7 @@ Drivers MUST follow the following steps for an authentication handshake: type. If the `hello` or legacy hello of the MongoDB Handshake fails with an error, drivers MUST treat this as an authentication error. 2. If the server is of type RSArbiter, no authentication is possible and the handshake is complete. -3. Inspect the value of `maxWireVersion`. If the value is greater than or equal to `6`, then the driver MUST use - `OP_MSG` for authentication. Otherwise, it MUST use `OP_QUERY`. +3. Drivers MUST use `OP_MSG` for authentication. 4. If credentials exist: 3.1. A driver MUST authenticate with all credentials provided to the MongoClient. 3.2. A single invalid credential is the same as all credentials being invalid. @@ -175,8 +173,7 @@ in the auth credential. The username MUST NOT be modified from the form provided SASLprep), as the server uses the raw form to look for conflicts with legacy credentials. If the handshake response includes a `saslSupportedMechs` field, then drivers MUST use the contents of that field to -select a default mechanism as described later. If the command succeeds and the response does not include a -`saslSupportedMechs` field, then drivers MUST use the legacy default mechanism rules for servers older than 4.0. +select a default mechanism as described later. Drivers MUST NOT validate the contents of the `saslSupportedMechs` attribute of the initial handshake reply. Drivers MUST NOT raise an error if the `saslSupportedMechs` attribute of the reply includes an unknown mechanism. @@ -196,13 +193,8 @@ Drivers with a list of credentials at the time a connection is opened MAY do mec handshake, but only for the first credential in the list of credentials. When authenticating each credential, if the authentication mechanism is not specified and has not been negotiated for -that credential: - -- If the connection handshake results indicate the server version is 4.0 or later, drivers MUST send a new `hello` or - legacy hello negotiation command for the credential to determine the default authentication mechanism. -- Otherwise, when the server version is earlier than 4.0, the driver MUST select a default authentication mechanism for - the credential following the instructions for when the `saslSupportedMechs` field is not present in a legacy hello - response. +that credential, drivers MUST send a new `hello` or legacy hello negotiation command for the credential to determine the +default authentication mechanism. ### Caching credentials in SCRAM @@ -1861,8 +1853,6 @@ Connection string tests have been defined in the associated files: ### SCRAM-SHA-256 and mechanism negotiation -Testing SCRAM-SHA-256 requires server version 3.7.3 or later with `featureCompatibilityVersion` of "4.0" or later. - Drivers that allow specifying auth parameters in code as well as via connection string should test both for the test cases described below. @@ -2044,6 +2034,8 @@ practice to avoid this. (See ## Changelog +- 2026-06-17: Remove additional pre-4.2 version references. + - 2025-11-25: Remove redundant `*.mongodbgov.net` on `ALLOWED_HOSTS` - 2025-11-19: Extend `ALLOWED_HOSTS` with `*.mongo.com` and `*.mongodbgov.net` diff --git a/source/bson-decimal128/decimal128.md b/source/bson-decimal128/decimal128.md index ed64586edd..6c62bae981 100644 --- a/source/bson-decimal128/decimal128.md +++ b/source/bson-decimal128/decimal128.md @@ -1,7 +1,6 @@ # BSON Decimal128 - Status: Accepted -- Minimum Server Version: 3.4 ______________________________________________________________________ diff --git a/source/causal-consistency/causal-consistency.md b/source/causal-consistency/causal-consistency.md index fc7dc929ff..caf745e9ee 100644 --- a/source/causal-consistency/causal-consistency.md +++ b/source/causal-consistency/causal-consistency.md @@ -1,7 +1,6 @@ # Causal Consistency Specification - Status: Accepted -- Minimum Server Version: 3.6 ______________________________________________________________________ diff --git a/source/change-streams/change-streams.md b/source/change-streams/change-streams.md index 2ac99c983d..01012aa8fd 100644 --- a/source/change-streams/change-streams.md +++ b/source/change-streams/change-streams.md @@ -1,7 +1,6 @@ # Change Streams - Status: Accepted -- Minimum Server Version: 3.6 ______________________________________________________________________ diff --git a/source/client-side-operations-timeout/client-side-operations-timeout.md b/source/client-side-operations-timeout/client-side-operations-timeout.md index 0e774abba0..318b33d9e1 100644 --- a/source/client-side-operations-timeout/client-side-operations-timeout.md +++ b/source/client-side-operations-timeout/client-side-operations-timeout.md @@ -1,7 +1,6 @@ # Client Side Operations Timeout - Status: Accepted -- Minimum Server Version: 2.6 ______________________________________________________________________ @@ -644,9 +643,8 @@ expected. In general, users can override `timeoutMS` at the level of a single operation. The `startSession` operation, however, only inherits `timeoutMS` from the MongoClient and does not allow the option to be overridden. This was a conscious API -design decision because drivers are moving towards only supporting MongoDB versions 3.6 and higher, so sessions will -always be supported. Adding an override for `startSession` would introduce a new knob and increase the API surface of -drivers without providing a significant benefit. +design decision because all supported MongoDB versions support sessions. Adding an override for `startSession` would +introduce a new knob and increase the API surface of drivers without providing a significant benefit. ### Drivers use minimum RTT to short circuit operations @@ -668,9 +666,16 @@ timeout for each database operation. This would mimic using `timeoutMode=ITERATI ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2024-01-29: Adjust getMore maxTimeMS calculation for tailable awaitData cursors. + - 2024-09-12: Specify that explain helpers support support timeoutMS. + - 2023-12-07: Migrated from reStructuredText to Markdown. + - 2022-11-17: Use minimum RTT for maxTimeMS calculation instead of 90th percentile RTT. + - 2022-10-05: Remove spec front matter. + - 2022-01-19: Initial version. diff --git a/source/collation/collation.md b/source/collation/collation.md index a2ed53a1bb..8161b67be3 100644 --- a/source/collation/collation.md +++ b/source/collation/collation.md @@ -1,7 +1,6 @@ # Collation - Status: Accepted -- Minimum Server Version: 3.4 ______________________________________________________________________ diff --git a/source/compression/OP_COMPRESSED.md b/source/compression/OP_COMPRESSED.md index 91bc061640..0a296b5cdf 100644 --- a/source/compression/OP_COMPRESSED.md +++ b/source/compression/OP_COMPRESSED.md @@ -2,8 +2,6 @@ - Status: Accepted -- Minimum Server Version: 3.4 - ## Abstract This specification describes how to implement Wire Protocol Compression between MongoDB drivers and mongo[d|s]. diff --git a/source/crud/crud.md b/source/crud/crud.md index 3f2b2ca8fa..57712d536a 100644 --- a/source/crud/crud.md +++ b/source/crud/crud.md @@ -1,7 +1,6 @@ # CRUD API - Status: Accepted -- Minimum Server Version: 2.6 ______________________________________________________________________ @@ -240,7 +239,6 @@ class AggregateOptions { * when the $out or $merge stage is specified. * * This option is sent only if the caller explicitly provides a true value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as document validation is not available. * * @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ */ @@ -250,7 +248,6 @@ class AggregateOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ */ @@ -285,10 +282,8 @@ class AggregateOptions { * the database profiler, currentOp and logs. The default is to not send a value. * * The comment can be any valid BSON type for server versions 4.4 and above. - * Server versions between 3.6 and 4.2 only support string as comment, + * Servers before 4.4 only support string as comment, * and providing a non-string type will result in a server-side error. - * Older server versions do not support comment for aggregate command at all, - * and providing one will result in a server-side error. * * If a comment is provided, drivers MUST attach this comment to all * subsequent getMore commands run on the same cursor for server @@ -344,7 +339,6 @@ class CountOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. */ collation: Optional; @@ -453,7 +447,6 @@ class DistinctOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/distinct/ */ @@ -545,8 +538,7 @@ class FindOptions { * This option is sent only if the caller explicitly provides a value. The default * is to not send a value. * - * This option is only supported by servers >= 4.4. Older servers >= 3.2 will report an error for using this option. - * For servers < 3.2, the driver MUST raise an error if the caller explicitly provides a value. + * This option is only supported by servers >= 4.4; older servers will report an error. * * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ @@ -556,7 +548,6 @@ class FindOptions { * Get partial results from a mongos if some shards are down (instead of throwing an error). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, the Partial wire protocol flag is used and defaults to false. * * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ @@ -566,7 +557,6 @@ class FindOptions { * The number of documents to return per batch. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this is combined with limit to create the wire protocol numberToReturn value. * If specified, drivers SHOULD apply this option to both the original query operation and subsequent * getMore operations on the cursor. * @@ -578,7 +568,6 @@ class FindOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ @@ -604,7 +593,6 @@ class FindOptions { * the tailable and awaitData options. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, the AwaitData and Tailable wire protocol flags are used and default to false. * * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ @@ -624,11 +612,9 @@ class FindOptions { * The maximum number of documents to return. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this is combined with batchSize to create the wire protocol numberToReturn value. * - * A negative limit implies that the caller has requested a single batch of results. For servers >= 3.2, singleBatch - * should be set to true and limit should be converted to a positive value. For servers < 3.2, the wire protocol - * numberToReturn value may be negative. + * A negative limit implies that the caller has requested a single batch of results. singleBatch should be set to + * true and limit should be converted to a positive value. * * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ @@ -649,7 +635,6 @@ class FindOptions { * this option is ignored. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as maxTimeMS does not exist in the OP_GET_MORE wire protocol. * * Note: This option is specified as "maxTimeMS" in the getMore command and not provided as part of the * initial find command. @@ -693,7 +678,6 @@ class FindOptions { * to prevent excess memory use. Set this option to prevent that. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, the NoCursorTimeout wire protocol flag is used and defaults to false. * * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ @@ -705,7 +689,6 @@ class FindOptions { * Note: this option is intended for internal replication use only. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, the OplogReplay wire protocol flag is used and defaults to false. * For servers >= 4.4, the server will ignore this option if set (see: SERVER-36186). * * @see https://www.mongodb.com/docs/manual/reference/command/find/ @@ -744,7 +727,6 @@ class FindOptions { * The number of documents to skip before returning. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this is a wire protocol parameter that defaults to 0. * * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ @@ -890,43 +872,6 @@ When users specify both `limit` and `batchSize` options with the same value, the batch, but still leaves an open cursor that needs to be closed using the `killCursors` command. To avoid this, drivers MUST send a value of `limit + 1` for `batchSize` in the resulting `find` command. This eliminates the open cursor issue. -##### Combining Limit and Batch Size for OP_QUERY - -The OP_QUERY wire protocol only contains a numberToReturn value which drivers must calculate to get expected limit and -batch size behavior. Subsequent calls to OP_GET_MORE should use the user-specified batchSize or default to 0. If the -result is larger than the max Int32 value, an error MUST be raised as the computed value is impossible to send to the -server. Below is pseudo-code for calculating numberToReturn for OP_QUERY. - -```typescript -function calculateFirstNumberToReturn(options: FindOptions): Int32 { - Int32 numberToReturn; - Int32 limit = options.limit || 0; - Int32 batchSize = options.batchSize || 0; - - if (limit < 0) { - numberToReturn = limit; - } - else if (limit == 0) { - numberToReturn = batchSize; - } - else if (batchSize == 0) { - numberToReturn = limit; - } - else if (limit < batchSize) { - numberToReturn = limit; - } - else { - numberToReturn = batchSize; - } - - return numberToReturn; -} -``` - -Because of this anomaly in the wire protocol, it is up to the driver to enforce the user-specified limit. Each driver -MUST keep track of how many documents have been iterated and stop iterating once the limit has been reached. When the -limit has been reached, if the cursor is still open, a driver MUST kill the cursor. - ##### Database-level aggregation The server supports several collection-less aggregation source stages like `$currentOp` and `$listLocalSessions`. The @@ -952,9 +897,6 @@ interface Collection { * * An error MUST be raised if the requests parameter is empty. * - * For servers < 3.4, if a collation was explicitly set for any request, an error MUST be raised - * and no documents sent. - * * NOTE: see the FAQ about the previous bulk API and how it relates to this. * @see https://www.mongodb.com/docs/manual/reference/command/delete/ * @see https://www.mongodb.com/docs/manual/reference/command/insert/ @@ -1042,8 +984,6 @@ class BulkWriteOptions { * If true, allows the write to opt-out of document level validation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as document validation is not available. - * For unacknowledged writes using OP_INSERT, OP_UPDATE, or OP_DELETE, the driver MUST raise an error if the caller explicitly provides a value. */ bypassDocumentValidation: Optional; @@ -1094,8 +1034,6 @@ class InsertOneOptions { * If true, allows the write to opt-out of document level validation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as document validation is not available. - * For unacknowledged writes using OP_INSERT, the driver MUST raise an error if the caller explicitly provides a value. */ bypassDocumentValidation: Optional; @@ -1133,8 +1071,6 @@ class InsertManyOptions { * If true, allows the write to opt-out of document level validation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as document validation is not available. - * For unacknowledged writes using OP_INSERT, the driver MUST raise an error if the caller explicitly provides a value. */ bypassDocumentValidation: Optional; @@ -1179,8 +1115,6 @@ class UpdateOptions { * A set of filters specifying to which array elements an update should apply. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.6, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1190,8 +1124,6 @@ class UpdateOptions { * If true, allows the write to opt-out of document level validation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as document validation is not available. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. */ bypassDocumentValidation: Optional; @@ -1199,8 +1131,6 @@ class UpdateOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1211,10 +1141,6 @@ class UpdateOptions { * If specified, then the query system will only consider plans using the hinted index. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 4.2. Older servers >= 3.4 will report an error for using this option. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_MSG and servers < 4.2, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1287,8 +1213,6 @@ class ReplaceOptions { * If true, allows the write to opt-out of document level validation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as document validation is not available. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. */ bypassDocumentValidation: Optional; @@ -1296,8 +1220,6 @@ class ReplaceOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1308,10 +1230,6 @@ class ReplaceOptions { * If specified, then the query system will only consider plans using the hinted index. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 4.2. Older servers >= 3.4 will report an error for using this option. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_MSG and servers < 4.2, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1383,8 +1301,6 @@ class DeleteOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_DELETE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/delete/ */ @@ -1395,9 +1311,7 @@ class DeleteOptions { * If specified, then the query system will only consider plans using the hinted index. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 4.4. Older servers >= 3.4 will report an error for using this option. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_DELETE, the driver MUST raise an error if the caller explicitly provides a value. + * This option is only supported by servers >= 4.4. Older servers >= 4.2 will report an error for using this option. * For unacknowledged writes using OP_MSG and servers < 4.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/delete/ @@ -1475,8 +1389,6 @@ class DeleteOneModel implements WriteModel { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_DELETE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/delete/ */ @@ -1487,9 +1399,7 @@ class DeleteOneModel implements WriteModel { * If specified, then the query system will only consider plans using the hinted index. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 4.4. Older servers >= 3.4 will report an error for using this option. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_DELETE, the driver MUST raise an error if the caller explicitly provides a value. + * This option is only supported by servers >= 4.4. Older servers >= 4.2 will report an error for using this option. * For unacknowledged writes using OP_MSG and servers < 4.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/delete/ @@ -1510,8 +1420,6 @@ class DeleteManyModel implements WriteModel { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_DELETE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/delete/ */ @@ -1522,8 +1430,7 @@ class DeleteManyModel implements WriteModel { * If specified, then the query system will only consider plans using the hinted index. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 4.4. Older servers >= 3.4 will report an error for using this option. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. + * This option is only supported by servers >= 4.4. Older servers >= 4.2 will report an error for using this option. * For unacknowledged writes using OP_DELETE or OP_MSG, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/delete/ @@ -1551,8 +1458,6 @@ class ReplaceOneModel implements WriteModel { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1563,10 +1468,6 @@ class ReplaceOneModel implements WriteModel { * If specified, then the query system will only consider plans using the hinted index. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 4.2. Older servers >= 3.4 will report an error for using this option. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_MSG and servers < 4.2, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1613,8 +1514,6 @@ class UpdateOneModel implements WriteModel { * A set of filters specifying to which array elements an update should apply. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.6, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1624,8 +1523,6 @@ class UpdateOneModel implements WriteModel { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1636,10 +1533,6 @@ class UpdateOneModel implements WriteModel { * If specified, then the query system will only consider plans using the hinted index. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 4.2. Older servers >= 3.4 will report an error for using this option. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_MSG and servers < 4.2, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1686,8 +1579,6 @@ class UpdateManyModel implements WriteModel { * A set of filters specifying to which array elements an update should apply. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.6, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1697,8 +1588,6 @@ class UpdateManyModel implements WriteModel { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1709,10 +1598,6 @@ class UpdateManyModel implements WriteModel { * If specified, then the query system will only consider plans using the hinted index. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 4.2. Older servers >= 3.4 will report an error for using this option. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_UPDATE, the driver MUST raise an error if the caller explicitly provides a value. - * For unacknowledged writes using OP_MSG and servers < 4.2, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -2124,7 +2009,6 @@ class FindOneAndDeleteOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ */ @@ -2136,7 +2020,6 @@ class FindOneAndDeleteOptions { * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. * This option is only supported by servers >= 4.4. Older servers >= 4.2 will report an error for using this option. - * For servers < 4.2, the driver MUST raise an error if the caller explicitly provides a value. * For unacknowledged writes and servers < 4.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ @@ -2220,7 +2103,6 @@ class FindOneAndReplaceOptions { * If true, allows the write to opt-out of document level validation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as document validation is not available. */ bypassDocumentValidation: Optional; @@ -2228,7 +2110,6 @@ class FindOneAndReplaceOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ */ @@ -2240,7 +2121,6 @@ class FindOneAndReplaceOptions { * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. * This option is only supported by servers >= 4.4. Older servers >= 4.2 will report an error for using this option. - * For servers < 4.2, the driver MUST raise an error if the caller explicitly provides a value. * For unacknowledged writes and servers < 4.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ @@ -2345,7 +2225,6 @@ class FindOneAndUpdateOptions { * A set of filters specifying to which array elements an update should apply. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.6, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -2355,7 +2234,6 @@ class FindOneAndUpdateOptions { * If true, allows the write to opt-out of document level validation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.2, this option is ignored and not sent as document validation is not available. */ bypassDocumentValidation: Optional; @@ -2363,7 +2241,6 @@ class FindOneAndUpdateOptions { * Specifies a collation. * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * For servers < 3.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ */ @@ -2375,7 +2252,6 @@ class FindOneAndUpdateOptions { * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. * This option is only supported by servers >= 4.4. Older servers >= 4.2 will report an error for using this option. - * For servers < 4.2, the driver MUST raise an error if the caller explicitly provides a value. * For unacknowledged writes and servers < 4.4, the driver MUST raise an error if the caller explicitly provides a value. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ @@ -2718,22 +2594,14 @@ release. Q: Where is `singleBatch` in FindOptions? Drivers have historically allowed users to request a single batch of results (after which the cursor is closed) by -specifying a negative value for the `limit` option. For servers < 3.2, a single batch may be requested by specifying a -negative value in the `numberToReturn` wire protocol field. For servers >= 3.2, the `find` command defines `limit` as a -non-negative integer option but introduces a `singleBatch` boolean option. Rather than introduce a `singleBatch` option -to FindOptions, the spec preserves the existing API for `limit` and instructs drivers to convert negative values -accordingly for servers >= 3.2. +specifying a negative value for the `limit` option. The `find` command defines `limit` as a non-negative integer option +but introduces a `singleBatch` boolean option. Rather than introduce a `singleBatch` option to FindOptions, the spec +preserves the existing API for `limit` and instructs drivers to convert negative values accordingly. Q: Why are client-side errors raised for some unsupported options? -Server versions before 3.4 were inconsistent about reporting errors for unrecognized command options and may simply -ignore them, which means a client-side error is the only way to inform users that such options are unsupported. For -unacknowledged writes using OP_MSG, a client-side error is necessary because the server has no chance to return a -response (even though a 3.6+ server is otherwise capable of reporting errors for unrecognized options). For -unacknowledged writes using legacy opcodes (i.e. OP_INSERT, OP_UPDATE, and OP_DELETE), the message body has no field -with which to express these options so a client-side error is the only mechanism to inform the user that such options -are unsupported. The spec does not explicitly refer to unacknowledged writes using OP_QUERY primarily because a response -document is always returned and drivers generally would not consider using OP_QUERY precisely for that reason. +For unacknowledged writes using OP_MSG, a client-side error is necessary because the server has no chance to return a +response. Q: Why does reverting to using `count` instead of `aggregate` with `$collStats` for estimatedDocumentCount not require a major version bump in the drivers, even though it might break users of the Stable API? @@ -2749,6 +2617,8 @@ aforementioned allowance in the SemVer spec. ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2025-09-09: Clarify that `rawData` is for internal use only. - 2025-06-27: Added `rawData` options. diff --git a/source/enumerate-collections/enumerate-collections.md b/source/enumerate-collections/enumerate-collections.md index 4e3857a1eb..4938c1e465 100644 --- a/source/enumerate-collections/enumerate-collections.md +++ b/source/enumerate-collections/enumerate-collections.md @@ -1,7 +1,6 @@ # Enumerating Collections - Status: Accepted -- Minimum Server Version: 1.8 ______________________________________________________________________ @@ -159,11 +158,6 @@ Example return: ] ``` -Server version between 2.7.6 (inclusive) and 4.0 (exclusive) do not support the `nameOnly` option for the -`listCollections` command and will ignore it without raising an error. Therefore, drivers MUST always specify 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`. - 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. @@ -290,6 +284,8 @@ The shell implements the first algorithm for falling back if the `listCollection ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2026-05-13: Clarify "Replica Sets" section: reword to distinguish server capability from driver routing rule; remove stale `system.indexes` bullet (2.x behavior). diff --git a/source/enumerate-databases/enumerate-databases.md b/source/enumerate-databases/enumerate-databases.md index a4054d9612..7aaf2c9654 100644 --- a/source/enumerate-databases/enumerate-databases.md +++ b/source/enumerate-databases/enumerate-databases.md @@ -1,7 +1,6 @@ # Enumerating Databases - Status: Accepted -- Minimum Server Version: 3.6 ______________________________________________________________________ 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 da3d775a18..df971567dd 100644 --- a/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md +++ b/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md @@ -1,7 +1,6 @@ # Find, getMore and killCursors commands - Status: Accepted -- Minimum Server Version: 3.2 ## Abstract diff --git a/source/index-management/index-management.md b/source/index-management/index-management.md index af1cfaed3b..325c94d796 100644 --- a/source/index-management/index-management.md +++ b/source/index-management/index-management.md @@ -1,7 +1,6 @@ # Index Management - Status: Accepted -- Minimum Server Version: 3.6 ______________________________________________________________________ diff --git a/source/mongodb-handshake/handshake.md b/source/mongodb-handshake/handshake.md index 25695ec783..f80b2d5379 100644 --- a/source/mongodb-handshake/handshake.md +++ b/source/mongodb-handshake/handshake.md @@ -1,7 +1,6 @@ # MongoDB Handshake - Status: Accepted -- Minimum Server Version: 3.4 ______________________________________________________________________ @@ -49,18 +48,16 @@ MongoDB uses the `hello` or `isMaster` commands for handshakes and topology moni preferred command. `hello` must always be sent using the `OP_MSG` protocol. `isMaster` is referred to as "legacy hello" and is maintained for backwards compatibility with servers that do not support the `hello` command. -Drivers MUST use the `OP_MSG` protocol for all handshakes if their minWireVersion is 6 (MongoDB 3.6) or higher. If a -[server API version](../versioned-api/versioned-api.md) is requested or `loadBalanced: True`, drivers MUST also use the -`hello` command for the initial handshake. If server API version is not requested and `loadBalanced: False`, drivers -MUST use legacy hello for the first message of the initial handshake, and include `helloOk:true` in the handshake -request. +Drivers MUST use the `OP_MSG` protocol for all handshakes. If a [server API version](../versioned-api/versioned-api.md) +is requested or `loadBalanced: True`, drivers MUST also use the `hello` command for the initial handshake. If server API +version is not requested and `loadBalanced: False`, drivers MUST use legacy hello for the first message of the initial +handshake, and include `helloOk:true` in the handshake request. ASIDE: If the legacy handshake response includes `helloOk: true`, then subsequent topology monitoring commands MUST use the `hello` command. If the legacy handshake response does not include `helloOk: true`, then subsequent topology monitoring commands MUST use the legacy hello command. See the [Server Discovery and Monitoring spec](../server-discovery-and-monitoring/server-discovery-and-monitoring-summary.md) -for further information. Additionally, note that if the server does not understand `OP_MSG`, the server will close the -socket. +for further information. The initial handshake MUST be performed on every socket to any and all servers upon establishing the connection to MongoDB, including reconnects of dropped connections and newly discovered members of a cluster. It MUST be the first @@ -538,10 +535,6 @@ support the `hello` command, the `helloOk: true` argument is ignored and the leg - No -- Is establishing the handshake required for connecting to MongoDB 3.4? - - - No, it only augments the connection. MongoDB will not reject connections without it - - Does this affect SDAM implementations? - Possibly. There are a couple of gotchas. If the application.name is not in the URI... @@ -558,6 +551,7 @@ support the `hello` command, the `helloOk: true` argument is ignored and the leg ## Changelog +- 2026-06-17: Remove pre-4.2 version references. - 2026-06-05: Use OP_MSG for all handshakes. - 2025-09-04: Clarify that drivers do not append the same metadata multiple times. - 2025-06-09: Add requirement to allow appending to client metadata after `MongoClient` initialization. diff --git a/source/read-write-concern/read-write-concern.md b/source/read-write-concern/read-write-concern.md index 04a4e20505..fe509fce4a 100644 --- a/source/read-write-concern/read-write-concern.md +++ b/source/read-write-concern/read-write-concern.md @@ -1,7 +1,6 @@ # Read and Write Concern - Status: Accepted -- Minimum Server Version: 2.4 ______________________________________________________________________ diff --git a/source/retryable-reads/retryable-reads.md b/source/retryable-reads/retryable-reads.md index 61f7ed34ce..dea35ef01f 100644 --- a/source/retryable-reads/retryable-reads.md +++ b/source/retryable-reads/retryable-reads.md @@ -1,7 +1,6 @@ # Retryable Reads - Status: Accepted -- Minimum Server Version: 3.6 ______________________________________________________________________ @@ -85,19 +84,6 @@ the defined name but MAY deviate to comply with their existing conventions. ### Requirements for Retryable Reads -#### Supported Server Versions - -Drivers MUST verify server eligibility by ensuring that `maxWireVersion` is at least 6 because retryable reads require a -MongoDB 3.6 standalone, replica set or shard cluster, MongoDB 3.6 server wire version is 6 as defined in the -[Server Wire version and Feature List specification](../wireversion-featurelist/wireversion-featurelist.md). - -The minimum server version is 3.6 because - -1. It gives us version parity with retryable writes. -2. It forces the retry attempt(s) to use the same implicit session, which would make it it easier to track operations - and kill any errant longer running operation. -3. It limits the scope of the implementation (`OP_QUERY` will not need to be supported). - #### Supported Read Operations Drivers MUST support retryability for the following operations: @@ -506,8 +492,6 @@ None. [retryable writes specification](../retryable-writes/retryable-writes.md) may also need to be reflected in the retryable reads specification, and vice versa. 3. We may revisit the decision not retry `Cursor.getMore()` (see [Q&A](#qa)). -4. Once [DRIVERS-560](https://jira.mongodb.org/browse/DRIVERS-560) is resolved, tests will be added to allow testing - Retryable Reads on MongoDB 3.6. See the [test plan](./tests/README.md) for additional information. ## Q&A @@ -580,6 +564,8 @@ any customers experiencing degraded performance can simply disable `retryableRea ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2026-02-19: Clarified that server deprioritization on replica sets only occurs for `SystemOverloadedError` errors. - 2026-02-11: Clarified that the retry logic and pseudocode does not include the modifications required by client diff --git a/source/retryable-writes/retryable-writes.md b/source/retryable-writes/retryable-writes.md index d96e991ce6..8d8f9f9748 100644 --- a/source/retryable-writes/retryable-writes.md +++ b/source/retryable-writes/retryable-writes.md @@ -1,7 +1,6 @@ # Retryable Writes - Status: Accepted -- Minimum Server Version: 3.6 ______________________________________________________________________ @@ -149,16 +148,15 @@ commands if they fail to return a response. 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 +command within a transaction (excepting `commitTransaction` and `abortTransaction`), even when `retryWrites` has been set to true on the `MongoClient`. ### Implementing Retryable Writes #### Determining Retryable Write Errors -When connected to a MongoDB instance that supports retryable writes (versions 3.6+), the driver MUST treat all errors -with the RetryableWriteError label as retryable. This error label can be found in the top-level "errorLabels" field of -the error. +The driver MUST treat all errors with the RetryableWriteError label as retryable. This error label can be found in the +top-level "errorLabels" field of the error. ##### RetryableWriteError Labels @@ -687,6 +685,8 @@ retryWrites is not true would be inconsistent with the server and potentially co ## Changelog +- 2026-06-17: Remove pre-4.2 version references; + - 2026-02-19: Clarified that server deprioritization on replica sets only occurs for `SystemOverloadedError` errors. - 2026-02-11: Clarified that the retry logic and pseudocode does not include the modifications required by client 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 9583a914a1..34feadf444 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 @@ -1,7 +1,6 @@ # Server Discovery And Monitoring -- Summary - Status: Accepted -- Minimum Server Version: 2.4 ______________________________________________________________________ @@ -137,5 +136,8 @@ connection pool for the server. ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2024-05-02: Migrated from reStructuredText to Markdown. + - 2022-10-05: Revise spec front matter and add 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 b758e11e04..f5a06e3550 100644 --- a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md +++ b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md @@ -1,7 +1,6 @@ # Server Discovery And Monitoring - Status: Accepted -- Minimum Server Version: 2.4 ______________________________________________________________________ @@ -1039,7 +1038,7 @@ def handleError(error): # Mark the server Unknown unknown = new ServerDescription(type=Unknown, error=error, topologyVersion=topologyVersion) onServerDescriptionChanged(unknown, connection pool for server) - if isShutdown(code) or (error was from <4.2): + if isShutdown(code): # the pools must only be cleared while the lock is held. if type == LoadBalanced: clear connection pool for serviceId @@ -1250,7 +1249,7 @@ The following subset of "node is recovering" errors is defined to be "node is sh | ShutdownInProgress | 91 | When handling a "not writable primary" or "node is recovering" error, the client MUST clear the server's connection pool -if and only if the error is "node is shutting down" or the error originated from server version < 4.2. +if and only if the error is "node is shutting down". (See [when does a client see "not writable primary" or "node is recovering"?](#when-does-a-client-see-not-writable-primary-or-node-is-recovering), @@ -1937,6 +1936,8 @@ oversaw the specification process. ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2015-12-17: Require clients to compare (setVersion, electionId) tuples. - 2015-10-09: Specify electionID comparison method. diff --git a/source/sessions/driver-sessions.md b/source/sessions/driver-sessions.md index 556ee721d3..9d5c2154e3 100644 --- a/source/sessions/driver-sessions.md +++ b/source/sessions/driver-sessions.md @@ -1,7 +1,6 @@ # Sessions Specification - Status: Accepted -- Minimum Server Version: 3.6 ______________________________________________________________________ @@ -791,12 +790,9 @@ Drivers do not need to check the deployment topology or the server version they highest seen `$clusterTime`. They simply need to check for the presence of the `$clusterTime` field in responses received from servers. -### Gossipping with mixed server versions +### Gossipping the cluster time -Drivers MUST check that the server they are sending a command to supports `$clusterTime` before adding `$clusterTime` to -the command. A server supports `$clusterTime` when the `maxWireVersion` >= 6. - -This supports the (presumably short lived) scenario where not all servers have been upgraded to 3.6. +Drivers MUST add `$clusterTime` to commands sent to the server. ### Do not gossip on SDAM commands @@ -934,6 +930,7 @@ has risks that do not justify the potential guaranteed `ServerSession` allocatio ## Changelog +- 2026-06-17: Remove pre-4.2 version references. - 2025-02-24: Drivers MUST NOT gossip $clusterTime on SDAM commands. - 2024-05-08: Migrated from reStructuredText to Markdown. - 2017-09-13: If causalConsistency option is omitted assume true diff --git a/source/transactions/transactions.md b/source/transactions/transactions.md index eb5bd71e86..3129060866 100644 --- a/source/transactions/transactions.md +++ b/source/transactions/transactions.md @@ -1,7 +1,6 @@ # Transactions Specification - Status: Accepted -- Minimum Server Version: 4.0 ______________________________________________________________________ @@ -59,8 +58,8 @@ Any error or timeout that occurs while selecting a server or reading from or wri #### Error Label -Starting in MongoDB 4.0, any command error may include a top level "errorLabels" field. The field contains an array of -string error labels. Drivers may also add error labels to errors that they return. +Any command error may include a top level "errorLabels" field. The field contains an array of string error labels. +Drivers may also add error labels to errors that they return. #### Transient Transaction Error @@ -414,8 +413,8 @@ server to the client, or determined client-side. Any error reported by the drive selection error, or network error MUST have an API for determining whether it has a given label. In programming languages that use class inheritance hierarchies for exceptions, the presence of an error label MUST NOT affect an exception's class. Error labels MUST be expressed as a collection of text strings, and it MUST be possible for -applications to check if an error has a label that is not yet specified in MongoDB 4.0. Drivers MAY define constants for -error label strings that are known at this time. +applications to check if an error has a label that is not yet specified in the current driver version. Drivers MAY +define constants for error label strings that are known at this time. Drivers MAY implement an error label API similar to the following: @@ -461,7 +460,7 @@ 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. To support causal +`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`. @@ -469,9 +468,9 @@ All commands of a multi-statement transaction subsequent to the initial command 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" 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 @@ -719,8 +718,7 @@ contents of the document. ### Error Labels -Starting in MongoDB 4.0, any command error may include a top level "errorLabels" field. The field contains an array of -string error labels. +Any command error may include a top level "errorLabels" field. The field contains an array of string error labels. ### Transient Transaction Error @@ -1128,6 +1126,8 @@ must apply a majority write concern to prevent the transaction from being applie ## **Changelog** +- 2026-06-17: Remove pre-4.2 version references. + - 2026-01-09: Specify the handling of client backpressure. - 2024-11-01: Clarify collection options inside txn. From 6c2b1f2537401ea1a9055613d6d75778a1f7b156 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Fri, 26 Jun 2026 14:11:54 -0400 Subject: [PATCH 6/9] DRIVERS-3439 remove additional pre-4.2 references found in review --- source/bson-decimal128/decimal128.md | 5 +-- source/change-streams/change-streams.md | 5 ++- source/crud/crud.md | 19 ++++----- .../find_getmore_killcursors_commands.md | 27 +++--------- source/index-management/index-management.md | 22 ++++------ .../read-write-concern/read-write-concern.md | 42 ++++--------------- source/retryable-reads/retryable-reads.md | 25 ++--------- source/retryable-writes/retryable-writes.md | 16 ++----- .../server-discovery-and-monitoring.md | 33 +++++++-------- .../unified-test-format.md | 12 +++--- 10 files changed, 63 insertions(+), 143 deletions(-) diff --git a/source/bson-decimal128/decimal128.md b/source/bson-decimal128/decimal128.md index 6c62bae981..3d91181232 100644 --- a/source/bson-decimal128/decimal128.md +++ b/source/bson-decimal128/decimal128.md @@ -339,15 +339,12 @@ Most of the tests are converted from the - NumberDecimal("2.000") -- Should a driver avoid sending Decimal128 values to pre-3.4 servers? - - - No - - Is there a wire version bump or something for Decimal128? - No ## Changelog +- 2026-06-17: Remove pre-4.2 version references. - 2024-02-08: Migrated from reStructuredText to Markdown. - 2022-10-05: Remove spec front matter. diff --git a/source/change-streams/change-streams.md b/source/change-streams/change-streams.md index 01012aa8fd..689e699e95 100644 --- a/source/change-streams/change-streams.md +++ b/source/change-streams/change-streams.md @@ -714,7 +714,6 @@ The `ChangeStream` MUST save the `operationTime` from the initial `aggregate` re met: - None of `startAtOperationTime`, `resumeAfter`, `startAfter` were specified in the `ChangeStreamOptions`. -- The max wire version is >= `7`. - The initial `aggregate` response had no results. - The initial `aggregate` response did not include a `postBatchResumeToken`. @@ -744,7 +743,7 @@ MUST follow these steps: - The driver MUST NOT set `startAtOperationTime`. If `startAtOperationTime` was in the original aggregation command, the driver MUST remove it. - Else if there is no cached `resumeToken` and the `ChangeStream` has a saved operation time (either from an originally - specified `startAtOperationTime` or saved from the original aggregation) and the max wire version is >= `7`: + specified `startAtOperationTime` or saved from the original aggregation): - The driver MUST NOT set `resumeAfter`. - The driver MUST NOT set `startAfter`. - The driver MUST set `startAtOperationTime` to the value of the originally used `startAtOperationTime` or the one @@ -1025,6 +1024,8 @@ There should be no backwards compatibility concerns. ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2026-04-28: Remove test for nsType when creating timeseries - 2026-03-18: Revert expanded field visibility change. diff --git a/source/crud/crud.md b/source/crud/crud.md index 57712d536a..a9e54fdfc5 100644 --- a/source/crud/crud.md +++ b/source/crud/crud.md @@ -309,7 +309,7 @@ class AggregateOptions { * accessed as variables in an aggregate expression context (e.g. "$$var"). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 5.0. Older servers >= 2.6 (and possibly earlier) will report an error for using this option. + * This option is only supported by servers >= 5.0. Older servers will report an error for using this option. * * @see https://www.mongodb.com/docs/manual/reference/command/aggregate/ */ @@ -757,7 +757,7 @@ class FindOptions { * accessed as variables in an aggregate expression context (e.g. "$$var"). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 5.0. Older servers >= 2.6 (and possibly earlier) will report an error for using this option. + * This option is only supported by servers >= 5.0. Older servers will report an error for using this option. * * @see https://www.mongodb.com/docs/manual/reference/command/find/ */ @@ -797,8 +797,7 @@ command differs depending on the options passed to it and may or may not provide is provided the count command provides an estimate using collection metadata. Even when provided with a query filter the count command can return inaccurate results with a sharded cluster [if orphaned documents exist or if a chunk migration is in progress](https://www.mongodb.com/docs/manual/reference/command/count/#behavior). -The countDocuments helper avoids these sharded cluster problems entirely when used with MongoDB 3.6+, and when using -`Primary` read preference with older sharded clusters. +The countDocuments helper avoids these sharded cluster problems entirely. ##### estimatedDocumentCount @@ -1161,7 +1160,7 @@ class UpdateOptions { * accessed as variables in an aggregate expression context (e.g. "$$var"). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 5.0. Older servers >= 2.6 (and possibly earlier) will report an error for using this option. + * This option is only supported by servers >= 5.0. Older servers will report an error for using this option. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1250,7 +1249,7 @@ class ReplaceOptions { * accessed as variables in an aggregate expression context (e.g. "$$var"). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 5.0. Older servers >= 2.6 (and possibly earlier) will report an error for using this option. + * This option is only supported by servers >= 5.0. Older servers will report an error for using this option. * * @see https://www.mongodb.com/docs/manual/reference/command/update/ */ @@ -1324,7 +1323,7 @@ class DeleteOptions { * accessed as variables in an aggregate expression context (e.g. "$$var"). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 5.0. Older servers >= 2.6 (and possibly earlier) will report an error for using this option. + * This option is only supported by servers >= 5.0. Older servers will report an error for using this option. * * @see https://www.mongodb.com/docs/manual/reference/command/delete/ */ @@ -2063,7 +2062,7 @@ class FindOneAndDeleteOptions { * accessed as variables in an aggregate expression context (e.g. "$$var"). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 5.0. Older servers >= 2.6 (and possibly earlier) will report an error for using this option. + * This option is only supported by servers >= 5.0. Older servers will report an error for using this option. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ */ @@ -2185,7 +2184,7 @@ class FindOneAndReplaceOptions { * accessed as variables in an aggregate expression context (e.g. "$$var"). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 5.0. Older servers >= 2.6 (and possibly earlier) will report an error for using this option. + * This option is only supported by servers >= 5.0. Older servers will report an error for using this option. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ */ @@ -2314,7 +2313,7 @@ class FindOneAndUpdateOptions { * accessed as variables in an aggregate expression context (e.g. "$$var"). * * This option is sent only if the caller explicitly provides a value. The default is to not send a value. - * This option is only supported by servers >= 5.0. Older servers >= 2.6 (and possibly earlier) will report an error for using this option. + * This option is only supported by servers >= 5.0. Older servers will report an error for using this option. * * @see https://www.mongodb.com/docs/manual/reference/command/findAndModify/ */ 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 df971567dd..9cdb8f79db 100644 --- a/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md +++ b/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md @@ -39,12 +39,10 @@ for the driver. ### Implementation -If the **hello** command returns **maxWireVersion >= 4**, drivers: +Drivers: -- MUST implement queries with the `find` command instead of `OP_QUERY`. -- MUST implement cursor operations with the `getMore` and `killCursors` commands instead of `OP_GET_MORE` and - `OP_KILL_CURSORS`, respectively. -- MUST NOT use OP_QUERY except to execute commands. +- MUST implement queries with the `find` command. +- MUST implement cursor operations with the `getMore` and `killCursors` commands. ## Commands @@ -69,23 +67,6 @@ For a successful command, the document returned from the server has the followin } ``` -#### Special Collection names - -The find command **does not support querying on system collections**, so if drivers are using any system collections -instead of the inprog, killop, unlock, etc. commands they SHOULD default to using the old-style OP_QUERY. - -Any driver that provides helpers for any of the special collections below SHOULD use the replacement commands if -**hello.maxWireVersion >=4** or higher. - -| Special collection name | Replacement Command | -| ------------------------------ | ------------------- | -| `$cmd.sys.inprog` | currentOp | -| `$cmd.sys.unlock` | fsyncUnlock | -| `.system.indexes` | listIndexes | -| `.system.namespaces` | listCollections | - -Special Collection Names - #### Exhaust This section only applies to drivers that support exhaust cursors. @@ -453,6 +434,8 @@ More in depth information about passing read preferences to Mongos can be found ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2024-07-30: Migrated from reStructuredText to Markdown. - 2023-05-10: Improve tailable cursor description and update the `getMore` section code blocks. diff --git a/source/index-management/index-management.md b/source/index-management/index-management.md index 325c94d796..7efd1da5c7 100644 --- a/source/index-management/index-management.md +++ b/source/index-management/index-management.md @@ -302,7 +302,7 @@ Java: collection.createIndex(new Document("name", 1), new IndexOptions().unique(true)); ``` -Produces the shell equivalent (>= 2.6.0) of: +Produces the shell equivalent of: ```javascript db.runCommand({ @@ -333,7 +333,7 @@ collection.createIndexes(asList( )); ``` -Produces the shell equivalent (>= 2.6.0) of: +Produces the shell equivalent of: ```javascript db.runCommand({ @@ -399,7 +399,7 @@ Java: collection.listIndexes(); ``` -Produces the shell equivalent (>= 3.0.0) of: +Produces the shell equivalent of: ```javascript db.runCommand({ listIndexes: "users" }); @@ -547,7 +547,7 @@ Java: collection.indexes().createOne(new Document("name", 1), new IndexOptions().unique(true)); ``` -Produces the shell equivalent (>= 2.6.0) of: +Produces the shell equivalent of: ```javascript db.runCommand({ @@ -578,7 +578,7 @@ collection.indexes().createMany(asList( )); ``` -Produces the shell equivalent (>= 2.6.0) of: +Produces the shell equivalent of: ```javascript db.runCommand({ @@ -648,7 +648,7 @@ for (BsonDocument document: collection.indexes()) { } ``` -Produces the shell equivalent (>= 3.0.0) of: +Produces the shell equivalent of: ```javascript var indexes = db.runCommand({ listIndexes: "users" }); @@ -737,10 +737,6 @@ interface IndexOptions { /** * Optionally provides the text index version number. - * - * MongoDB 2.4 can only support version 1. - * - * MongoDB 2.6 and higher may support version 1 or 2. */ textIndexVersion: Int32; @@ -751,10 +747,6 @@ interface IndexOptions { /** * Optionally specifies the 2dsphere index version number. - * - * MongoDB 2.4 can only support version 1. - * - * MongoDB 2.6 and higher may support version 1 or 2. */ 2dsphereIndexVersion: Int32; @@ -1196,6 +1188,8 @@ from mistakenly specifying this option, drivers manually verify it is only sent #### Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2025-12-18: Search index tests only assert `latestDefinition.mappings.dynamic` values. - 2025-09-09: Clarify that `rawData` is for internal use only. diff --git a/source/read-write-concern/read-write-concern.md b/source/read-write-concern/read-write-concern.md index fe509fce4a..3c71360be2 100644 --- a/source/read-write-concern/read-write-concern.md +++ b/source/read-write-concern/read-write-concern.md @@ -199,16 +199,6 @@ For example: mongodb://server:27017/db?readConcernLevel=majority ``` -#### Errors - -- MaxWireVersion < 4 Only the server's default `ReadConcern` is support by MaxWireVersion < 4. When using other - `readConcernLevels` with clients reporting `MaxWireVersion` < 4, the driver MUST raise an error. This check MUST - happen after server selection has occurred in the case of mixed version clusters. It is up to users to appropriately - define a `ReadPreference` such that intermittent errors do not occur. - -> [!NOTE] -> `ReadConcern` is only supported for commands. - ### Write Concern When a driver sends a write concern document to the server, the structure of the write concern document MUST be as @@ -345,26 +335,13 @@ as-is. The `findAndModify` command takes a named parameter, `writeConcern`. See command documentation for further examples. -If writeConcern is specified for the Collection, `writeConcern` MUST be omitted when sending `findAndModify` with -MaxWireVersion < 4. - -If the findAndModify helper accepts writeConcern as a parameter, the driver MUST raise an error with MaxWireVersion \< -4\. - -> [!NOTE] -> Driver documentation SHOULD include a warning in their server 3.2 compatible releases that an elevated `WriteConcern` -> may cause performance degradation when using `findAndModify`. This is because `findAndModify` will now be honoring a -> potentially high latency setting where it did not before. - ##### Other commands that write Command helper methods for commands that write, other than those discussed above, MAY accept a write concern or write -concern options in their parameter list. If the helper accepts a write concern, the driver MUST error if the selected -server's MaxWireVersion < 5 and a write concern has explicitly been specified. +concern options in their parameter list. -Helper methods that apply the write concern inherited from the Collection or Database, SHOULD check whether the selected -server's MaxWireVersion >= 5 and if so, include the inherited write concern in the command on the wire. If the selected -server's MaxWireVersion < 5, these methods SHOULD silently omit the write concern from the command on the wire. +Helper methods that apply the write concern inherited from the Collection or Database SHOULD include the inherited write +concern in the command on the wire. These commands that write are: @@ -522,10 +499,8 @@ Below are English descriptions of other items that should be tested: ### ReadConcern -1. Commands supporting a read concern MUST raise an error when MaxWireVersion is less than 4 and a non-default, - non-local read concern is specified. -2. Commands supporting a read concern MUST NOT send the default read concern to the server. -3. Commands supporting a read concern MUST send any non-default read concern to the server. +1. Commands supporting a read concern MUST NOT send the default read concern to the server. +2. Commands supporting a read concern MUST send any non-default read concern to the server. ### WriteConcern @@ -538,11 +513,6 @@ These are currently under construction. ## Q & A -Q: Why is specifying a non-default `ReadConcern` for servers < 3.2 an error while a non-default write concern gets -ignored in `findAndModify`? `findAndModify` is an existing command and since `WriteConcern` may be defined globally, -anyone using `findAndModify` in their applications with a non-default `WriteConcern` defined globally would have all -their `findAndModify` operations fail. - Q: Why does a driver send `{ readConcern: { level: "local" } }` to the server when that is the server's default? First, to mirror how `WriteConcern` already works, `ReadConcern() does not equal ReadConcern(level=local)` in the same way that `WriteConcern() does not equal WriteConcern(w=1)`. This is true for `WriteConcern` because the server's default could be @@ -553,6 +523,8 @@ instance, we send it. ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2026-05-04: Describe how `readConcern.afterClusterTime` is used in causally-consistent sessions on reads and writes. - 2025-02-25: Rename WriteConcernFailed to WriteConcernTimeout diff --git a/source/retryable-reads/retryable-reads.md b/source/retryable-reads/retryable-reads.md index dea35ef01f..d2f8d30660 100644 --- a/source/retryable-reads/retryable-reads.md +++ b/source/retryable-reads/retryable-reads.md @@ -272,13 +272,6 @@ and reflects the flow described above. > the [Backpressure Specification](../client-backpressure/client-backpressure.md). ```typescript -/** - * Checks if a connection supports retryable reads. - */ -function isRetryableReadsSupported(connection) { - return connection.MaxWireVersion >= RETRYABLE_READS_MIN_WIRE_VERSION); -} - /** * Executes a read command in the context of a MongoClient where a retryable * read have been enabled. The session parameter may be an implicit or @@ -336,20 +329,10 @@ function executeRetryableRead(command, session) { continue; } - if ( !isRetryableReadsSupported(connection) || session.inTransaction()) { - /* If this is the first loop iteration and we determine that retryable - * reads are not supported, execute the command once and allow any - * errors to propagate */ - - if (previousError == null) { - return executeCommand(connection, command); - } - - /* If the server selected for retrying is too old, throw the previous error. - * The caller can then infer that an attempt was made and failed. This case - * is very rare, and likely means that the cluster is in the midst of a - * downgrade. */ - throw previousError; + if (session.inTransaction()) { + /* Retryable reads are disabled within a transaction; execute the command + * once and allow any errors to propagate */ + return executeCommand(connection, command); } /* NetworkException and NotWritablePrimaryException are both retryable errors. If diff --git a/source/retryable-writes/retryable-writes.md b/source/retryable-writes/retryable-writes.md index 8d8f9f9748..919218e4a8 100644 --- a/source/retryable-writes/retryable-writes.md +++ b/source/retryable-writes/retryable-writes.md @@ -91,12 +91,6 @@ If the server selected for the first attempt of a retryable write operation does 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. -In a sharded cluster, it is possible that mongos may appear to support retryable writes but one or more shards in the -cluster do not (e.g. replica set shard is configured with feature compatibility version 3.4, a standalone is added as a -new shard). In these rare cases, a write command that fans out to a shard that does not support retryable writes may -partially fail and an error may be reported in the write result from mongos (e.g. `writeErrors` array in the bulk write -result). This does not constitute a retryable write error. Drivers MUST relay such errors to the user. - #### Supported Write Operations MongoDB supports retryability for some, but not all, write operations. @@ -148,14 +142,14 @@ commands if they fail to return a response. 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 `commitTransaction` and `abortTransaction`), even when `retryWrites` has been set -to true on the `MongoClient`. +command within a transaction (excepting `commitTransaction` and `abortTransaction`), even when `retryWrites` has been +set to true on the `MongoClient`. ### Implementing Retryable Writes #### Determining Retryable Write Errors -The driver MUST treat all errors with the RetryableWriteError label as retryable. This error label can be found in the +The driver MUST treat all errors with the RetryableWriteError label as retryable. This error label can be found in the top-level "errorLabels" field of the error. ##### RetryableWriteError Labels @@ -352,10 +346,6 @@ The above rules are implemented in the following pseudo-code: * Checks if a server supports retryable writes. */ function isRetryableWritesSupported(server) { - if (server.getMaxWireVersion() < RETRYABLE_WIRE_VERSION) { - return false; - } - if ( ! server.hasLogicalSessionTimeoutMinutes()) { return false; } 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 f5a06e3550..c41004b0b9 100644 --- a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md +++ b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md @@ -256,7 +256,7 @@ Fields: - (=) `setName`: string or null. Default null. -- (=) `electionId`: an ObjectId, if this is a MongoDB 2.6+ replica set member that believes it is primary. See +- (=) `electionId`: an ObjectId, if this is a replica set member that believes it is primary. See [using electionId and setVersion to detect stale primaries](#using-electionid-and-setversion-to-detect-stale-primaries). Default null. @@ -504,9 +504,9 @@ to another (e.g. from RSPrimary to RSSecondary) its RTT is updated normally, not #### lastWriteDate and opTime -The hello or legacy hello response of a replica set member running MongoDB 3.4 and later contains a `lastWrite` -subdocument with fields `lastWriteDate` and `opTime` ([SERVER-8858](https://jira.mongodb.org/browse/SERVER-8858)). If -these fields are available, parse them from the hello or legacy hello response, otherwise set them to null. +The hello or legacy hello response of a replica set member contains a `lastWrite` subdocument with fields +`lastWriteDate` and `opTime` ([SERVER-8858](https://jira.mongodb.org/browse/SERVER-8858)). If these fields are +available, parse them from the hello or legacy hello response, otherwise set them to null. Clients MUST NOT attempt to compensate for the network latency between when the server generated its hello or legacy hello response and when the client records `lastUpdateTime`. @@ -529,9 +529,9 @@ the replica set. #### logicalSessionTimeoutMinutes -MongoDB 3.6 and later include a `logicalSessionTimeoutMinutes` field if logical sessions are enabled in the deployment. -Clients MUST check for this field and set the ServerDescription's logicalSessionTimeoutMinutes field to this value, or -to null otherwise. +The hello or legacy hello response includes a `logicalSessionTimeoutMinutes` field if logical sessions are enabled in +the deployment. Clients MUST check for this field and set the ServerDescription's logicalSessionTimeoutMinutes field to +this value, or to null otherwise. #### topologyVersion @@ -624,10 +624,10 @@ fill out the TopologyDescription's "compatibilityError" field like so: "Server at `host`:`port` reports wire version `maxWireVersion`, but this version of `driverName` requires at least `clientMinWireVersion` (MongoDB `mongoVersion`)." -Replace `mongoVersion` with the appropriate MongoDB minor version, for example if `clientMinWireVersion` is 2 and it -connects to MongoDB 2.4, format the error like: +Replace `mongoVersion` with the appropriate MongoDB minor version, for example if `clientMinWireVersion` is 8 and it +connects to MongoDB 4.0, format the error like: -> "Server at example.com:27017 reports wire version 0, but this version of My Driver requires at least 2 (MongoDB 2.6)." +> "Server at example.com:27017 reports wire version 7, but this version of My Driver requires at least 8 (MongoDB 4.2)." In this second case, the exact required MongoDB version is known and can be named in the error message, whereas in the first case the implementer does not know which MongoDB versions will be compatible or incompatible in the future. @@ -1311,14 +1311,13 @@ It is tempting to take these values from the last hello or legacy hello response the ServerDescription, but this is an anti-pattern. Multi-threaded and asynchronous clients that do so are prone to several classes of race, for example: -- Setup: A MongoDB 3.0 Standalone with authentication enabled, the client must log in with SCRAM-SHA-1. -- The monitor thread discovers the server and stores maxWireVersion on the ServerDescription -- An application thread wants a socket, selects the Standalone, and is about to check the maxWireVersion on its +- Setup: A Standalone server. +- The monitor thread discovers the server and stores maxWireVersion, maxWriteBatchSize, etc. on the ServerDescription. +- An application thread wants a socket, selects the Standalone, and is about to read maxWriteBatchSize from its ServerDescription when... -- The monitor thread gets disconnected from server and marks it Unknown, with default maxWireVersion of 0. -- The application thread resumes, creates a socket, and attempts to log in using MONGODB-CR, since maxWireVersion is - *now* reported as 0. -- Authentication fails, the server requires SCRAM-SHA-1. +- The monitor thread gets disconnected from the server and marks it Unknown, resetting these fields to their defaults. +- The application thread resumes, creates a socket, and splits a bulk write based on the now-default maxWriteBatchSize, + sending a batch the server rejects. Better to call hello or legacy hello for each new socket, as required by the [Auth Spec](../auth/auth.md), and use the hello or legacy hello response associated with that socket for maxWireVersion, maxBsonObjectSize, etc.: all the fields diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index 65c829f42d..8446f0701b 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -3170,10 +3170,10 @@ This section describes some procedures that may be referenced from earlier secti ##### Terminating Open Transactions -Open transactions can cause tests to block indiscriminately. When connected to MongoDB 3.6 or later, test runners SHOULD -terminate all open transactions at the start of a test suite and after each failed test by killing all sessions in the -cluster. Using the internal MongoClient(s), execute the `killAllSessions` command on either the primary or, if connected -to a sharded cluster, each mongos server. +Open transactions can cause tests to block indiscriminately. Test runners SHOULD terminate all open transactions at the +start of a test suite and after each failed test by killing all sessions in the cluster. Using the internal +MongoClient(s), execute the `killAllSessions` command on either the primary or, if connected to a sharded cluster, each +mongos server. For example: @@ -3380,7 +3380,7 @@ Each shard in the cluster is represented by a document in this collection. If th the `host` field will contain a single host. If the shard is backed by a replica set, the `host` field contain the name of the replica followed by a forward slash and a comma-delimited list of hosts. -Note: MongoDB 3.6+ requires that all shard servers be replica sets. +Note: All shard servers are replica sets. ## Design Rationale @@ -3459,6 +3459,8 @@ other specs *and* collating spec changes developed in parallel or during the sam ## Changelog +- 2026-06-17: Remove pre-4.2 version references. + - 2026-03-17: **Schema version 1.28.** Add `accessToken` to `kmsProviders` (Azure and GCP). Replace unnecessary `anyOf` with `oneOf` for `csfle`. From cc1112e64f5cfe91d467f62fb699ec7aeb9c1b42 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Mon, 29 Jun 2026 14:44:58 -0400 Subject: [PATCH 7/9] DRIVERS-3439 remove more pre-4.2 references found in review --- .../find_getmore_killcursors_commands.md | 25 ++++++------------- .../server-discovery-and-monitoring.md | 11 ++------ .../unified-test-format.md | 1 - 3 files changed, 10 insertions(+), 27 deletions(-) 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 9cdb8f79db..9463e8ad7f 100644 --- a/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md +++ b/source/find_getmore_killcursors_commands/find_getmore_killcursors_commands.md @@ -27,8 +27,7 @@ A BSON document containing the fields making up a MongoDB server command. #### Wire Protocol -The binary protocol used to talk with MongoDB over a socket. It's made up by the OP_QUERY, OP_GET_MORE, OP_KILL_CURSORS, -OP_INSERT, OP_UPDATE and OP_DELETE. +The binary protocol used to talk with MongoDB over a socket. ## Guidance @@ -49,8 +48,7 @@ Drivers: ### find The [find](https://www.mongodb.com/docs/manual/reference/command/find/) command replaces the query functionality of the -OP_QUERY wire protocol message but cannot execute queries against special collections. Unlike the legacy OP_QUERY wire -protocol message, the **find** command cannot be used to execute other commands. +OP_QUERY wire protocol message but cannot execute queries against special collections. For a successful command, the document returned from the server has the following format: @@ -180,16 +178,15 @@ Further, after these transformation: #### BatchSize of 1 -In 3.2 a batchSize of 1 means return a single document for the find command and it will not destroy the cursor after the -first batch of documents are returned. Given a query returning 4 documents the number of commands issues will be. +A batchSize of 1 means return a single document for the find command and it will not destroy the cursor after the first +batch of documents are returned. Given a query returning 4 documents the number of commands issues will be. 1. **find** command with batchSize=1 2. **getMore** command with batchSize=1 3. **getMore** command with batchSize=1 4. **getMore** command with batchSize=1 -The driver **SHOULD NOT attempt to emulate the behavior seen in 3.0 or earlier** as the new find command enables the -user expected behavior of allowing the first result to contain a single document when specifying batchSize=1. +The `find` command allows the first result to contain a single document when specifying batchSize=1. #### Tailable cursors @@ -242,8 +239,7 @@ to the value of the option **maxAwaitTimeMS**. If no **maxAwaitTimeMS** is speci ### getMore The [getMore](https://www.mongodb.com/docs/manual/reference/command/getMore/) command replaces the **OP_GET_MORE** wire -protocol message. The query flags passed to OP_QUERY for a getMore command MUST be secondaryOk=true when sent to a -secondary. The OP_QUERY namespace MUST be the same as for the **find** and **killCursors** commands. +protocol message. The OP_MSG namespace MUST be the same as for the **find** and **killCursors** commands. ```typescript interface GetMoreCommand { @@ -296,8 +292,8 @@ The driver's local cursor MUST update its `id` and `ns`, as well as store the `n ### killCursors The [killCursors](https://www.mongodb.com/docs/manual/reference/command/killCursors/) command replaces the -**OP_KILL_CURSORS** wire protocol message. The OP_QUERY namespace MUST be the same as for the **find** and **getMore** -commands. The **killCursors** command is optional to implement in **MongoDB 3.2**. +**OP_KILL_CURSORS** wire protocol message. The OP_MSG namespace MUST be the same as for the **find** and **getMore** +commands. The command response will be as follows: @@ -407,11 +403,6 @@ Like other commands, the find and getMore commands will not use the OP_REPLY res ## FAQ -### Changes in error handling for 3.2 tailable cursor - -Tailable cursors pointing to documents in a capped collection that get overwritten will return a zero document result in -MongoDB 3.0 or earlier but will return an error in MongoDB 3.2 - ### Explain command There is no equivalent of the `$explain` modifier in the find command. The driver SHOULD use the **explain** command. 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 c41004b0b9..73fd7999db 100644 --- a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md +++ b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md @@ -1582,15 +1582,8 @@ drivers continue to maintain the reversed logic when connected to a topology tha #### Requirements for read-your-writes consistency -Using (electionId, setVersion) only provides read-your-writes consistency if: - -- The application uses the same MongoClient instance for write-concern "majority" writes and read-preference "primary" - reads, and -- All members use MongoDB 2.6.10+, 3.0.0+ or 3.2.0+ with replication protocol 0 and clocks are *less* than 30 seconds - skewed, or -- All members run MongoDB 3.2.0 and replication protocol 1 and clocks are *less* skewed than the election timeout - (`electionTimeoutMillis`, which defaults to 10 seconds), or -- All members run MongoDB 3.2.1+ and replication protocol 1 (in which case clocks need not be synchronized). +Using (electionId, setVersion) only provides read-your-writes consistency if the application uses the same MongoClient +instance for write-concern "majority" writes and read-preference "primary" reads. #### Scenario diff --git a/source/unified-test-format/unified-test-format.md b/source/unified-test-format/unified-test-format.md index 8446f0701b..a5639c5717 100644 --- a/source/unified-test-format/unified-test-format.md +++ b/source/unified-test-format/unified-test-format.md @@ -3187,7 +3187,6 @@ The test runner MAY ignore the following command failures: - Interrupted(11601) to work around [SERVER-38335](https://jira.mongodb.org/browse/SERVER-38335). - Unauthorized(13) to work around [SERVER-54216](https://jira.mongodb.org/browse/SERVER-54216). -- CommandNotFound(59) if the command is executed on a pre-3.6 server Note that Atlas, by design, does not allow database users to kill sessions belonging to other users. This makes it impossible to guarantee that an existing transaction will not block test execution. To work around this, test runners From 3fa14b7ae9bbc7f3d735d07182805a8f3a544a9f Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Tue, 30 Jun 2026 11:50:43 -0400 Subject: [PATCH 8/9] DRIVERS-3439 remove more pre-4.2 references found in review --- .../client-side-operations-timeout.md | 2 +- .../server-discovery-and-monitoring.md | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/source/client-side-operations-timeout/client-side-operations-timeout.md b/source/client-side-operations-timeout/client-side-operations-timeout.md index 318b33d9e1..127788877a 100644 --- a/source/client-side-operations-timeout/client-side-operations-timeout.md +++ b/source/client-side-operations-timeout/client-side-operations-timeout.md @@ -536,7 +536,7 @@ rather than adding complexity to the behavior of `timeoutMS`. The behavior of runCommand varies across drivers. If the provided command document includes a `maxTimeMS` field and the `timeoutMS` option is set, some drivers would overwrite the `maxTimeMS` field with the value derived from `timeoutMS`, -while others would append a second `maxTimeMS` field, which would cause a server error on versions 3.4+. To be +while others would append a second `maxTimeMS` field, which would cause a server error. To be prescriptive, we could mandate that drivers raise a client-side error in this case, but this would require a potentially expensive lookup in the command document. To avoid this additional cost, drivers are only required to document the behavior and suggest that `timeoutMS` be used instead of including a manual `maxTimeMS` field. 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 73fd7999db..05d1264a39 100644 --- a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md +++ b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md @@ -468,9 +468,6 @@ transition to a more useful state. For simplicity, this is the rule: any server is an RSGhost that reports "isreplicaset: true". -Non-ghost replica set members have reported their setNames since MongoDB 1.6.2. See -[only support replica set members running MongoDB 1.6.2 or later](#only-support-replica-set-members-running-mongodb-162-or-later). - > [!NOTE] > The Java driver does not have a separate state for RSGhost; it is an RSOther server with no hosts list. @@ -1498,9 +1495,6 @@ This spec does not intend to introduce any new configuration options unless abso Mongos 2.6 does not monitor arbiters, but it costs little to do so, and in the rare case that all data members are moved to new hosts in a short time, an arbiter may be the client's last hope to find the new replica set configuration. -### Only support replica set members running MongoDB 1.6.2 or later - -Replica set members began reporting their setNames in that version. Supporting earlier versions is impractical. ### TopologyType remains Unknown when an RSGhost is discovered From 47efcb4ce7a2d2be5cf8dd7440ebe00590b21578 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Tue, 30 Jun 2026 20:32:18 -0400 Subject: [PATCH 9/9] mdformat --- .../client-side-operations-timeout.md | 8 ++++---- .../server-discovery-and-monitoring.md | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/client-side-operations-timeout/client-side-operations-timeout.md b/source/client-side-operations-timeout/client-side-operations-timeout.md index 127788877a..37b582e304 100644 --- a/source/client-side-operations-timeout/client-side-operations-timeout.md +++ b/source/client-side-operations-timeout/client-side-operations-timeout.md @@ -536,10 +536,10 @@ rather than adding complexity to the behavior of `timeoutMS`. The behavior of runCommand varies across drivers. If the provided command document includes a `maxTimeMS` field and the `timeoutMS` option is set, some drivers would overwrite the `maxTimeMS` field with the value derived from `timeoutMS`, -while others would append a second `maxTimeMS` field, which would cause a server error. To be -prescriptive, we could mandate that drivers raise a client-side error in this case, but this would require a potentially -expensive lookup in the command document. To avoid this additional cost, drivers are only required to document the -behavior and suggest that `timeoutMS` be used instead of including a manual `maxTimeMS` field. +while others would append a second `maxTimeMS` field, which would cause a server error. To be prescriptive, we could +mandate that drivers raise a client-side error in this case, but this would require a potentially expensive lookup in +the command document. To avoid this additional cost, drivers are only required to document the behavior and suggest that +`timeoutMS` be used instead of including a manual `maxTimeMS` field. ### Why don't drivers use backoff/jitter between retry attempts? 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 05d1264a39..1ffd5d64df 100644 --- a/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md +++ b/source/server-discovery-and-monitoring/server-discovery-and-monitoring.md @@ -1495,7 +1495,6 @@ This spec does not intend to introduce any new configuration options unless abso Mongos 2.6 does not monitor arbiters, but it costs little to do so, and in the rare case that all data members are moved to new hosts in a short time, an arbiter may be the client's last hope to find the new replica set configuration. - ### TopologyType remains Unknown when an RSGhost is discovered If the TopologyType is Unknown and the client receives a hello or legacy hello response from