From cb31801dbe2b5956d21fc203e6a7150bfc187288 Mon Sep 17 00:00:00 2001 From: Matt Dale <9760375+matthewdale@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:18:55 -0800 Subject: [PATCH] GODRIVER-3030 Retry ReadConcernMajorityNotAvailableYet errors. --- .../integration/unified/unified_spec_test.go | 1 + internal/integration/unified_spec_test.go | 2 +- .../{ => legacy}/aggregate-merge.json | 0 .../{ => legacy}/aggregate-merge.yml | 0 .../{ => legacy}/aggregate-serverErrors.json | 0 .../{ => legacy}/aggregate-serverErrors.yml | 0 .../{ => legacy}/aggregate.json | 0 .../{ => legacy}/aggregate.yml | 0 ...angeStreams-client.watch-serverErrors.json | 0 ...hangeStreams-client.watch-serverErrors.yml | 0 .../changeStreams-client.watch.json | 0 .../changeStreams-client.watch.yml | 0 ...ngeStreams-db.coll.watch-serverErrors.json | 0 ...angeStreams-db.coll.watch-serverErrors.yml | 0 .../changeStreams-db.coll.watch.json | 0 .../changeStreams-db.coll.watch.yml | 0 .../changeStreams-db.watch-serverErrors.json | 0 .../changeStreams-db.watch-serverErrors.yml | 0 .../{ => legacy}/changeStreams-db.watch.json | 0 .../{ => legacy}/changeStreams-db.watch.yml | 0 .../{ => legacy}/count-serverErrors.json | 0 .../{ => legacy}/count-serverErrors.yml | 0 .../retryable-reads/{ => legacy}/count.json | 0 .../retryable-reads/{ => legacy}/count.yml | 0 .../countDocuments-serverErrors.json | 0 .../countDocuments-serverErrors.yml | 0 .../{ => legacy}/countDocuments.json | 0 .../{ => legacy}/countDocuments.yml | 0 .../{ => legacy}/distinct-serverErrors.json | 0 .../{ => legacy}/distinct-serverErrors.yml | 0 .../{ => legacy}/distinct.json | 0 .../retryable-reads/{ => legacy}/distinct.yml | 0 .../estimatedDocumentCount-serverErrors.json | 0 .../estimatedDocumentCount-serverErrors.yml | 0 .../{ => legacy}/estimatedDocumentCount.json | 0 .../{ => legacy}/estimatedDocumentCount.yml | 0 .../{ => legacy}/find-serverErrors.json | 0 .../{ => legacy}/find-serverErrors.yml | 0 .../retryable-reads/{ => legacy}/find.json | 0 .../retryable-reads/{ => legacy}/find.yml | 0 .../{ => legacy}/findOne-serverErrors.json | 0 .../{ => legacy}/findOne-serverErrors.yml | 0 .../retryable-reads/{ => legacy}/findOne.json | 0 .../retryable-reads/{ => legacy}/findOne.yml | 0 .../gridfs-download-serverErrors.json | 0 .../gridfs-download-serverErrors.yml | 0 .../{ => legacy}/gridfs-download.json | 0 .../{ => legacy}/gridfs-download.yml | 0 .../gridfs-downloadByName-serverErrors.json | 0 .../gridfs-downloadByName-serverErrors.yml | 0 .../{ => legacy}/gridfs-downloadByName.json | 0 .../{ => legacy}/gridfs-downloadByName.yml | 0 .../listCollectionNames-serverErrors.json | 0 .../listCollectionNames-serverErrors.yml | 0 .../{ => legacy}/listCollectionNames.json | 0 .../{ => legacy}/listCollectionNames.yml | 0 .../listCollectionObjects-serverErrors.json | 0 .../listCollectionObjects-serverErrors.yml | 0 .../{ => legacy}/listCollectionObjects.json | 0 .../{ => legacy}/listCollectionObjects.yml | 0 .../listCollections-serverErrors.json | 0 .../listCollections-serverErrors.yml | 0 .../{ => legacy}/listCollections.json | 0 .../{ => legacy}/listCollections.yml | 0 .../listDatabaseNames-serverErrors.json | 0 .../listDatabaseNames-serverErrors.yml | 0 .../{ => legacy}/listDatabaseNames.json | 0 .../{ => legacy}/listDatabaseNames.yml | 0 .../listDatabaseObjects-serverErrors.json | 0 .../listDatabaseObjects-serverErrors.yml | 0 .../{ => legacy}/listDatabaseObjects.json | 0 .../{ => legacy}/listDatabaseObjects.yml | 0 .../listDatabases-serverErrors.json | 0 .../listDatabases-serverErrors.yml | 0 .../{ => legacy}/listDatabases.json | 0 .../{ => legacy}/listDatabases.yml | 0 .../listIndexNames-serverErrors.json | 0 .../listIndexNames-serverErrors.yml | 0 .../{ => legacy}/listIndexNames.json | 0 .../{ => legacy}/listIndexNames.yml | 0 .../listIndexes-serverErrors.json | 0 .../{ => legacy}/listIndexes-serverErrors.yml | 0 .../{ => legacy}/listIndexes.json | 0 .../{ => legacy}/listIndexes.yml | 0 .../{ => legacy}/mapReduce.json | 0 .../{ => legacy}/mapReduce.yml | 0 .../unified/exceededTimeLimit.json | 147 + .../unified/exceededTimeLimit.yml | 68 + .../unified/handshakeError.json | 3079 +++++++++++++++++ .../unified/handshakeError.yml | 1342 +++++++ .../readConcernMajorityNotAvailableYet.json | 147 + .../readConcernMajorityNotAvailableYet.yml | 68 + x/mongo/driver/errors.go | 17 +- 93 files changed, 4869 insertions(+), 2 deletions(-) rename testdata/retryable-reads/{ => legacy}/aggregate-merge.json (100%) rename testdata/retryable-reads/{ => legacy}/aggregate-merge.yml (100%) rename testdata/retryable-reads/{ => legacy}/aggregate-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/aggregate-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/aggregate.json (100%) rename testdata/retryable-reads/{ => legacy}/aggregate.yml (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-client.watch-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-client.watch-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-client.watch.json (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-client.watch.yml (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-db.coll.watch-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-db.coll.watch-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-db.coll.watch.json (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-db.coll.watch.yml (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-db.watch-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-db.watch-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-db.watch.json (100%) rename testdata/retryable-reads/{ => legacy}/changeStreams-db.watch.yml (100%) rename testdata/retryable-reads/{ => legacy}/count-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/count-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/count.json (100%) rename testdata/retryable-reads/{ => legacy}/count.yml (100%) rename testdata/retryable-reads/{ => legacy}/countDocuments-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/countDocuments-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/countDocuments.json (100%) rename testdata/retryable-reads/{ => legacy}/countDocuments.yml (100%) rename testdata/retryable-reads/{ => legacy}/distinct-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/distinct-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/distinct.json (100%) rename testdata/retryable-reads/{ => legacy}/distinct.yml (100%) rename testdata/retryable-reads/{ => legacy}/estimatedDocumentCount-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/estimatedDocumentCount-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/estimatedDocumentCount.json (100%) rename testdata/retryable-reads/{ => legacy}/estimatedDocumentCount.yml (100%) rename testdata/retryable-reads/{ => legacy}/find-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/find-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/find.json (100%) rename testdata/retryable-reads/{ => legacy}/find.yml (100%) rename testdata/retryable-reads/{ => legacy}/findOne-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/findOne-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/findOne.json (100%) rename testdata/retryable-reads/{ => legacy}/findOne.yml (100%) rename testdata/retryable-reads/{ => legacy}/gridfs-download-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/gridfs-download-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/gridfs-download.json (100%) rename testdata/retryable-reads/{ => legacy}/gridfs-download.yml (100%) rename testdata/retryable-reads/{ => legacy}/gridfs-downloadByName-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/gridfs-downloadByName-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/gridfs-downloadByName.json (100%) rename testdata/retryable-reads/{ => legacy}/gridfs-downloadByName.yml (100%) rename testdata/retryable-reads/{ => legacy}/listCollectionNames-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/listCollectionNames-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/listCollectionNames.json (100%) rename testdata/retryable-reads/{ => legacy}/listCollectionNames.yml (100%) rename testdata/retryable-reads/{ => legacy}/listCollectionObjects-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/listCollectionObjects-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/listCollectionObjects.json (100%) rename testdata/retryable-reads/{ => legacy}/listCollectionObjects.yml (100%) rename testdata/retryable-reads/{ => legacy}/listCollections-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/listCollections-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/listCollections.json (100%) rename testdata/retryable-reads/{ => legacy}/listCollections.yml (100%) rename testdata/retryable-reads/{ => legacy}/listDatabaseNames-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/listDatabaseNames-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/listDatabaseNames.json (100%) rename testdata/retryable-reads/{ => legacy}/listDatabaseNames.yml (100%) rename testdata/retryable-reads/{ => legacy}/listDatabaseObjects-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/listDatabaseObjects-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/listDatabaseObjects.json (100%) rename testdata/retryable-reads/{ => legacy}/listDatabaseObjects.yml (100%) rename testdata/retryable-reads/{ => legacy}/listDatabases-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/listDatabases-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/listDatabases.json (100%) rename testdata/retryable-reads/{ => legacy}/listDatabases.yml (100%) rename testdata/retryable-reads/{ => legacy}/listIndexNames-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/listIndexNames-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/listIndexNames.json (100%) rename testdata/retryable-reads/{ => legacy}/listIndexNames.yml (100%) rename testdata/retryable-reads/{ => legacy}/listIndexes-serverErrors.json (100%) rename testdata/retryable-reads/{ => legacy}/listIndexes-serverErrors.yml (100%) rename testdata/retryable-reads/{ => legacy}/listIndexes.json (100%) rename testdata/retryable-reads/{ => legacy}/listIndexes.yml (100%) rename testdata/retryable-reads/{ => legacy}/mapReduce.json (100%) rename testdata/retryable-reads/{ => legacy}/mapReduce.yml (100%) create mode 100644 testdata/retryable-reads/unified/exceededTimeLimit.json create mode 100644 testdata/retryable-reads/unified/exceededTimeLimit.yml create mode 100644 testdata/retryable-reads/unified/handshakeError.json create mode 100644 testdata/retryable-reads/unified/handshakeError.yml create mode 100644 testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.json create mode 100644 testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.yml diff --git a/internal/integration/unified/unified_spec_test.go b/internal/integration/unified/unified_spec_test.go index 8871a48127..eba98345f4 100644 --- a/internal/integration/unified/unified_spec_test.go +++ b/internal/integration/unified/unified_spec_test.go @@ -25,6 +25,7 @@ var ( "command-monitoring/logging", "connection-monitoring-and-pooling/logging", "sessions", + "retryable-reads/unified", "retryable-writes/unified", "client-side-encryption/unified", "client-side-operations-timeout", diff --git a/internal/integration/unified_spec_test.go b/internal/integration/unified_spec_test.go index 6b37dc254c..0a69e4300b 100644 --- a/internal/integration/unified_spec_test.go +++ b/internal/integration/unified_spec_test.go @@ -178,7 +178,7 @@ const dataPath string = "../../testdata/" var directories = []string{ "transactions/legacy", "convenient-transactions", - "retryable-reads", + "retryable-reads/legacy", "read-write-concern/operation", "server-discovery-and-monitoring/integration", "atlas-data-lake-testing", diff --git a/testdata/retryable-reads/aggregate-merge.json b/testdata/retryable-reads/legacy/aggregate-merge.json similarity index 100% rename from testdata/retryable-reads/aggregate-merge.json rename to testdata/retryable-reads/legacy/aggregate-merge.json diff --git a/testdata/retryable-reads/aggregate-merge.yml b/testdata/retryable-reads/legacy/aggregate-merge.yml similarity index 100% rename from testdata/retryable-reads/aggregate-merge.yml rename to testdata/retryable-reads/legacy/aggregate-merge.yml diff --git a/testdata/retryable-reads/aggregate-serverErrors.json b/testdata/retryable-reads/legacy/aggregate-serverErrors.json similarity index 100% rename from testdata/retryable-reads/aggregate-serverErrors.json rename to testdata/retryable-reads/legacy/aggregate-serverErrors.json diff --git a/testdata/retryable-reads/aggregate-serverErrors.yml b/testdata/retryable-reads/legacy/aggregate-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/aggregate-serverErrors.yml rename to testdata/retryable-reads/legacy/aggregate-serverErrors.yml diff --git a/testdata/retryable-reads/aggregate.json b/testdata/retryable-reads/legacy/aggregate.json similarity index 100% rename from testdata/retryable-reads/aggregate.json rename to testdata/retryable-reads/legacy/aggregate.json diff --git a/testdata/retryable-reads/aggregate.yml b/testdata/retryable-reads/legacy/aggregate.yml similarity index 100% rename from testdata/retryable-reads/aggregate.yml rename to testdata/retryable-reads/legacy/aggregate.yml diff --git a/testdata/retryable-reads/changeStreams-client.watch-serverErrors.json b/testdata/retryable-reads/legacy/changeStreams-client.watch-serverErrors.json similarity index 100% rename from testdata/retryable-reads/changeStreams-client.watch-serverErrors.json rename to testdata/retryable-reads/legacy/changeStreams-client.watch-serverErrors.json diff --git a/testdata/retryable-reads/changeStreams-client.watch-serverErrors.yml b/testdata/retryable-reads/legacy/changeStreams-client.watch-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/changeStreams-client.watch-serverErrors.yml rename to testdata/retryable-reads/legacy/changeStreams-client.watch-serverErrors.yml diff --git a/testdata/retryable-reads/changeStreams-client.watch.json b/testdata/retryable-reads/legacy/changeStreams-client.watch.json similarity index 100% rename from testdata/retryable-reads/changeStreams-client.watch.json rename to testdata/retryable-reads/legacy/changeStreams-client.watch.json diff --git a/testdata/retryable-reads/changeStreams-client.watch.yml b/testdata/retryable-reads/legacy/changeStreams-client.watch.yml similarity index 100% rename from testdata/retryable-reads/changeStreams-client.watch.yml rename to testdata/retryable-reads/legacy/changeStreams-client.watch.yml diff --git a/testdata/retryable-reads/changeStreams-db.coll.watch-serverErrors.json b/testdata/retryable-reads/legacy/changeStreams-db.coll.watch-serverErrors.json similarity index 100% rename from testdata/retryable-reads/changeStreams-db.coll.watch-serverErrors.json rename to testdata/retryable-reads/legacy/changeStreams-db.coll.watch-serverErrors.json diff --git a/testdata/retryable-reads/changeStreams-db.coll.watch-serverErrors.yml b/testdata/retryable-reads/legacy/changeStreams-db.coll.watch-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/changeStreams-db.coll.watch-serverErrors.yml rename to testdata/retryable-reads/legacy/changeStreams-db.coll.watch-serverErrors.yml diff --git a/testdata/retryable-reads/changeStreams-db.coll.watch.json b/testdata/retryable-reads/legacy/changeStreams-db.coll.watch.json similarity index 100% rename from testdata/retryable-reads/changeStreams-db.coll.watch.json rename to testdata/retryable-reads/legacy/changeStreams-db.coll.watch.json diff --git a/testdata/retryable-reads/changeStreams-db.coll.watch.yml b/testdata/retryable-reads/legacy/changeStreams-db.coll.watch.yml similarity index 100% rename from testdata/retryable-reads/changeStreams-db.coll.watch.yml rename to testdata/retryable-reads/legacy/changeStreams-db.coll.watch.yml diff --git a/testdata/retryable-reads/changeStreams-db.watch-serverErrors.json b/testdata/retryable-reads/legacy/changeStreams-db.watch-serverErrors.json similarity index 100% rename from testdata/retryable-reads/changeStreams-db.watch-serverErrors.json rename to testdata/retryable-reads/legacy/changeStreams-db.watch-serverErrors.json diff --git a/testdata/retryable-reads/changeStreams-db.watch-serverErrors.yml b/testdata/retryable-reads/legacy/changeStreams-db.watch-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/changeStreams-db.watch-serverErrors.yml rename to testdata/retryable-reads/legacy/changeStreams-db.watch-serverErrors.yml diff --git a/testdata/retryable-reads/changeStreams-db.watch.json b/testdata/retryable-reads/legacy/changeStreams-db.watch.json similarity index 100% rename from testdata/retryable-reads/changeStreams-db.watch.json rename to testdata/retryable-reads/legacy/changeStreams-db.watch.json diff --git a/testdata/retryable-reads/changeStreams-db.watch.yml b/testdata/retryable-reads/legacy/changeStreams-db.watch.yml similarity index 100% rename from testdata/retryable-reads/changeStreams-db.watch.yml rename to testdata/retryable-reads/legacy/changeStreams-db.watch.yml diff --git a/testdata/retryable-reads/count-serverErrors.json b/testdata/retryable-reads/legacy/count-serverErrors.json similarity index 100% rename from testdata/retryable-reads/count-serverErrors.json rename to testdata/retryable-reads/legacy/count-serverErrors.json diff --git a/testdata/retryable-reads/count-serverErrors.yml b/testdata/retryable-reads/legacy/count-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/count-serverErrors.yml rename to testdata/retryable-reads/legacy/count-serverErrors.yml diff --git a/testdata/retryable-reads/count.json b/testdata/retryable-reads/legacy/count.json similarity index 100% rename from testdata/retryable-reads/count.json rename to testdata/retryable-reads/legacy/count.json diff --git a/testdata/retryable-reads/count.yml b/testdata/retryable-reads/legacy/count.yml similarity index 100% rename from testdata/retryable-reads/count.yml rename to testdata/retryable-reads/legacy/count.yml diff --git a/testdata/retryable-reads/countDocuments-serverErrors.json b/testdata/retryable-reads/legacy/countDocuments-serverErrors.json similarity index 100% rename from testdata/retryable-reads/countDocuments-serverErrors.json rename to testdata/retryable-reads/legacy/countDocuments-serverErrors.json diff --git a/testdata/retryable-reads/countDocuments-serverErrors.yml b/testdata/retryable-reads/legacy/countDocuments-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/countDocuments-serverErrors.yml rename to testdata/retryable-reads/legacy/countDocuments-serverErrors.yml diff --git a/testdata/retryable-reads/countDocuments.json b/testdata/retryable-reads/legacy/countDocuments.json similarity index 100% rename from testdata/retryable-reads/countDocuments.json rename to testdata/retryable-reads/legacy/countDocuments.json diff --git a/testdata/retryable-reads/countDocuments.yml b/testdata/retryable-reads/legacy/countDocuments.yml similarity index 100% rename from testdata/retryable-reads/countDocuments.yml rename to testdata/retryable-reads/legacy/countDocuments.yml diff --git a/testdata/retryable-reads/distinct-serverErrors.json b/testdata/retryable-reads/legacy/distinct-serverErrors.json similarity index 100% rename from testdata/retryable-reads/distinct-serverErrors.json rename to testdata/retryable-reads/legacy/distinct-serverErrors.json diff --git a/testdata/retryable-reads/distinct-serverErrors.yml b/testdata/retryable-reads/legacy/distinct-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/distinct-serverErrors.yml rename to testdata/retryable-reads/legacy/distinct-serverErrors.yml diff --git a/testdata/retryable-reads/distinct.json b/testdata/retryable-reads/legacy/distinct.json similarity index 100% rename from testdata/retryable-reads/distinct.json rename to testdata/retryable-reads/legacy/distinct.json diff --git a/testdata/retryable-reads/distinct.yml b/testdata/retryable-reads/legacy/distinct.yml similarity index 100% rename from testdata/retryable-reads/distinct.yml rename to testdata/retryable-reads/legacy/distinct.yml diff --git a/testdata/retryable-reads/estimatedDocumentCount-serverErrors.json b/testdata/retryable-reads/legacy/estimatedDocumentCount-serverErrors.json similarity index 100% rename from testdata/retryable-reads/estimatedDocumentCount-serverErrors.json rename to testdata/retryable-reads/legacy/estimatedDocumentCount-serverErrors.json diff --git a/testdata/retryable-reads/estimatedDocumentCount-serverErrors.yml b/testdata/retryable-reads/legacy/estimatedDocumentCount-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/estimatedDocumentCount-serverErrors.yml rename to testdata/retryable-reads/legacy/estimatedDocumentCount-serverErrors.yml diff --git a/testdata/retryable-reads/estimatedDocumentCount.json b/testdata/retryable-reads/legacy/estimatedDocumentCount.json similarity index 100% rename from testdata/retryable-reads/estimatedDocumentCount.json rename to testdata/retryable-reads/legacy/estimatedDocumentCount.json diff --git a/testdata/retryable-reads/estimatedDocumentCount.yml b/testdata/retryable-reads/legacy/estimatedDocumentCount.yml similarity index 100% rename from testdata/retryable-reads/estimatedDocumentCount.yml rename to testdata/retryable-reads/legacy/estimatedDocumentCount.yml diff --git a/testdata/retryable-reads/find-serverErrors.json b/testdata/retryable-reads/legacy/find-serverErrors.json similarity index 100% rename from testdata/retryable-reads/find-serverErrors.json rename to testdata/retryable-reads/legacy/find-serverErrors.json diff --git a/testdata/retryable-reads/find-serverErrors.yml b/testdata/retryable-reads/legacy/find-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/find-serverErrors.yml rename to testdata/retryable-reads/legacy/find-serverErrors.yml diff --git a/testdata/retryable-reads/find.json b/testdata/retryable-reads/legacy/find.json similarity index 100% rename from testdata/retryable-reads/find.json rename to testdata/retryable-reads/legacy/find.json diff --git a/testdata/retryable-reads/find.yml b/testdata/retryable-reads/legacy/find.yml similarity index 100% rename from testdata/retryable-reads/find.yml rename to testdata/retryable-reads/legacy/find.yml diff --git a/testdata/retryable-reads/findOne-serverErrors.json b/testdata/retryable-reads/legacy/findOne-serverErrors.json similarity index 100% rename from testdata/retryable-reads/findOne-serverErrors.json rename to testdata/retryable-reads/legacy/findOne-serverErrors.json diff --git a/testdata/retryable-reads/findOne-serverErrors.yml b/testdata/retryable-reads/legacy/findOne-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/findOne-serverErrors.yml rename to testdata/retryable-reads/legacy/findOne-serverErrors.yml diff --git a/testdata/retryable-reads/findOne.json b/testdata/retryable-reads/legacy/findOne.json similarity index 100% rename from testdata/retryable-reads/findOne.json rename to testdata/retryable-reads/legacy/findOne.json diff --git a/testdata/retryable-reads/findOne.yml b/testdata/retryable-reads/legacy/findOne.yml similarity index 100% rename from testdata/retryable-reads/findOne.yml rename to testdata/retryable-reads/legacy/findOne.yml diff --git a/testdata/retryable-reads/gridfs-download-serverErrors.json b/testdata/retryable-reads/legacy/gridfs-download-serverErrors.json similarity index 100% rename from testdata/retryable-reads/gridfs-download-serverErrors.json rename to testdata/retryable-reads/legacy/gridfs-download-serverErrors.json diff --git a/testdata/retryable-reads/gridfs-download-serverErrors.yml b/testdata/retryable-reads/legacy/gridfs-download-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/gridfs-download-serverErrors.yml rename to testdata/retryable-reads/legacy/gridfs-download-serverErrors.yml diff --git a/testdata/retryable-reads/gridfs-download.json b/testdata/retryable-reads/legacy/gridfs-download.json similarity index 100% rename from testdata/retryable-reads/gridfs-download.json rename to testdata/retryable-reads/legacy/gridfs-download.json diff --git a/testdata/retryable-reads/gridfs-download.yml b/testdata/retryable-reads/legacy/gridfs-download.yml similarity index 100% rename from testdata/retryable-reads/gridfs-download.yml rename to testdata/retryable-reads/legacy/gridfs-download.yml diff --git a/testdata/retryable-reads/gridfs-downloadByName-serverErrors.json b/testdata/retryable-reads/legacy/gridfs-downloadByName-serverErrors.json similarity index 100% rename from testdata/retryable-reads/gridfs-downloadByName-serverErrors.json rename to testdata/retryable-reads/legacy/gridfs-downloadByName-serverErrors.json diff --git a/testdata/retryable-reads/gridfs-downloadByName-serverErrors.yml b/testdata/retryable-reads/legacy/gridfs-downloadByName-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/gridfs-downloadByName-serverErrors.yml rename to testdata/retryable-reads/legacy/gridfs-downloadByName-serverErrors.yml diff --git a/testdata/retryable-reads/gridfs-downloadByName.json b/testdata/retryable-reads/legacy/gridfs-downloadByName.json similarity index 100% rename from testdata/retryable-reads/gridfs-downloadByName.json rename to testdata/retryable-reads/legacy/gridfs-downloadByName.json diff --git a/testdata/retryable-reads/gridfs-downloadByName.yml b/testdata/retryable-reads/legacy/gridfs-downloadByName.yml similarity index 100% rename from testdata/retryable-reads/gridfs-downloadByName.yml rename to testdata/retryable-reads/legacy/gridfs-downloadByName.yml diff --git a/testdata/retryable-reads/listCollectionNames-serverErrors.json b/testdata/retryable-reads/legacy/listCollectionNames-serverErrors.json similarity index 100% rename from testdata/retryable-reads/listCollectionNames-serverErrors.json rename to testdata/retryable-reads/legacy/listCollectionNames-serverErrors.json diff --git a/testdata/retryable-reads/listCollectionNames-serverErrors.yml b/testdata/retryable-reads/legacy/listCollectionNames-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/listCollectionNames-serverErrors.yml rename to testdata/retryable-reads/legacy/listCollectionNames-serverErrors.yml diff --git a/testdata/retryable-reads/listCollectionNames.json b/testdata/retryable-reads/legacy/listCollectionNames.json similarity index 100% rename from testdata/retryable-reads/listCollectionNames.json rename to testdata/retryable-reads/legacy/listCollectionNames.json diff --git a/testdata/retryable-reads/listCollectionNames.yml b/testdata/retryable-reads/legacy/listCollectionNames.yml similarity index 100% rename from testdata/retryable-reads/listCollectionNames.yml rename to testdata/retryable-reads/legacy/listCollectionNames.yml diff --git a/testdata/retryable-reads/listCollectionObjects-serverErrors.json b/testdata/retryable-reads/legacy/listCollectionObjects-serverErrors.json similarity index 100% rename from testdata/retryable-reads/listCollectionObjects-serverErrors.json rename to testdata/retryable-reads/legacy/listCollectionObjects-serverErrors.json diff --git a/testdata/retryable-reads/listCollectionObjects-serverErrors.yml b/testdata/retryable-reads/legacy/listCollectionObjects-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/listCollectionObjects-serverErrors.yml rename to testdata/retryable-reads/legacy/listCollectionObjects-serverErrors.yml diff --git a/testdata/retryable-reads/listCollectionObjects.json b/testdata/retryable-reads/legacy/listCollectionObjects.json similarity index 100% rename from testdata/retryable-reads/listCollectionObjects.json rename to testdata/retryable-reads/legacy/listCollectionObjects.json diff --git a/testdata/retryable-reads/listCollectionObjects.yml b/testdata/retryable-reads/legacy/listCollectionObjects.yml similarity index 100% rename from testdata/retryable-reads/listCollectionObjects.yml rename to testdata/retryable-reads/legacy/listCollectionObjects.yml diff --git a/testdata/retryable-reads/listCollections-serverErrors.json b/testdata/retryable-reads/legacy/listCollections-serverErrors.json similarity index 100% rename from testdata/retryable-reads/listCollections-serverErrors.json rename to testdata/retryable-reads/legacy/listCollections-serverErrors.json diff --git a/testdata/retryable-reads/listCollections-serverErrors.yml b/testdata/retryable-reads/legacy/listCollections-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/listCollections-serverErrors.yml rename to testdata/retryable-reads/legacy/listCollections-serverErrors.yml diff --git a/testdata/retryable-reads/listCollections.json b/testdata/retryable-reads/legacy/listCollections.json similarity index 100% rename from testdata/retryable-reads/listCollections.json rename to testdata/retryable-reads/legacy/listCollections.json diff --git a/testdata/retryable-reads/listCollections.yml b/testdata/retryable-reads/legacy/listCollections.yml similarity index 100% rename from testdata/retryable-reads/listCollections.yml rename to testdata/retryable-reads/legacy/listCollections.yml diff --git a/testdata/retryable-reads/listDatabaseNames-serverErrors.json b/testdata/retryable-reads/legacy/listDatabaseNames-serverErrors.json similarity index 100% rename from testdata/retryable-reads/listDatabaseNames-serverErrors.json rename to testdata/retryable-reads/legacy/listDatabaseNames-serverErrors.json diff --git a/testdata/retryable-reads/listDatabaseNames-serverErrors.yml b/testdata/retryable-reads/legacy/listDatabaseNames-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/listDatabaseNames-serverErrors.yml rename to testdata/retryable-reads/legacy/listDatabaseNames-serverErrors.yml diff --git a/testdata/retryable-reads/listDatabaseNames.json b/testdata/retryable-reads/legacy/listDatabaseNames.json similarity index 100% rename from testdata/retryable-reads/listDatabaseNames.json rename to testdata/retryable-reads/legacy/listDatabaseNames.json diff --git a/testdata/retryable-reads/listDatabaseNames.yml b/testdata/retryable-reads/legacy/listDatabaseNames.yml similarity index 100% rename from testdata/retryable-reads/listDatabaseNames.yml rename to testdata/retryable-reads/legacy/listDatabaseNames.yml diff --git a/testdata/retryable-reads/listDatabaseObjects-serverErrors.json b/testdata/retryable-reads/legacy/listDatabaseObjects-serverErrors.json similarity index 100% rename from testdata/retryable-reads/listDatabaseObjects-serverErrors.json rename to testdata/retryable-reads/legacy/listDatabaseObjects-serverErrors.json diff --git a/testdata/retryable-reads/listDatabaseObjects-serverErrors.yml b/testdata/retryable-reads/legacy/listDatabaseObjects-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/listDatabaseObjects-serverErrors.yml rename to testdata/retryable-reads/legacy/listDatabaseObjects-serverErrors.yml diff --git a/testdata/retryable-reads/listDatabaseObjects.json b/testdata/retryable-reads/legacy/listDatabaseObjects.json similarity index 100% rename from testdata/retryable-reads/listDatabaseObjects.json rename to testdata/retryable-reads/legacy/listDatabaseObjects.json diff --git a/testdata/retryable-reads/listDatabaseObjects.yml b/testdata/retryable-reads/legacy/listDatabaseObjects.yml similarity index 100% rename from testdata/retryable-reads/listDatabaseObjects.yml rename to testdata/retryable-reads/legacy/listDatabaseObjects.yml diff --git a/testdata/retryable-reads/listDatabases-serverErrors.json b/testdata/retryable-reads/legacy/listDatabases-serverErrors.json similarity index 100% rename from testdata/retryable-reads/listDatabases-serverErrors.json rename to testdata/retryable-reads/legacy/listDatabases-serverErrors.json diff --git a/testdata/retryable-reads/listDatabases-serverErrors.yml b/testdata/retryable-reads/legacy/listDatabases-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/listDatabases-serverErrors.yml rename to testdata/retryable-reads/legacy/listDatabases-serverErrors.yml diff --git a/testdata/retryable-reads/listDatabases.json b/testdata/retryable-reads/legacy/listDatabases.json similarity index 100% rename from testdata/retryable-reads/listDatabases.json rename to testdata/retryable-reads/legacy/listDatabases.json diff --git a/testdata/retryable-reads/listDatabases.yml b/testdata/retryable-reads/legacy/listDatabases.yml similarity index 100% rename from testdata/retryable-reads/listDatabases.yml rename to testdata/retryable-reads/legacy/listDatabases.yml diff --git a/testdata/retryable-reads/listIndexNames-serverErrors.json b/testdata/retryable-reads/legacy/listIndexNames-serverErrors.json similarity index 100% rename from testdata/retryable-reads/listIndexNames-serverErrors.json rename to testdata/retryable-reads/legacy/listIndexNames-serverErrors.json diff --git a/testdata/retryable-reads/listIndexNames-serverErrors.yml b/testdata/retryable-reads/legacy/listIndexNames-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/listIndexNames-serverErrors.yml rename to testdata/retryable-reads/legacy/listIndexNames-serverErrors.yml diff --git a/testdata/retryable-reads/listIndexNames.json b/testdata/retryable-reads/legacy/listIndexNames.json similarity index 100% rename from testdata/retryable-reads/listIndexNames.json rename to testdata/retryable-reads/legacy/listIndexNames.json diff --git a/testdata/retryable-reads/listIndexNames.yml b/testdata/retryable-reads/legacy/listIndexNames.yml similarity index 100% rename from testdata/retryable-reads/listIndexNames.yml rename to testdata/retryable-reads/legacy/listIndexNames.yml diff --git a/testdata/retryable-reads/listIndexes-serverErrors.json b/testdata/retryable-reads/legacy/listIndexes-serverErrors.json similarity index 100% rename from testdata/retryable-reads/listIndexes-serverErrors.json rename to testdata/retryable-reads/legacy/listIndexes-serverErrors.json diff --git a/testdata/retryable-reads/listIndexes-serverErrors.yml b/testdata/retryable-reads/legacy/listIndexes-serverErrors.yml similarity index 100% rename from testdata/retryable-reads/listIndexes-serverErrors.yml rename to testdata/retryable-reads/legacy/listIndexes-serverErrors.yml diff --git a/testdata/retryable-reads/listIndexes.json b/testdata/retryable-reads/legacy/listIndexes.json similarity index 100% rename from testdata/retryable-reads/listIndexes.json rename to testdata/retryable-reads/legacy/listIndexes.json diff --git a/testdata/retryable-reads/listIndexes.yml b/testdata/retryable-reads/legacy/listIndexes.yml similarity index 100% rename from testdata/retryable-reads/listIndexes.yml rename to testdata/retryable-reads/legacy/listIndexes.yml diff --git a/testdata/retryable-reads/mapReduce.json b/testdata/retryable-reads/legacy/mapReduce.json similarity index 100% rename from testdata/retryable-reads/mapReduce.json rename to testdata/retryable-reads/legacy/mapReduce.json diff --git a/testdata/retryable-reads/mapReduce.yml b/testdata/retryable-reads/legacy/mapReduce.yml similarity index 100% rename from testdata/retryable-reads/mapReduce.yml rename to testdata/retryable-reads/legacy/mapReduce.yml diff --git a/testdata/retryable-reads/unified/exceededTimeLimit.json b/testdata/retryable-reads/unified/exceededTimeLimit.json new file mode 100644 index 0000000000..8d090bbe3f --- /dev/null +++ b/testdata/retryable-reads/unified/exceededTimeLimit.json @@ -0,0 +1,147 @@ +{ + "description": "ExceededTimeLimit is a retryable read", + "schemaVersion": "1.3", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "exceededtimelimit-test" + } + } + ], + "initialData": [ + { + "collectionName": "exceededtimelimit-test", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "Find succeeds on second attempt after ExceededTimeLimit", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 262 + } + } + } + }, + { + "name": "find", + "arguments": { + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "object": "collection0", + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "exceededtimelimit-test", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "commandName": "find", + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "exceededtimelimit-test", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "commandName": "find", + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/testdata/retryable-reads/unified/exceededTimeLimit.yml b/testdata/retryable-reads/unified/exceededTimeLimit.yml new file mode 100644 index 0000000000..1912fa7bbd --- /dev/null +++ b/testdata/retryable-reads/unified/exceededTimeLimit.yml @@ -0,0 +1,68 @@ +description: "ExceededTimeLimit is a retryable read" + +schemaVersion: "1.3" + +runOnRequirements: + - minServerVersion: "4.0" + topologies: [single, replicaset] + - minServerVersion: "4.1.7" + topologies: [sharded, load-balanced] + +createEntities: + - client: + id: &client0 client0 + # Ensure the `configureFailpoint` and `find` commands are run on the same mongos + useMultipleMongoses: false + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name "retryable-reads-tests" + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name "exceededtimelimit-test" + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + +tests: + - description: "Find succeeds on second attempt after ExceededTimeLimit" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ "find" ] + errorCode: 262 # ExceededTimeLimit + - name: find + arguments: + filter: { _id: { $gt: 1 } } + object: *collection0 + expectResult: + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + filter: { _id: { $gt: 1 } } + commandName: find + databaseName: *database0Name + - commandStartedEvent: + command: + find: *collection0Name + filter: { _id: { $gt: 1 } } + commandName: find + databaseName: *database0Name diff --git a/testdata/retryable-reads/unified/handshakeError.json b/testdata/retryable-reads/unified/handshakeError.json new file mode 100644 index 0000000000..2921d8a954 --- /dev/null +++ b/testdata/retryable-reads/unified/handshakeError.json @@ -0,0 +1,3079 @@ +{ + "description": "retryable reads handshake failures", + "schemaVersion": "1.4", + "runOnRequirements": [ + { + "minServerVersion": "4.2", + "topologies": [ + "replicaset", + "sharded", + "load-balanced" + ], + "auth": true + } + ], + "createEntities": [ + { + "client": { + "id": "client", + "useMultipleMongoses": false, + "observeEvents": [ + "connectionCheckOutStartedEvent", + "commandStartedEvent", + "commandSucceededEvent", + "commandFailedEvent" + ] + } + }, + { + "database": { + "id": "database", + "client": "client", + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "collection": { + "id": "collection", + "database": "database", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-handshake-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "client.listDatabases succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listDatabases", + "object": "client", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listDatabases" + } + }, + { + "commandSucceededEvent": { + "commandName": "listDatabases" + } + } + ] + } + ] + }, + { + "description": "client.listDatabases succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listDatabases", + "object": "client", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listDatabases" + } + }, + { + "commandSucceededEvent": { + "commandName": "listDatabases" + } + } + ] + } + ] + }, + { + "description": "client.listDatabaseNames succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listDatabaseNames", + "object": "client" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listDatabases" + } + }, + { + "commandSucceededEvent": { + "commandName": "listDatabases" + } + } + ] + } + ] + }, + { + "description": "client.listDatabaseNames succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listDatabaseNames", + "object": "client" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listDatabases" + } + }, + { + "commandSucceededEvent": { + "commandName": "listDatabases" + } + } + ] + } + ] + }, + { + "description": "client.createChangeStream succeeds after retryable handshake network error", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "createChangeStream", + "object": "client", + "arguments": { + "pipeline": [] + }, + "saveResultAsEntity": "changeStream" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "client.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "createChangeStream", + "object": "client", + "arguments": { + "pipeline": [] + }, + "saveResultAsEntity": "changeStream" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "database.aggregate succeeds after retryable handshake network error", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "aggregate", + "object": "database", + "arguments": { + "pipeline": [ + { + "$listLocalSessions": {} + }, + { + "$limit": 1 + } + ] + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "database.aggregate succeeds after retryable handshake server error (ShutdownInProgress)", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "aggregate", + "object": "database", + "arguments": { + "pipeline": [ + { + "$listLocalSessions": {} + }, + { + "$limit": 1 + } + ] + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "database.listCollections succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listCollections", + "object": "database", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listCollections" + } + }, + { + "commandSucceededEvent": { + "commandName": "listCollections" + } + } + ] + } + ] + }, + { + "description": "database.listCollections succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listCollections", + "object": "database", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listCollections" + } + }, + { + "commandSucceededEvent": { + "commandName": "listCollections" + } + } + ] + } + ] + }, + { + "description": "database.listCollectionNames succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listCollectionNames", + "object": "database", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listCollections" + } + }, + { + "commandSucceededEvent": { + "commandName": "listCollections" + } + } + ] + } + ] + }, + { + "description": "database.listCollectionNames succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listCollectionNames", + "object": "database", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listCollections" + } + }, + { + "commandSucceededEvent": { + "commandName": "listCollections" + } + } + ] + } + ] + }, + { + "description": "database.createChangeStream succeeds after retryable handshake network error", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "createChangeStream", + "object": "database", + "arguments": { + "pipeline": [] + }, + "saveResultAsEntity": "changeStream" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "database.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "createChangeStream", + "object": "database", + "arguments": { + "pipeline": [] + }, + "saveResultAsEntity": "changeStream" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "collection.aggregate succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "aggregate", + "object": "collection", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "collection.aggregate succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "aggregate", + "object": "collection", + "arguments": { + "pipeline": [] + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "collection.countDocuments succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "countDocuments", + "object": "collection", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "collection.countDocuments succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "countDocuments", + "object": "collection", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "collection.estimatedDocumentCount succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "estimatedDocumentCount", + "object": "collection" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "count" + } + }, + { + "commandSucceededEvent": { + "commandName": "count" + } + } + ] + } + ] + }, + { + "description": "collection.estimatedDocumentCount succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "estimatedDocumentCount", + "object": "collection" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "count" + } + }, + { + "commandSucceededEvent": { + "commandName": "count" + } + } + ] + } + ] + }, + { + "description": "collection.distinct succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "distinct", + "object": "collection", + "arguments": { + "fieldName": "x", + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "distinct" + } + }, + { + "commandSucceededEvent": { + "commandName": "distinct" + } + } + ] + } + ] + }, + { + "description": "collection.distinct succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "distinct", + "object": "collection", + "arguments": { + "fieldName": "x", + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "distinct" + } + }, + { + "commandSucceededEvent": { + "commandName": "distinct" + } + } + ] + } + ] + }, + { + "description": "collection.find succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "find", + "object": "collection", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "find" + } + }, + { + "commandSucceededEvent": { + "commandName": "find" + } + } + ] + } + ] + }, + { + "description": "collection.find succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "find", + "object": "collection", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "find" + } + }, + { + "commandSucceededEvent": { + "commandName": "find" + } + } + ] + } + ] + }, + { + "description": "collection.findOne succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "findOne", + "object": "collection", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "find" + } + }, + { + "commandSucceededEvent": { + "commandName": "find" + } + } + ] + } + ] + }, + { + "description": "collection.findOne succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "findOne", + "object": "collection", + "arguments": { + "filter": {} + } + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "find" + } + }, + { + "commandSucceededEvent": { + "commandName": "find" + } + } + ] + } + ] + }, + { + "description": "collection.listIndexes succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listIndexes", + "object": "collection" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listIndexes" + } + }, + { + "commandSucceededEvent": { + "commandName": "listIndexes" + } + } + ] + } + ] + }, + { + "description": "collection.listIndexes succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listIndexes", + "object": "collection" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listIndexes" + } + }, + { + "commandSucceededEvent": { + "commandName": "listIndexes" + } + } + ] + } + ] + }, + { + "description": "collection.listIndexNames succeeds after retryable handshake network error", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listIndexNames", + "object": "collection" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listIndexes" + } + }, + { + "commandSucceededEvent": { + "commandName": "listIndexes" + } + } + ] + } + ] + }, + { + "description": "collection.listIndexNames succeeds after retryable handshake server error (ShutdownInProgress)", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "listIndexNames", + "object": "collection" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "listIndexes" + } + }, + { + "commandSucceededEvent": { + "commandName": "listIndexes" + } + } + ] + } + ] + }, + { + "description": "collection.createChangeStream succeeds after retryable handshake network error", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "createChangeStream", + "object": "collection", + "arguments": { + "pipeline": [] + }, + "saveResultAsEntity": "changeStream" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + }, + { + "description": "collection.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)", + "runOnRequirements": [ + { + "serverless": "forbid" + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "ping", + "saslContinue" + ], + "closeConnection": true + } + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ping", + "command": { + "ping": 1 + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "createChangeStream", + "object": "collection", + "arguments": { + "pipeline": [] + }, + "saveResultAsEntity": "changeStream" + } + ], + "expectEvents": [ + { + "client": "client", + "eventType": "cmap", + "events": [ + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + }, + { + "connectionCheckOutStartedEvent": {} + } + ] + }, + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "command": { + "ping": 1 + }, + "databaseName": "retryable-reads-handshake-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "ping" + } + }, + { + "commandStartedEvent": { + "commandName": "aggregate" + } + }, + { + "commandSucceededEvent": { + "commandName": "aggregate" + } + } + ] + } + ] + } + ] +} diff --git a/testdata/retryable-reads/unified/handshakeError.yml b/testdata/retryable-reads/unified/handshakeError.yml new file mode 100644 index 0000000000..f2b1ec982c --- /dev/null +++ b/testdata/retryable-reads/unified/handshakeError.yml @@ -0,0 +1,1342 @@ +# Tests in this file are generated from handshakeError.yml.template. + +description: "retryable reads handshake failures" + +# 1.4 is required for "serverless: forbid". +schemaVersion: "1.4" + +runOnRequirements: + - minServerVersion: "4.2" + topologies: [replicaset, sharded, load-balanced] + auth: true + +createEntities: + - client: + id: &client client + useMultipleMongoses: false + observeEvents: + - connectionCheckOutStartedEvent + - commandStartedEvent + - commandSucceededEvent + - commandFailedEvent + - database: + id: &database database + client: *client + databaseName: &databaseName retryable-reads-handshake-tests + - collection: + id: &collection collection + database: *database + collectionName: &collectionName coll + +initialData: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + +tests: + # Because setting a failPoint creates a connection in the connection pool, run + # a ping operation that fails immediately after the failPoint operation in + # order to discard the connection before running the actual operation to be + # tested. The saslContinue command is used to avoid SDAM errors. + # + # Description of events: + # - Failpoint operation. + # - Creates a connection in the connection pool that must be closed. + # - Ping operation. + # - Triggers failpoint (first time). + # - Closes the connection made by the fail point operation. + # - Test operation. + # - New connection is created. + # - Triggers failpoint (second time). + # - Tests whether operation successfully retries the handshake and succeeds. + + - description: "client.listDatabases succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listDatabases + object: *client + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listDatabases + - commandSucceededEvent: + commandName: listDatabases + + - description: "client.listDatabases succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listDatabases + object: *client + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listDatabases + - commandSucceededEvent: + commandName: listDatabases + + - description: "client.listDatabaseNames succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listDatabaseNames + object: *client + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listDatabases + - commandSucceededEvent: + commandName: listDatabases + + - description: "client.listDatabaseNames succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listDatabaseNames + object: *client + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listDatabases + - commandSucceededEvent: + commandName: listDatabases + + - description: "client.createChangeStream succeeds after retryable handshake network error" + runOnRequirements: + - serverless: forbid + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: createChangeStream + object: *client + arguments: + pipeline: [] + saveResultAsEntity: changeStream + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "client.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)" + runOnRequirements: + - serverless: forbid + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: createChangeStream + object: *client + arguments: + pipeline: [] + saveResultAsEntity: changeStream + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "database.aggregate succeeds after retryable handshake network error" + runOnRequirements: + - serverless: forbid + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: aggregate + object: *database + arguments: + pipeline: [ { $listLocalSessions: {} }, { $limit: 1 } ] + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "database.aggregate succeeds after retryable handshake server error (ShutdownInProgress)" + runOnRequirements: + - serverless: forbid + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: aggregate + object: *database + arguments: + pipeline: [ { $listLocalSessions: {} }, { $limit: 1 } ] + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "database.listCollections succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listCollections + object: *database + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listCollections + - commandSucceededEvent: + commandName: listCollections + + - description: "database.listCollections succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listCollections + object: *database + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listCollections + - commandSucceededEvent: + commandName: listCollections + + - description: "database.listCollectionNames succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listCollectionNames + object: *database + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listCollections + - commandSucceededEvent: + commandName: listCollections + + - description: "database.listCollectionNames succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listCollectionNames + object: *database + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listCollections + - commandSucceededEvent: + commandName: listCollections + + - description: "database.createChangeStream succeeds after retryable handshake network error" + runOnRequirements: + - serverless: forbid + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: createChangeStream + object: *database + arguments: + pipeline: [] + saveResultAsEntity: changeStream + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "database.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)" + runOnRequirements: + - serverless: forbid + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: createChangeStream + object: *database + arguments: + pipeline: [] + saveResultAsEntity: changeStream + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "collection.aggregate succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: aggregate + object: *collection + arguments: + pipeline: [] + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "collection.aggregate succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: aggregate + object: *collection + arguments: + pipeline: [] + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "collection.countDocuments succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: countDocuments + object: *collection + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "collection.countDocuments succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: countDocuments + object: *collection + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "collection.estimatedDocumentCount succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: estimatedDocumentCount + object: *collection + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: count + - commandSucceededEvent: + commandName: count + + - description: "collection.estimatedDocumentCount succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: estimatedDocumentCount + object: *collection + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: count + - commandSucceededEvent: + commandName: count + + - description: "collection.distinct succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: distinct + object: *collection + arguments: + fieldName: x + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: distinct + - commandSucceededEvent: + commandName: distinct + + - description: "collection.distinct succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: distinct + object: *collection + arguments: + fieldName: x + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: distinct + - commandSucceededEvent: + commandName: distinct + + - description: "collection.find succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: find + object: *collection + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: find + - commandSucceededEvent: + commandName: find + + - description: "collection.find succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: find + object: *collection + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: find + - commandSucceededEvent: + commandName: find + + - description: "collection.findOne succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: findOne + object: *collection + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: find + - commandSucceededEvent: + commandName: find + + - description: "collection.findOne succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: findOne + object: *collection + arguments: + filter: {} + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: find + - commandSucceededEvent: + commandName: find + + - description: "collection.listIndexes succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listIndexes + object: *collection + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listIndexes + - commandSucceededEvent: + commandName: listIndexes + + - description: "collection.listIndexes succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listIndexes + object: *collection + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listIndexes + - commandSucceededEvent: + commandName: listIndexes + + - description: "collection.listIndexNames succeeds after retryable handshake network error" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listIndexNames + object: *collection + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listIndexes + - commandSucceededEvent: + commandName: listIndexes + + - description: "collection.listIndexNames succeeds after retryable handshake server error (ShutdownInProgress)" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: listIndexNames + object: *collection + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: listIndexes + - commandSucceededEvent: + commandName: listIndexes + + - description: "collection.createChangeStream succeeds after retryable handshake network error" + runOnRequirements: + - serverless: forbid + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: createChangeStream + object: *collection + arguments: + pipeline: [] + saveResultAsEntity: changeStream + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate + + - description: "collection.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)" + runOnRequirements: + - serverless: forbid + operations: + - name: failPoint + object: testRunner + arguments: + client: *client + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ping, saslContinue] + closeConnection: true + - name: runCommand + object: *database + arguments: { commandName: ping, command: { ping: 1 } } + expectError: { isError: true } + - name: createChangeStream + object: *collection + arguments: + pipeline: [] + saveResultAsEntity: changeStream + expectEvents: + - client: *client + eventType: cmap + events: + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - { connectionCheckOutStartedEvent: {} } + - client: *client + events: + - commandStartedEvent: + command: { ping: 1 } + databaseName: *databaseName + - commandFailedEvent: + commandName: ping + - commandStartedEvent: + commandName: aggregate + - commandSucceededEvent: + commandName: aggregate diff --git a/testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.json b/testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.json new file mode 100644 index 0000000000..8aa6a6b5e5 --- /dev/null +++ b/testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.json @@ -0,0 +1,147 @@ +{ + "description": "ReadConcernMajorityNotAvailableYet is a retryable read", + "schemaVersion": "1.3", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded", + "load-balanced" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "readconcernmajoritynotavailableyet_test" + } + } + ], + "initialData": [ + { + "collectionName": "readconcernmajoritynotavailableyet_test", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "Find succeeds on second attempt after ReadConcernMajorityNotAvailableYet", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "errorCode": 134 + } + } + } + }, + { + "name": "find", + "arguments": { + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "object": "collection0", + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "readconcernmajoritynotavailableyet_test", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "commandName": "find", + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "readconcernmajoritynotavailableyet_test", + "filter": { + "_id": { + "$gt": 1 + } + } + }, + "commandName": "find", + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + } + ] +} diff --git a/testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.yml b/testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.yml new file mode 100644 index 0000000000..707a62acd7 --- /dev/null +++ b/testdata/retryable-reads/unified/readConcernMajorityNotAvailableYet.yml @@ -0,0 +1,68 @@ +description: "ReadConcernMajorityNotAvailableYet is a retryable read" + +schemaVersion: "1.3" + +runOnRequirements: + - minServerVersion: "4.0" + topologies: [single, replicaset] + - minServerVersion: "4.1.7" + topologies: [sharded, load-balanced] + +createEntities: + - client: + id: &client0 client0 + # Ensure the `configureFailpoint` and `find` commands are run on the same mongos + useMultipleMongoses: false + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name "retryable-reads-tests" + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name "readconcernmajoritynotavailableyet_test" + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + +tests: + - description: "Find succeeds on second attempt after ReadConcernMajorityNotAvailableYet" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ "find" ] + errorCode: 134 # ReadConcernMajorityNotAvailableYet + - name: find + arguments: + filter: { _id: { $gt: 1 } } + object: *collection0 + expectResult: + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + filter: { _id: { $gt: 1 } } + commandName: find + databaseName: *database0Name + - commandStartedEvent: + command: + find: *collection0Name + filter: { _id: { $gt: 1 } } + commandName: find + databaseName: *database0Name diff --git a/x/mongo/driver/errors.go b/x/mongo/driver/errors.go index 61847329f2..f4bd46deb5 100644 --- a/x/mongo/driver/errors.go +++ b/x/mongo/driver/errors.go @@ -25,7 +25,22 @@ import ( const LegacyNotPrimaryErrMsg = "not master" var ( - retryableCodes = []int32{11600, 11602, 10107, 13435, 13436, 189, 91, 7, 6, 89, 9001, 262} + retryableCodes = []int32{ + 6, // HostUnreachable + 7, // HostNotFound + 89, // NetworkTimeout + 91, // ShutdownInProgress + 134, // ReadConcernMajorityNotAvailableYet + 189, // PrimarySteppedDown + 262, // ExceededTimeLimit + 9001, // SocketException + 10107, // NotWritablePrimary + 11600, // InterruptedAtShutdown + 11602, // InterruptedDueToReplStateChange + 13435, // NotPrimaryNoSecondaryOk + 13436, // NotPrimaryOrSecondary + } + nodeIsRecoveringCodes = []int32{11600, 11602, 13436, 189, 91} notPrimaryCodes = []int32{10107, 13435, 10058} nodeIsShuttingDownCodes = []int32{11600, 91}