├── .appveyor.yml ├── .evergreen ├── README.md ├── dependencies │ ├── build-perl5lib.pl │ ├── config.yml │ ├── test-perl5lib.pl │ └── write-config.pl ├── lib │ ├── EvergreenConfig.pm │ └── EvergreenHelper.pm ├── testing │ ├── build.pl │ ├── config-pvt.yml │ ├── config.yml │ ├── live-test.pl │ ├── setup-atlas-proxy.pl │ ├── setup-mongo-orchestration.pl │ ├── teardown-mongo-orchestration.pl │ ├── test.pl │ ├── write-config-pvt.pl │ └── write-config.pl └── toolchain │ ├── build-unix-perls.pl │ ├── build-win-perls.pl │ ├── config.yml │ ├── validate-unix-perls.sh │ └── validate-win-perls.sh ├── .gitignore ├── .gitmodules ├── .mailmap ├── .travis.yml ├── CONTRIBUTING.md ├── Changes ├── INSTALL.md ├── LICENSE ├── Makefile.PL ├── README.md ├── devel ├── README.md ├── bench │ ├── README.md │ ├── bin │ │ └── bench.pl │ ├── cpanfile │ └── lib │ │ ├── BenchBSON.pm │ │ ├── BenchMulti.pm │ │ ├── BenchParallel.pm │ │ └── BenchSingle.pm ├── bin │ ├── harness.pl │ ├── test-all.pl │ └── update-copyrights.pl ├── certs │ ├── .gitignore │ ├── CA.pl.patch │ ├── README.txt │ ├── badclient.pem │ ├── ca.pem │ ├── client.pem │ └── server.pem ├── config │ ├── master-2.2.yml │ ├── master-any-inMemory.yml │ ├── master-any-wiredtiger.yml │ ├── master-any.yml │ ├── mongod-2.0.yml │ ├── mongod-2.2.yml │ ├── mongod-2.4.yml │ ├── mongod-2.6-auth.yml │ ├── mongod-2.6.yml │ ├── mongod-3.0-mmapv1.yml │ ├── mongod-3.0-scram.yml │ ├── mongod-3.0.yml │ ├── mongod-3.2-auth.yml │ ├── mongod-3.2.yml │ ├── mongod-3.4.yml │ ├── mongod-3.6-compression-zlib.yml │ ├── mongod-3.6-mmapv1.yml │ ├── mongod-3.6-ssl.yml │ ├── mongod-3.6.yml │ ├── mongod-4.0-scram.yml │ ├── mongod-4.0.yml │ ├── mongod-4.1.5.yml │ ├── mongod-4.2-auth.yml │ ├── mongod-4.2-ssl.yml │ ├── mongod-4.2.yml │ ├── mongod-any-inMemory.yml │ ├── mongod-any-ssl.yml │ ├── mongod-any-tls1_2.yml │ ├── mongod-any-wiredtiger.yml │ ├── mongod-any.yml │ ├── replicaset-2.0.yml │ ├── replicaset-2.2.yml │ ├── replicaset-2.4.yml │ ├── replicaset-2.6.yml │ ├── replicaset-3.0-auth.yml │ ├── replicaset-3.0-large.yml │ ├── replicaset-3.0.yml │ ├── replicaset-3.2.yml │ ├── replicaset-3.4.yml │ ├── replicaset-3.6-auth.yml │ ├── replicaset-3.6.yml │ ├── replicaset-4.0-auth.yml │ ├── replicaset-4.0-mmapv1.yml │ ├── replicaset-4.0.yml │ ├── replicaset-4.1.yml │ ├── replicaset-4.2-auth-hidden.yml │ ├── replicaset-4.2-hidden-auth.yml │ ├── replicaset-4.2-hidden.yml │ ├── replicaset-4.2.yml │ ├── replicaset-4.4.yml │ ├── replicaset-any-27017-single.yml │ ├── replicaset-any-27017.yml │ ├── replicaset-any-inMemory.yml │ ├── replicaset-any-ssl.yml │ ├── replicaset-any-w_auth_hidden.yml │ ├── replicaset-any-wiredtiger.yml │ ├── replicaset-any.yml │ ├── replicaset-mixed.yml │ ├── replicaset-multi-3.6.yml │ ├── replicaset-multi-4.0-w_arbiter.yml │ ├── replicaset-multi-4.0.yml │ ├── replicaset-single-3.2.yml │ ├── replicaset-single-3.4.yml │ ├── replicaset-single-3.6.yml │ ├── replicaset-single-4.0-ssl.yml │ ├── replicaset-single-4.0.yml │ ├── replicaset-single-4.2.yml │ ├── replicaset-single-any.yml │ ├── rsghost-any.yml │ ├── sharded-2.0.yml │ ├── sharded-2.2.yml │ ├── sharded-2.4.yml │ ├── sharded-2.6.yml │ ├── sharded-2mongos-3.4.yml │ ├── sharded-2mongos-4.1.yml │ ├── sharded-2mongos.yml │ ├── sharded-2rs-2.6.yml │ ├── sharded-2rs-3.6.yml │ ├── sharded-3.0.yml │ ├── sharded-3.2.yml │ ├── sharded-3.4.yml │ ├── sharded-3.6.yml │ ├── sharded-4.0.yml │ ├── sharded-4.1.yml │ ├── sharded-4.2.yml │ ├── sharded-any-inMemory.yml │ ├── sharded-any-wiredtiger.yml │ ├── sharded-any.yml │ ├── sharded-rs-3.4.yml │ ├── sharded-rs-3.6.yml │ └── sharded-single-4.2.yml ├── cpanfile ├── lib │ └── MongoDBTest │ │ ├── Deployment.pm │ │ ├── Mongod.pm │ │ ├── Mongos.pm │ │ ├── Orchestrator.pm │ │ ├── ReplicaSet.pm │ │ ├── Role │ │ ├── Deployment.pm │ │ ├── Server.pm │ │ ├── ServerSet.pm │ │ └── Verbosity.pm │ │ ├── ServerSet.pm │ │ └── ShardedCluster.pm ├── t-dynamic │ ├── AUTH-MONGODB-CR.t │ ├── AUTH-SCRAM-3.0.t │ ├── AUTH-SCRAM-4.0.t │ ├── AUTH-X509.t │ ├── AUTH-op-errors.t │ ├── BULK-mmapv1.t │ ├── CAP-386-bulk-mixed-auth.t │ ├── CAP-386-bulk-mixed-failover.t │ ├── CAP-408-agg-explain.t │ ├── CAP-420-agg-cursor.t │ ├── CAP-455-createIndexes.t │ ├── CAP-490-user-management.t │ ├── CAP-501-agg-diskuse.t │ ├── OP_COMPRESSION.t │ ├── PERL-133-connect-no-primary.t │ ├── PERL-234-auto-reconnect.t │ ├── PERL-264-connection-scope.t │ ├── PERL-433-list-collections.t │ ├── PERL-434-list-indexes.t │ ├── PERL-461-text-search.t │ ├── PERL-493-writeconcern.t │ ├── PERL-558-fsync-unlock.t │ ├── PERL-563-756-find-getmore-killcursors.t │ ├── PERL-564-find-and-modify.t │ ├── PERL-564-readconcern.t │ ├── PERL-594-max-await-time.t │ ├── PERL-626-max-staleness.t │ ├── PERL-627-write-concern-commands.t │ ├── PERL-792-replica-set-failover.t │ ├── PERL-807-DNS-SRV-TXT.t │ ├── dns-srv-switchover.t │ ├── sharded-2.4-mixed.yml │ ├── sharded-2.6-mixed.yml │ └── w0-legacy-fallback.t └── t-special │ ├── AUTH-GSSAPI.t │ ├── CAP-469-SASL-PLAIN.t │ ├── CAP-478-X509.t │ ├── CAP-516-SSL-certificate.t │ └── PERL-834-atlas.t ├── dist.ini ├── inc ├── CheckJiraInChanges.pm ├── ExtUtils │ └── HasCompiler.pm └── Makefile.footer ├── lib ├── MongoDB.pm └── MongoDB │ ├── BSON │ ├── Binary.pm │ └── Regexp.pm │ ├── BulkWrite.pm │ ├── BulkWriteResult.pm │ ├── BulkWriteView.pm │ ├── ChangeStream.pm │ ├── ClientSession.pm │ ├── Code.pm │ ├── Collection.pm │ ├── CommandResult.pm │ ├── Cursor.pm │ ├── DBRef.pm │ ├── DataTypes.pod │ ├── Database.pm │ ├── DeleteResult.pm │ ├── Error.pm │ ├── Examples.pod │ ├── GridFSBucket.pm │ ├── GridFSBucket │ ├── DownloadStream.pm │ └── UploadStream.pm │ ├── IndexView.pm │ ├── InsertManyResult.pm │ ├── InsertOneResult.pm │ ├── MongoClient.pm │ ├── Monitoring.pod │ ├── OID.pm │ ├── Op │ ├── _Aggregate.pm │ ├── _BatchInsert.pm │ ├── _BulkWrite.pm │ ├── _ChangeStream.pm │ ├── _Command.pm │ ├── _Count.pm │ ├── _CreateIndexes.pm │ ├── _Delete.pm │ ├── _Distinct.pm │ ├── _DropCollection.pm │ ├── _DropDatabase.pm │ ├── _DropIndexes.pm │ ├── _EndTxn.pm │ ├── _Explain.pm │ ├── _FSyncUnlock.pm │ ├── _FindAndDelete.pm │ ├── _FindAndUpdate.pm │ ├── _GetMore.pm │ ├── _InsertOne.pm │ ├── _KillCursors.pm │ ├── _ListCollections.pm │ ├── _ListIndexes.pm │ ├── _ParallelScan.pm │ ├── _Query.pm │ ├── _RenameCollection.pm │ └── _Update.pm │ ├── QueryResult.pm │ ├── QueryResult │ └── Filtered.pm │ ├── ReadConcern.pm │ ├── ReadPreference.pm │ ├── Role │ ├── _BypassValidation.pm │ ├── _CollectionOp.pm │ ├── _CommandCursorOp.pm │ ├── _CommandMonitoring.pm │ ├── _CursorAPI.pm │ ├── _DatabaseErrorThrower.pm │ ├── _DatabaseOp.pm │ ├── _DeprecationWarner.pm │ ├── _InsertPreEncoder.pm │ ├── _OpReplyParser.pm │ ├── _PrivateConstructor.pm │ ├── _ReadOp.pm │ ├── _ReadPrefModifier.pm │ ├── _SessionSupport.pm │ ├── _SingleBatchDocWrite.pm │ ├── _TopologyMonitoring.pm │ ├── _UpdatePreEncoder.pm │ ├── _WriteOp.pm │ └── _WriteResult.pm │ ├── Timestamp.pm │ ├── Tutorial.pod │ ├── UnacknowledgedResult.pm │ ├── UpdateResult.pm │ ├── Upgrading.pod │ ├── Upgrading │ └── v1.pod │ ├── WriteConcern.pm │ ├── _Constants.pm │ ├── _Credential.pm │ ├── _Dispatcher.pm │ ├── _Link.pm │ ├── _Platform.pm │ ├── _Protocol.pm │ ├── _Server.pm │ ├── _ServerSession.pm │ ├── _SessionPool.pm │ ├── _Topology.pm │ ├── _TransactionOptions.pm │ ├── _Types.pm │ └── _URI.pm ├── perlcritic.rc ├── t ├── 00-report-mongod.t ├── auth_spec.t ├── bulk.t ├── bulk_write_pipeline.t ├── bypass_doc_validation.t ├── causal_consistency.t ├── changestreams.t ├── changestreams_spec.t ├── collection.t ├── connection.t ├── connection_string_spec.t ├── connections-survive-step-down.t ├── crud.t ├── crud_spec.t ├── cursor.t ├── data │ ├── CRUD │ │ ├── README.rst │ │ ├── v1 │ │ │ ├── read │ │ │ │ ├── aggregate-collation.json │ │ │ │ ├── aggregate-collation.yml │ │ │ │ ├── aggregate-out.json │ │ │ │ ├── aggregate-out.yml │ │ │ │ ├── aggregate.json │ │ │ │ ├── aggregate.yml │ │ │ │ ├── count-collation.json │ │ │ │ ├── count-collation.yml │ │ │ │ ├── count-empty.json │ │ │ │ ├── count-empty.yml │ │ │ │ ├── count.json │ │ │ │ ├── count.yml │ │ │ │ ├── distinct-collation.json │ │ │ │ ├── distinct-collation.yml │ │ │ │ ├── distinct.json │ │ │ │ ├── distinct.yml │ │ │ │ ├── find-collation.json │ │ │ │ ├── find-collation.yml │ │ │ │ ├── find.json │ │ │ │ └── find.yml │ │ │ └── write │ │ │ │ ├── bulkWrite-arrayFilters.json │ │ │ │ ├── bulkWrite-arrayFilters.yml │ │ │ │ ├── bulkWrite-collation.json │ │ │ │ ├── bulkWrite-collation.yml │ │ │ │ ├── bulkWrite.json │ │ │ │ ├── bulkWrite.yml │ │ │ │ ├── deleteMany-collation.json │ │ │ │ ├── deleteMany-collation.yml │ │ │ │ ├── deleteMany.json │ │ │ │ ├── deleteMany.yml │ │ │ │ ├── deleteOne-collation.json │ │ │ │ ├── deleteOne-collation.yml │ │ │ │ ├── deleteOne.json │ │ │ │ ├── deleteOne.yml │ │ │ │ ├── findOneAndDelete-collation.json │ │ │ │ ├── findOneAndDelete-collation.yml │ │ │ │ ├── findOneAndDelete.json │ │ │ │ ├── findOneAndDelete.yml │ │ │ │ ├── findOneAndReplace-collation.json │ │ │ │ ├── findOneAndReplace-collation.yml │ │ │ │ ├── findOneAndReplace-upsert.json │ │ │ │ ├── findOneAndReplace-upsert.yml │ │ │ │ ├── findOneAndReplace.json │ │ │ │ ├── findOneAndReplace.yml │ │ │ │ ├── findOneAndUpdate-arrayFilters.json │ │ │ │ ├── findOneAndUpdate-arrayFilters.yml │ │ │ │ ├── findOneAndUpdate-collation.json │ │ │ │ ├── findOneAndUpdate-collation.yml │ │ │ │ ├── findOneAndUpdate.json │ │ │ │ ├── findOneAndUpdate.yml │ │ │ │ ├── insertMany.json │ │ │ │ ├── insertMany.yml │ │ │ │ ├── insertOne.json │ │ │ │ ├── insertOne.yml │ │ │ │ ├── replaceOne-collation.json │ │ │ │ ├── replaceOne-collation.yml │ │ │ │ ├── replaceOne.json │ │ │ │ ├── replaceOne.yml │ │ │ │ ├── updateMany-arrayFilters.json │ │ │ │ ├── updateMany-arrayFilters.yml │ │ │ │ ├── updateMany-collation.json │ │ │ │ ├── updateMany-collation.yml │ │ │ │ ├── updateMany.json │ │ │ │ ├── updateMany.yml │ │ │ │ ├── updateOne-arrayFilters.json │ │ │ │ ├── updateOne-arrayFilters.yml │ │ │ │ ├── updateOne-collation.json │ │ │ │ ├── updateOne-collation.yml │ │ │ │ ├── updateOne.json │ │ │ │ └── updateOne.yml │ │ └── v2 │ │ │ ├── aggregate-merge.json │ │ │ ├── aggregate-merge.yml │ │ │ ├── aggregate-out-readConcern.json │ │ │ ├── aggregate-out-readConcern.yml │ │ │ ├── bulkWrite-arrayFilters.json │ │ │ ├── bulkWrite-arrayFilters.yml │ │ │ ├── db-aggregate.json │ │ │ ├── db-aggregate.yml │ │ │ ├── updateWithPipelines.json │ │ │ └── updateWithPipelines.yml │ ├── SDAM │ │ ├── README.rst │ │ ├── monitoring │ │ │ ├── README.rst │ │ │ ├── replica_set_with_no_primary.json │ │ │ ├── replica_set_with_no_primary.yml │ │ │ ├── replica_set_with_primary.json │ │ │ ├── replica_set_with_primary.yml │ │ │ ├── replica_set_with_removal.json │ │ │ ├── replica_set_with_removal.yml │ │ │ ├── required_replica_set.json │ │ │ ├── required_replica_set.yml │ │ │ ├── standalone.json │ │ │ └── standalone.yml │ │ ├── rs │ │ │ ├── compatible.json │ │ │ ├── compatible.yml │ │ │ ├── discover_arbiters.json │ │ │ ├── discover_arbiters.yml │ │ │ ├── discover_passives.json │ │ │ ├── discover_passives.yml │ │ │ ├── discover_primary.json │ │ │ ├── discover_primary.yml │ │ │ ├── discover_secondary.json │ │ │ ├── discover_secondary.yml │ │ │ ├── discovery.json │ │ │ ├── discovery.yml │ │ │ ├── equal_electionids.json │ │ │ ├── equal_electionids.yml │ │ │ ├── ghost_discovered.json │ │ │ ├── ghost_discovered.yml │ │ │ ├── hosts_differ_from_seeds.json │ │ │ ├── hosts_differ_from_seeds.yml │ │ │ ├── ls_timeout.json │ │ │ ├── ls_timeout.yml │ │ │ ├── member_reconfig.json │ │ │ ├── member_reconfig.yml │ │ │ ├── member_standalone.json │ │ │ ├── member_standalone.yml │ │ │ ├── new_primary.json │ │ │ ├── new_primary.yml │ │ │ ├── new_primary_new_electionid.json │ │ │ ├── new_primary_new_electionid.yml │ │ │ ├── new_primary_new_setversion.json │ │ │ ├── new_primary_new_setversion.yml │ │ │ ├── new_primary_wrong_set_name.json │ │ │ ├── new_primary_wrong_set_name.yml │ │ │ ├── non_rs_member.json │ │ │ ├── non_rs_member.yml │ │ │ ├── normalize_case.json │ │ │ ├── normalize_case.yml │ │ │ ├── normalize_case_me.json │ │ │ ├── normalize_case_me.yml │ │ │ ├── null_election_id.json │ │ │ ├── null_election_id.yml │ │ │ ├── primary_becomes_ghost.json │ │ │ ├── primary_becomes_ghost.yml │ │ │ ├── primary_becomes_mongos.json │ │ │ ├── primary_becomes_mongos.yml │ │ │ ├── primary_becomes_standalone.json │ │ │ ├── primary_becomes_standalone.yml │ │ │ ├── primary_changes_set_name.json │ │ │ ├── primary_changes_set_name.yml │ │ │ ├── primary_disconnect.json │ │ │ ├── primary_disconnect.yml │ │ │ ├── primary_disconnect_electionid.json │ │ │ ├── primary_disconnect_electionid.yml │ │ │ ├── primary_disconnect_setversion.json │ │ │ ├── primary_disconnect_setversion.yml │ │ │ ├── primary_hint_from_secondary_with_mismatched_me.json │ │ │ ├── primary_hint_from_secondary_with_mismatched_me.yml │ │ │ ├── primary_mismatched_me.json │ │ │ ├── primary_mismatched_me.yml │ │ │ ├── primary_reports_new_member.json │ │ │ ├── primary_reports_new_member.yml │ │ │ ├── primary_to_no_primary_mismatched_me.json │ │ │ ├── primary_to_no_primary_mismatched_me.yml │ │ │ ├── primary_wrong_set_name.json │ │ │ ├── primary_wrong_set_name.yml │ │ │ ├── response_from_removed.json │ │ │ ├── response_from_removed.yml │ │ │ ├── rsother_discovered.json │ │ │ ├── rsother_discovered.yml │ │ │ ├── sec_not_auth.json │ │ │ ├── sec_not_auth.yml │ │ │ ├── secondary_ignore_ok_0.json │ │ │ ├── secondary_ignore_ok_0.yml │ │ │ ├── secondary_mismatched_me.json │ │ │ ├── secondary_mismatched_me.yml │ │ │ ├── secondary_wrong_set_name.json │ │ │ ├── secondary_wrong_set_name.yml │ │ │ ├── secondary_wrong_set_name_with_primary.json │ │ │ ├── secondary_wrong_set_name_with_primary.yml │ │ │ ├── setversion_without_electionid.json │ │ │ ├── setversion_without_electionid.yml │ │ │ ├── stepdown_change_set_name.json │ │ │ ├── stepdown_change_set_name.yml │ │ │ ├── too_new.json │ │ │ ├── too_new.yml │ │ │ ├── too_old.json │ │ │ ├── too_old.yml │ │ │ ├── unexpected_mongos.json │ │ │ ├── unexpected_mongos.yml │ │ │ ├── use_setversion_without_electionid.json │ │ │ ├── use_setversion_without_electionid.yml │ │ │ ├── wrong_set_name.json │ │ │ └── wrong_set_name.yml │ │ ├── sharded │ │ │ ├── compatible.json │ │ │ ├── compatible.yml │ │ │ ├── ls_timeout_mongos.json │ │ │ ├── ls_timeout_mongos.yml │ │ │ ├── mongos_disconnect.json │ │ │ ├── mongos_disconnect.yml │ │ │ ├── multiple_mongoses.json │ │ │ ├── multiple_mongoses.yml │ │ │ ├── non_mongos_removed.json │ │ │ ├── non_mongos_removed.yml │ │ │ ├── normalize_uri_case.json │ │ │ ├── normalize_uri_case.yml │ │ │ ├── too_new.json │ │ │ ├── too_new.yml │ │ │ ├── too_old.json │ │ │ └── too_old.yml │ │ └── single │ │ │ ├── compatible.json │ │ │ ├── compatible.yml │ │ │ ├── direct_connection_external_ip.json │ │ │ ├── direct_connection_external_ip.yml │ │ │ ├── direct_connection_mongos.json │ │ │ ├── direct_connection_mongos.yml │ │ │ ├── direct_connection_rsarbiter.json │ │ │ ├── direct_connection_rsarbiter.yml │ │ │ ├── direct_connection_rsprimary.json │ │ │ ├── direct_connection_rsprimary.yml │ │ │ ├── direct_connection_rssecondary.json │ │ │ ├── direct_connection_rssecondary.yml │ │ │ ├── direct_connection_slave.json │ │ │ ├── direct_connection_slave.yml │ │ │ ├── direct_connection_standalone.json │ │ │ ├── direct_connection_standalone.yml │ │ │ ├── ls_timeout_standalone.json │ │ │ ├── ls_timeout_standalone.yml │ │ │ ├── not_ok_response.json │ │ │ ├── not_ok_response.yml │ │ │ ├── standalone_removed.json │ │ │ ├── standalone_removed.yml │ │ │ ├── too_new.json │ │ │ ├── too_new.yml │ │ │ ├── too_old.json │ │ │ ├── too_old.yml │ │ │ ├── unavailable_seed.json │ │ │ └── unavailable_seed.yml │ ├── SS │ │ ├── README.rst │ │ ├── rtt │ │ │ ├── first_value.json │ │ │ ├── first_value.yml │ │ │ ├── first_value_zero.json │ │ │ ├── first_value_zero.yml │ │ │ ├── value_test_1.json │ │ │ ├── value_test_1.yml │ │ │ ├── value_test_2.json │ │ │ ├── value_test_2.yml │ │ │ ├── value_test_3.json │ │ │ ├── value_test_3.yml │ │ │ ├── value_test_4.json │ │ │ ├── value_test_4.yml │ │ │ ├── value_test_5.json │ │ │ └── value_test_5.yml │ │ └── server_selection │ │ │ ├── ReplicaSetNoPrimary │ │ │ ├── read │ │ │ │ ├── Nearest.json │ │ │ │ ├── Nearest.yml │ │ │ │ ├── Nearest_multiple.json │ │ │ │ ├── Nearest_multiple.yml │ │ │ │ ├── Nearest_non_matching.json │ │ │ │ ├── Nearest_non_matching.yml │ │ │ │ ├── PossiblePrimary.json │ │ │ │ ├── PossiblePrimary.yml │ │ │ │ ├── PossiblePrimaryNearest.json │ │ │ │ ├── PossiblePrimaryNearest.yml │ │ │ │ ├── Primary.json │ │ │ │ ├── Primary.yml │ │ │ │ ├── PrimaryPreferred.json │ │ │ │ ├── PrimaryPreferred.yml │ │ │ │ ├── PrimaryPreferred_non_matching.json │ │ │ │ ├── PrimaryPreferred_non_matching.yml │ │ │ │ ├── Secondary.json │ │ │ │ ├── Secondary.yml │ │ │ │ ├── SecondaryPreferred.json │ │ │ │ ├── SecondaryPreferred.yml │ │ │ │ ├── SecondaryPreferred_non_matching.json │ │ │ │ ├── SecondaryPreferred_non_matching.yml │ │ │ │ ├── Secondary_multi_tags.json │ │ │ │ ├── Secondary_multi_tags.yml │ │ │ │ ├── Secondary_multi_tags2.json │ │ │ │ ├── Secondary_multi_tags2.yml │ │ │ │ ├── Secondary_non_matching.json │ │ │ │ └── Secondary_non_matching.yml │ │ │ └── write │ │ │ │ ├── SecondaryPreferred.json │ │ │ │ └── SecondaryPreferred.yml │ │ │ ├── ReplicaSetWithPrimary │ │ │ ├── read │ │ │ │ ├── Nearest.json │ │ │ │ ├── Nearest.yml │ │ │ │ ├── Nearest_multiple.json │ │ │ │ ├── Nearest_multiple.yml │ │ │ │ ├── Nearest_non_matching.json │ │ │ │ ├── Nearest_non_matching.yml │ │ │ │ ├── Primary.json │ │ │ │ ├── Primary.yml │ │ │ │ ├── PrimaryPreferred.json │ │ │ │ ├── PrimaryPreferred.yml │ │ │ │ ├── PrimaryPreferred_non_matching.json │ │ │ │ ├── PrimaryPreferred_non_matching.yml │ │ │ │ ├── Secondary.json │ │ │ │ ├── Secondary.yml │ │ │ │ ├── SecondaryPreferred.json │ │ │ │ ├── SecondaryPreferred.yml │ │ │ │ ├── SecondaryPreferred_non_matching.json │ │ │ │ ├── SecondaryPreferred_non_matching.yml │ │ │ │ ├── SecondaryPreferred_tags.json │ │ │ │ ├── SecondaryPreferred_tags.yml │ │ │ │ ├── Secondary_non_matching.json │ │ │ │ └── Secondary_non_matching.yml │ │ │ └── write │ │ │ │ ├── SecondaryPreferred.json │ │ │ │ └── SecondaryPreferred.yml │ │ │ ├── Sharded │ │ │ ├── read │ │ │ │ ├── Nearest.json │ │ │ │ ├── Nearest.yml │ │ │ │ ├── Primary.json │ │ │ │ ├── Primary.yml │ │ │ │ ├── PrimaryPreferred.json │ │ │ │ ├── PrimaryPreferred.yml │ │ │ │ ├── Secondary.json │ │ │ │ ├── Secondary.yml │ │ │ │ ├── SecondaryPreferred.json │ │ │ │ └── SecondaryPreferred.yml │ │ │ └── write │ │ │ │ ├── Nearest.json │ │ │ │ ├── Nearest.yml │ │ │ │ ├── Primary.json │ │ │ │ ├── Primary.yml │ │ │ │ ├── PrimaryPreferred.json │ │ │ │ ├── PrimaryPreferred.yml │ │ │ │ ├── Secondary.json │ │ │ │ ├── Secondary.yml │ │ │ │ ├── SecondaryPreferred.json │ │ │ │ └── SecondaryPreferred.yml │ │ │ ├── Single │ │ │ ├── read │ │ │ │ ├── SecondaryPreferred.json │ │ │ │ └── SecondaryPreferred.yml │ │ │ └── write │ │ │ │ ├── SecondaryPreferred.json │ │ │ │ └── SecondaryPreferred.yml │ │ │ └── Unknown │ │ │ ├── read │ │ │ ├── SecondaryPreferred.json │ │ │ └── SecondaryPreferred.yml │ │ │ └── write │ │ │ ├── SecondaryPreferred.json │ │ │ └── SecondaryPreferred.yml │ ├── auth │ │ ├── README.rst │ │ ├── connection-string.json │ │ └── connection-string.yml │ ├── change-streams │ │ ├── README.rst │ │ ├── change-streams-errors.json │ │ ├── change-streams-errors.yml │ │ ├── change-streams.json │ │ └── change-streams.yml │ ├── command-monitoring │ │ ├── README.rst │ │ ├── bulkWrite.json │ │ ├── bulkWrite.yml │ │ ├── command.json │ │ ├── command.yml │ │ ├── deleteMany.json │ │ ├── deleteMany.yml │ │ ├── deleteOne.json │ │ ├── deleteOne.yml │ │ ├── find.json │ │ ├── find.yml │ │ ├── insertMany.json │ │ ├── insertMany.yml │ │ ├── insertOne.json │ │ ├── insertOne.yml │ │ ├── unacknowledgedBulkWrite.json │ │ ├── unacknowledgedBulkWrite.yml │ │ ├── updateMany.json │ │ ├── updateMany.yml │ │ ├── updateOne.json │ │ └── updateOne.yml │ ├── connection_string │ │ ├── README.rst │ │ ├── invalid-uris.json │ │ ├── invalid-uris.yml │ │ ├── valid-auth.json │ │ ├── valid-auth.yml │ │ ├── valid-db-with-dotted-name.json │ │ ├── valid-db-with-dotted-name.yml │ │ ├── valid-host_identifiers.json │ │ ├── valid-host_identifiers.yml │ │ ├── valid-options.json │ │ ├── valid-options.yml │ │ ├── valid-unix_socket-absolute.json │ │ ├── valid-unix_socket-absolute.yml │ │ ├── valid-unix_socket-relative.json │ │ ├── valid-unix_socket-relative.yml │ │ ├── valid-warnings.json │ │ └── valid-warnings.yml │ ├── gridfs │ │ ├── .gitattributes │ │ ├── big.txt │ │ ├── data.bin │ │ ├── input.txt │ │ └── tests │ │ │ ├── delete.json │ │ │ ├── download.json │ │ │ └── upload.json │ ├── initial_dns_seedlist_discovery │ │ ├── README.rst │ │ ├── longer-parent-in-return.json │ │ ├── longer-parent-in-return.yml │ │ ├── misformatted-option.json │ │ ├── misformatted-option.yml │ │ ├── no-results.json │ │ ├── no-results.yml │ │ ├── not-enough-parts.json │ │ ├── not-enough-parts.yml │ │ ├── one-result-default-port.json │ │ ├── one-result-default-port.yml │ │ ├── one-txt-record-multiple-strings.json │ │ ├── one-txt-record-multiple-strings.yml │ │ ├── one-txt-record.json │ │ ├── one-txt-record.yml │ │ ├── parent-part-mismatch1.json │ │ ├── parent-part-mismatch1.yml │ │ ├── parent-part-mismatch2.json │ │ ├── parent-part-mismatch2.yml │ │ ├── parent-part-mismatch3.json │ │ ├── parent-part-mismatch3.yml │ │ ├── parent-part-mismatch4.json │ │ ├── parent-part-mismatch4.yml │ │ ├── parent-part-mismatch5.json │ │ ├── parent-part-mismatch5.yml │ │ ├── returned-parent-too-short.json │ │ ├── returned-parent-too-short.yml │ │ ├── returned-parent-wrong.json │ │ ├── returned-parent-wrong.yml │ │ ├── two-results-default-port.json │ │ ├── two-results-default-port.yml │ │ ├── two-results-nonstandard-port.json │ │ ├── two-results-nonstandard-port.yml │ │ ├── two-txt-records.json │ │ ├── two-txt-records.yml │ │ ├── txt-record-not-allowed-option.json │ │ ├── txt-record-not-allowed-option.yml │ │ ├── txt-record-with-overridden-ssl-option.json │ │ ├── txt-record-with-overridden-ssl-option.yml │ │ ├── txt-record-with-overridden-uri-option.json │ │ ├── txt-record-with-overridden-uri-option.yml │ │ ├── txt-record-with-unallowed-option.json │ │ ├── txt-record-with-unallowed-option.yml │ │ ├── uri-with-admin-database.json │ │ ├── uri-with-admin-database.yml │ │ ├── uri-with-auth.json │ │ ├── uri-with-auth.yml │ │ ├── uri-with-port.json │ │ ├── uri-with-port.yml │ │ ├── uri-with-two-hosts.json │ │ └── uri-with-two-hosts.yml │ ├── max_staleness │ │ ├── README.rst │ │ ├── ReplicaSetNoPrimary │ │ │ ├── DefaultNoMaxStaleness.json │ │ │ ├── DefaultNoMaxStaleness.yml │ │ │ ├── Incompatible.json │ │ │ ├── Incompatible.yml │ │ │ ├── LastUpdateTime.json │ │ │ ├── LastUpdateTime.yml │ │ │ ├── Nearest.json │ │ │ ├── Nearest.yml │ │ │ ├── Nearest2.json │ │ │ ├── Nearest2.yml │ │ │ ├── NoKnownServers.json │ │ │ ├── NoKnownServers.yml │ │ │ ├── PrimaryPreferred.json │ │ │ ├── PrimaryPreferred.yml │ │ │ ├── PrimaryPreferred_tags.json │ │ │ ├── PrimaryPreferred_tags.yml │ │ │ ├── Secondary.json │ │ │ ├── Secondary.yml │ │ │ ├── SecondaryPreferred.json │ │ │ ├── SecondaryPreferred.yml │ │ │ ├── SecondaryPreferred_tags.json │ │ │ ├── SecondaryPreferred_tags.yml │ │ │ ├── ZeroMaxStaleness.json │ │ │ └── ZeroMaxStaleness.yml │ │ ├── ReplicaSetWithPrimary │ │ │ ├── DefaultNoMaxStaleness.json │ │ │ ├── DefaultNoMaxStaleness.yml │ │ │ ├── Incompatible.json │ │ │ ├── Incompatible.yml │ │ │ ├── LastUpdateTime.json │ │ │ ├── LastUpdateTime.yml │ │ │ ├── LongHeartbeat.json │ │ │ ├── LongHeartbeat.yml │ │ │ ├── LongHeartbeat2.json │ │ │ ├── LongHeartbeat2.yml │ │ │ ├── MaxStalenessTooSmall.json │ │ │ ├── MaxStalenessTooSmall.yml │ │ │ ├── MaxStalenessWithModePrimary.json │ │ │ ├── MaxStalenessWithModePrimary.yml │ │ │ ├── Nearest.json │ │ │ ├── Nearest.yml │ │ │ ├── Nearest2.json │ │ │ ├── Nearest2.yml │ │ │ ├── Nearest_tags.json │ │ │ ├── Nearest_tags.yml │ │ │ ├── PrimaryPreferred.json │ │ │ ├── PrimaryPreferred.yml │ │ │ ├── PrimaryPreferred_incompatible.json │ │ │ ├── PrimaryPreferred_incompatible.yml │ │ │ ├── SecondaryPreferred.json │ │ │ ├── SecondaryPreferred.yml │ │ │ ├── SecondaryPreferred_tags.json │ │ │ ├── SecondaryPreferred_tags.yml │ │ │ ├── SecondaryPreferred_tags2.json │ │ │ ├── SecondaryPreferred_tags2.yml │ │ │ ├── Secondary_tags.json │ │ │ ├── Secondary_tags.yml │ │ │ ├── Secondary_tags2.json │ │ │ ├── Secondary_tags2.yml │ │ │ ├── ZeroMaxStaleness.json │ │ │ └── ZeroMaxStaleness.yml │ │ ├── Sharded │ │ │ ├── Incompatible.json │ │ │ ├── Incompatible.yml │ │ │ ├── SmallMaxStaleness.json │ │ │ └── SmallMaxStaleness.yml │ │ ├── Single │ │ │ ├── Incompatible.json │ │ │ ├── Incompatible.yml │ │ │ ├── SmallMaxStaleness.json │ │ │ └── SmallMaxStaleness.yml │ │ └── Unknown │ │ │ ├── SmallMaxStaleness.json │ │ │ └── SmallMaxStaleness.yml │ ├── read-write-concern │ │ ├── README.rst │ │ ├── connection-string │ │ │ ├── read-concern.json │ │ │ ├── read-concern.yml │ │ │ ├── write-concern.json │ │ │ └── write-concern.yml │ │ └── document │ │ │ ├── read-concern.json │ │ │ ├── read-concern.yml │ │ │ ├── write-concern.json │ │ │ └── write-concern.yml │ ├── retryable-reads │ │ ├── README.rst │ │ ├── aggregate-merge.json │ │ ├── aggregate-merge.yml │ │ ├── aggregate-serverErrors.json │ │ ├── aggregate-serverErrors.yml │ │ ├── aggregate.json │ │ ├── aggregate.yml │ │ ├── changeStreams-client.watch-serverErrors.json │ │ ├── changeStreams-client.watch-serverErrors.yml │ │ ├── changeStreams-client.watch.json │ │ ├── changeStreams-client.watch.yml │ │ ├── changeStreams-db.coll.watch-serverErrors.json │ │ ├── changeStreams-db.coll.watch-serverErrors.yml │ │ ├── changeStreams-db.coll.watch.json │ │ ├── changeStreams-db.coll.watch.yml │ │ ├── changeStreams-db.watch-serverErrors.json │ │ ├── changeStreams-db.watch-serverErrors.yml │ │ ├── changeStreams-db.watch.json │ │ ├── changeStreams-db.watch.yml │ │ ├── count-serverErrors.json │ │ ├── count-serverErrors.yml │ │ ├── count.json │ │ ├── count.yml │ │ ├── countDocuments-serverErrors.json │ │ ├── countDocuments-serverErrors.yml │ │ ├── countDocuments.json │ │ ├── countDocuments.yml │ │ ├── distinct-serverErrors.json │ │ ├── distinct-serverErrors.yml │ │ ├── distinct.json │ │ ├── distinct.yml │ │ ├── estimatedDocumentCount-serverErrors.json │ │ ├── estimatedDocumentCount-serverErrors.yml │ │ ├── estimatedDocumentCount.json │ │ ├── estimatedDocumentCount.yml │ │ ├── find-serverErrors.json │ │ ├── find-serverErrors.yml │ │ ├── find.json │ │ ├── find.yml │ │ ├── findOne-serverErrors.json │ │ ├── findOne-serverErrors.yml │ │ ├── findOne.json │ │ ├── findOne.yml │ │ ├── gridfs-download-serverErrors.json │ │ ├── gridfs-download-serverErrors.yml │ │ ├── gridfs-download.json │ │ ├── gridfs-download.yml │ │ ├── gridfs-downloadByName-serverErrors.json │ │ ├── gridfs-downloadByName-serverErrors.yml │ │ ├── gridfs-downloadByName.json │ │ ├── gridfs-downloadByName.yml │ │ ├── listCollectionNames-serverErrors.json │ │ ├── listCollectionNames-serverErrors.yml │ │ ├── listCollectionNames.json │ │ ├── listCollectionNames.yml │ │ ├── listCollectionObjects-serverErrors.json │ │ ├── listCollectionObjects-serverErrors.yml │ │ ├── listCollectionObjects.json │ │ ├── listCollectionObjects.yml │ │ ├── listCollections-serverErrors.json │ │ ├── listCollections-serverErrors.yml │ │ ├── listCollections.json │ │ ├── listCollections.yml │ │ ├── listDatabaseNames-serverErrors.json │ │ ├── listDatabaseNames-serverErrors.yml │ │ ├── listDatabaseNames.json │ │ ├── listDatabaseNames.yml │ │ ├── listDatabaseObjects-serverErrors.json │ │ ├── listDatabaseObjects-serverErrors.yml │ │ ├── listDatabaseObjects.json │ │ ├── listDatabaseObjects.yml │ │ ├── listDatabases-serverErrors.json │ │ ├── listDatabases-serverErrors.yml │ │ ├── listDatabases.json │ │ ├── listDatabases.yml │ │ ├── listIndexNames-serverErrors.json │ │ ├── listIndexNames-serverErrors.yml │ │ ├── listIndexNames.json │ │ ├── listIndexNames.yml │ │ ├── listIndexes-serverErrors.json │ │ ├── listIndexes-serverErrors.yml │ │ ├── listIndexes.json │ │ └── listIndexes.yml │ ├── retryable-writes │ │ ├── README.rst │ │ ├── bulkWrite-serverErrors.json │ │ ├── bulkWrite-serverErrors.yml │ │ ├── bulkWrite.json │ │ ├── bulkWrite.yml │ │ ├── deleteMany.json │ │ ├── deleteMany.yml │ │ ├── deleteOne-serverErrors.json │ │ ├── deleteOne-serverErrors.yml │ │ ├── deleteOne.json │ │ ├── deleteOne.yml │ │ ├── findOneAndDelete-serverErrors.json │ │ ├── findOneAndDelete-serverErrors.yml │ │ ├── findOneAndDelete.json │ │ ├── findOneAndDelete.yml │ │ ├── findOneAndReplace-serverErrors.json │ │ ├── findOneAndReplace-serverErrors.yml │ │ ├── findOneAndReplace.json │ │ ├── findOneAndReplace.yml │ │ ├── findOneAndUpdate-serverErrors.json │ │ ├── findOneAndUpdate-serverErrors.yml │ │ ├── findOneAndUpdate.json │ │ ├── findOneAndUpdate.yml │ │ ├── insertMany-serverErrors.json │ │ ├── insertMany-serverErrors.yml │ │ ├── insertMany.json │ │ ├── insertMany.yml │ │ ├── insertOne-serverErrors.json │ │ ├── insertOne-serverErrors.yml │ │ ├── insertOne.json │ │ ├── insertOne.yml │ │ ├── replaceOne-serverErrors.json │ │ ├── replaceOne-serverErrors.yml │ │ ├── replaceOne.json │ │ ├── replaceOne.yml │ │ ├── updateMany.json │ │ ├── updateMany.yml │ │ ├── updateOne-serverErrors.json │ │ ├── updateOne-serverErrors.yml │ │ ├── updateOne.json │ │ └── updateOne.yml │ ├── sessions │ │ ├── README.rst │ │ ├── dirty-session-errors.json │ │ └── dirty-session-errors.yml │ ├── transactions-convenient-api │ │ ├── README.rst │ │ ├── callback-aborts.json │ │ ├── callback-aborts.yml │ │ ├── callback-commits.json │ │ ├── callback-commits.yml │ │ ├── callback-retry.json │ │ ├── callback-retry.yml │ │ ├── commit-retry.json │ │ ├── commit-retry.yml │ │ ├── commit-transienttransactionerror-4.2.json │ │ ├── commit-transienttransactionerror-4.2.yml │ │ ├── commit-transienttransactionerror.json │ │ ├── commit-transienttransactionerror.yml │ │ ├── commit-writeconcernerror.json │ │ ├── commit-writeconcernerror.yml │ │ ├── commit.json │ │ ├── commit.yml │ │ ├── transaction-options.json │ │ ├── transaction-options.yml │ │ └── transactions-convenient-api.rst │ ├── transactions │ │ ├── README.rst │ │ ├── abort.json │ │ ├── abort.yml │ │ ├── bulk.json │ │ ├── bulk.yml │ │ ├── causal-consistency.json │ │ ├── causal-consistency.yml │ │ ├── commit.json │ │ ├── commit.yml │ │ ├── count.json │ │ ├── count.yml │ │ ├── delete.json │ │ ├── delete.yml │ │ ├── error-labels.json │ │ ├── error-labels.yml │ │ ├── errors-client.json │ │ ├── errors-client.yml │ │ ├── errors.json │ │ ├── errors.yml │ │ ├── findOneAndDelete.json │ │ ├── findOneAndDelete.yml │ │ ├── findOneAndReplace.json │ │ ├── findOneAndReplace.yml │ │ ├── findOneAndUpdate.json │ │ ├── findOneAndUpdate.yml │ │ ├── insert.json │ │ ├── insert.yml │ │ ├── isolation.json │ │ ├── isolation.yml │ │ ├── mongos-pin-auto-tests.py │ │ ├── mongos-pin-auto.json │ │ ├── mongos-pin-auto.yml │ │ ├── mongos-recovery-token.json │ │ ├── mongos-recovery-token.yml │ │ ├── pin-mongos.json │ │ ├── pin-mongos.yml │ │ ├── read-concern.json │ │ ├── read-concern.yml │ │ ├── read-pref.json │ │ ├── read-pref.yml │ │ ├── reads.json │ │ ├── reads.yml │ │ ├── retryable-abort.json │ │ ├── retryable-abort.yml │ │ ├── retryable-commit.json │ │ ├── retryable-commit.yml │ │ ├── retryable-writes.json │ │ ├── retryable-writes.yml │ │ ├── run-command.json │ │ ├── run-command.yml │ │ ├── transaction-options.json │ │ ├── transaction-options.yml │ │ ├── update.json │ │ ├── update.yml │ │ ├── write-concern.json │ │ └── write-concern.yml │ └── uri │ │ ├── README.rst │ │ ├── auth-options.json │ │ ├── auth-options.yml │ │ ├── ca.pem │ │ ├── cert.pem │ │ ├── client.pem │ │ ├── compression-options.json │ │ ├── compression-options.yml │ │ ├── concern-options.json │ │ ├── concern-options.yml │ │ ├── connection-options.json │ │ ├── connection-options.yml │ │ ├── connection-pool-options.json │ │ ├── connection-pool-options.yml │ │ ├── general.json │ │ ├── general.yml │ │ ├── read-preference-options.json │ │ ├── read-preference-options.yml │ │ ├── single-threaded-options.json │ │ ├── single-threaded-options.yml │ │ ├── tls-options.json │ │ └── tls-options.yml ├── database.t ├── dbref.t ├── deprecated │ ├── bson.t │ ├── collection.t │ ├── cursor.t │ ├── find_modifiers.t │ ├── parallel_scan.t │ ├── regexp_obj.t │ ├── types.t │ └── typewrappers.t ├── enumerate_databases.t ├── errors.t ├── examples │ ├── changestream.t │ ├── driver-examples.t │ └── transaction.t ├── find_modifiers.t ├── fsync.t ├── gridfs_spec.t ├── gridfsbucket.t ├── indexview.t ├── kill-cursor.t ├── lib │ ├── MongoDBSpecTest.pm │ ├── MongoDBTest.pm │ ├── MongoDBTest │ │ └── Callback.pm │ ├── TestBSON.pm │ └── TestCodecWrapper.pm ├── max_staleness_spec.t ├── max_time_ms.t ├── monitoring.t ├── monitoring_spec.t ├── oid_generation.t ├── op_msg.t ├── pre_encode_insert_update.t ├── protocol_op_msg.t ├── read_write_concern_spec.t ├── readpref.t ├── retryable-reads-spec.t ├── retryable-writes-command-construction.t ├── retryable-writes-spec.t ├── retryable-writes-split-batch.t ├── sdam_monitoring.t ├── sdam_spec.t ├── sessions-cursors.t ├── sessions-driver.t ├── sessions-end.t ├── sessions-spec.t ├── sessions-unacknowledged-write.t ├── ss_spec.t ├── testrules.yml ├── transactions-convenient-api-spec.t ├── transactions-convenient-api.t ├── transactions-mongos-pinning.t ├── transactions-spec.t ├── unit │ ├── configuration.t │ ├── link.t │ ├── read_preference.t │ ├── uri.t │ ├── uri_spec.t │ ├── uri_srv.t │ └── write_concern.t └── using_profiler.t ├── weaver.ini └── xt └── author └── circular-refs.t /.appveyor.yml: -------------------------------------------------------------------------------- 1 | cache: 2 | - C:\strawberry 3 | 4 | services: 5 | - mongodb 6 | 7 | install: 8 | - if not exist "C:\strawberry" choco install strawberryperl -y 9 | - set PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH% 10 | - cd %APPVEYOR_BUILD_FOLDER% 11 | - cpanm --quiet --installdeps --with-develop --notest . 12 | 13 | build_script: 14 | - perl -V 15 | - perl Makefile.PL 16 | - gmake 17 | 18 | test_script: 19 | - gmake test 20 | -------------------------------------------------------------------------------- /.evergreen/dependencies/test-perl5lib.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # 3 | # Copyright 2017 - present MongoDB, Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | use strict; 18 | use warnings; 19 | 20 | # Get helpers 21 | use FindBin qw($Bin); 22 | use lib "$Bin/../lib"; 23 | use EvergreenHelper; 24 | 25 | # Bootstrap 26 | bootstrap_env(); 27 | 28 | # Try loading a couple required modules 29 | require Path::Tiny; 30 | require Moo; 31 | 32 | exit 0; 33 | -------------------------------------------------------------------------------- /.evergreen/toolchain/validate-unix-perls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit 3 | 4 | for d in $(ls perl); do 5 | echo "*** CHECKING $d ***" 6 | thisperl="$(pwd)/perl/$d" 7 | PERL5LIB="$thisperl/lib" $thisperl/bin/perl -v 8 | PERL5LIB="$thisperl/lib" $thisperl/bin/perl -V 9 | echo "" 10 | done 11 | -------------------------------------------------------------------------------- /.evergreen/toolchain/validate-win-perls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit 3 | 4 | for d in $(ls perl); do 5 | echo "*** CHECKING $d ***" 6 | thisperl="$(pwd)/perl/$d/perl/bin/perl" 7 | "$thisperl" -v 8 | "$thisperl" -V 9 | echo "" 10 | done 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | xs/BSON.c 3 | !perl_mongo.c 4 | !mongo_link.c 5 | *.o 6 | *.obj 7 | vc90.pdb 8 | MongoDB.def 9 | MongoDB_def.old 10 | Makefile* 11 | !Makefile.PL 12 | blib 13 | pm_to_blib 14 | Debian* 15 | MongoDB-* 16 | *.bs 17 | *~ 18 | META.yml 19 | pod/* 20 | config.log 21 | dll.base 22 | dll.exp 23 | MYMETA.json 24 | MYMETA.yml 25 | output.txt 26 | /nyt* 27 | /tags 28 | /.build 29 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-labs/mongo-perl-driver/6ea528c8051368f253583668e37bc452acb5a632/.gitmodules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CONTRIBUTING.md -------------------------------------------------------------------------------- /devel/bench/cpanfile: -------------------------------------------------------------------------------- 1 | requires "Benchmark::Lab"; 2 | requires "JSON::MaybeXS"; 3 | requires "Parallel::ForkManager"; 4 | requires "Path::Tiny"; 5 | requires "Time::Moment"; 6 | -------------------------------------------------------------------------------- /devel/certs/.gitignore: -------------------------------------------------------------------------------- 1 | /CA.pl 2 | /demoCA 3 | /newkey.pem 4 | /newreq.pem 5 | /newcert.pem 6 | -------------------------------------------------------------------------------- /devel/certs/README.txt: -------------------------------------------------------------------------------- 1 | # How to generate test certs 2 | 3 | 1. Install openssl and find the "CA.pl" file that ships with it. On 4 | linux that might be "/usr/lib/ssl/misc/CA.pl". On OS X with MacPorts, 5 | that is "/opt/local/etc/openssl/misc/CA.pl". 6 | 7 | find / -name CA.pl 8 | 9 | 2. Copy the CA.pl file and patch it with CA.pl.patch to eliminate passwords 10 | and set expiration time to 10 years for everything. 11 | 12 | cp /opt/local/etc/openssl/misc/CA.pl . 13 | patch < CA.pl.patch 14 | 15 | 2. Use the local, custom CA.pl file to generate a demo CA: 16 | 17 | ./CA.pl -newCA 18 | 19 | 3. Generate a certificate: 20 | 21 | ./CA.pl -newreq 22 | ./CA.pl -sign 23 | cat newkey.pem newcert.pem > somename.pem 24 | 25 | somename.pem can be edited to remove plaintext parts if needed. 26 | -------------------------------------------------------------------------------- /devel/config/master-2.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --master 4 | default_version: "2.2" 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/master-any-inMemory.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --nojournal --bind_ip 0.0.0.0 --master --storageEngine=inMemoryExperiment 4 | default_version: ">=2.0" 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/master-any-wiredtiger.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --nojournal --bind_ip 0.0.0.0 --master --storageEngine=wiredTiger 4 | default_version: ">=2.0" 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/master-any.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --bind_ip 0.0.0.0 --nssize 6 --master 4 | default_version: ">=2.0" 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-2.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 4 | default_version: 2.0 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-2.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 4 | default_version: 2.2 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-2.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 4 | default_version: 2.4 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-2.6-auth.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 4 | default_version: 2.6 5 | auth: 6 | user: root 7 | password: toor 8 | mongod: 9 | - name: host1 10 | -------------------------------------------------------------------------------- /devel/config/mongod-2.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 4 | default_version: 2.6 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-3.0-mmapv1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --bind_ip 0.0.0.0 --nssize 6 --storageEngine=mmapv1 4 | default_version: v3.0 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-3.0-scram.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --setParameter authenticationMechanisms=SCRAM-SHA-1 4 | default_version: v3.0 5 | auth: 6 | user: root 7 | password: toor 8 | mongod: 9 | - name: host1 10 | -------------------------------------------------------------------------------- /devel/config/mongod-3.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 4 | default_version: 3.0 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-3.2-auth.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --nojournal --nohttpinterface --enableMajorityReadConcern 4 | default_version: 3.2 5 | auth: 6 | user: root 7 | password: toor 8 | mongod: 9 | - name: host1 10 | -------------------------------------------------------------------------------- /devel/config/mongod-3.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --nojournal --nohttpinterface --enableMajorityReadConcern 4 | default_version: 3.2 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-3.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --nohttpinterface --enableMajorityReadConcern 4 | default_version: 3.4 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-3.6-compression-zlib.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --networkMessageCompressors zlib 4 | default_version: 3.6 5 | mongod: 6 | - name: host1 7 | 8 | -------------------------------------------------------------------------------- /devel/config/mongod-3.6-mmapv1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --storageEngine=mmapv1 4 | default_version: 3.6 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-3.6-ssl.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern 4 | default_version: v3.6 5 | ssl_config: 6 | mode: requireSSL 7 | servercn: "CN=localhost,OU=Server,O=MongoDB,L=New York,ST=New York,C=US" 8 | certs: 9 | server: devel/certs/server.pem 10 | ca: devel/certs/ca.pem 11 | mongod: 12 | - name: host1 13 | 14 | # vim: ts=4 sts=4 sw=4 et: 15 | -------------------------------------------------------------------------------- /devel/config/mongod-3.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern 4 | default_version: 3.6 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-4.0-scram.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 4 | default_version: v4.0 5 | default_fcv: "4.0" 6 | auth: 7 | user: root 8 | password: toor 9 | mongod: 10 | - name: host1 11 | -------------------------------------------------------------------------------- /devel/config/mongod-4.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern 4 | default_version: 4.0 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-4.1.5.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern 4 | default_version: 4.1.5 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-4.2-auth.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 4 | default_version: 4.2 5 | auth: 6 | user: root 7 | password: toor 8 | mongod: 9 | - name: host1 10 | -------------------------------------------------------------------------------- /devel/config/mongod-4.2-ssl.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern 4 | ssl_config: 5 | mode: requireSSL 6 | servercn: "CN=localhost,OU=Server,O=MongoDB,L=New York,ST=New York,C=US" 7 | certs: 8 | server: devel/certs/server.pem 9 | ca: devel/certs/ca.pem 10 | mongod: 11 | - name: host1 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/mongod-4.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern 4 | default_version: 4.2 5 | mongod: 6 | - name: host1 7 | -------------------------------------------------------------------------------- /devel/config/mongod-any-inMemory.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --nojournal --bind_ip 0.0.0.0 --storageEngine=inMemoryExperiment 4 | mongod: 5 | - name: host1 6 | -------------------------------------------------------------------------------- /devel/config/mongod-any-ssl.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern 4 | ssl_config: 5 | mode: requireSSL 6 | servercn: "CN=localhost,OU=Server,O=MongoDB,L=New York,ST=New York,C=US" 7 | certs: 8 | server: devel/certs/server.pem 9 | ca: devel/certs/ca.pem 10 | mongod: 11 | - name: host1 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/mongod-any-tls1_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern 4 | ssl_config: 5 | mode: requireSSL 6 | servercn: "CN=localhost,OU=Server,O=MongoDB,L=New York,ST=New York,C=US" 7 | certs: 8 | server: devel/certs/server.pem 9 | ca: devel/certs/ca.pem 10 | disabled_protocols: 11 | - TLS1_0 12 | - TLS1_1 13 | mongod: 14 | - name: host1 15 | 16 | # vim: ts=4 sts=4 sw=4 et: 17 | -------------------------------------------------------------------------------- /devel/config/mongod-any-wiredtiger.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --nojournal --bind_ip 0.0.0.0 --storageEngine=wiredTiger 4 | mongod: 5 | - name: host1 6 | -------------------------------------------------------------------------------- /devel/config/mongod-any.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --bind_ip 0.0.0.0 --nssize 6 4 | mongod: 5 | - name: host1 6 | -------------------------------------------------------------------------------- /devel/config/replicaset-2.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | default_version: 2.0 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | 10 | # vim: ts=4 sts=4 sw=4 et: 11 | -------------------------------------------------------------------------------- /devel/config/replicaset-2.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | default_version: 2.2 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | 10 | # vim: ts=4 sts=4 sw=4 et: 11 | -------------------------------------------------------------------------------- /devel/config/replicaset-2.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | default_version: 2.4 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | 10 | # vim: ts=4 sts=4 sw=4 et: 11 | -------------------------------------------------------------------------------- /devel/config/replicaset-2.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | default_version: 2.6 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | rs_config: 11 | arbiterOnly: true 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/replicaset-3.0-auth.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | default_version: 3.0 6 | auth: 7 | user: root 8 | password: toor 9 | mongod: 10 | - name: host1 11 | - name: host2 12 | - name: host3 13 | rs_config: 14 | arbiterOnly: true 15 | 16 | # vim: ts=4 sts=4 sw=4 et: 17 | -------------------------------------------------------------------------------- /devel/config/replicaset-3.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | default_version: 3.0 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | rs_config: 11 | arbiterOnly: true 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/replicaset-3.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --nojournal --nohttpinterface --enableMajorityReadConcern --quiet 5 | default_version: 3.2 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | rs_config: 11 | arbiterOnly: true 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/replicaset-3.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --nohttpinterface --enableMajorityReadConcern --quiet 5 | default_version: 3.4 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | rs_config: 11 | arbiterOnly: true 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/replicaset-3.6-auth.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: 3.6 6 | auth: 7 | user: root 8 | password: toor 9 | mongod: 10 | - name: host1 11 | - name: host2 12 | - name: host3 13 | rs_config: 14 | arbiterOnly: true 15 | 16 | # vim: ts=4 sts=4 sw=4 et: 17 | -------------------------------------------------------------------------------- /devel/config/replicaset-3.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: 3.6 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | rs_config: 11 | arbiterOnly: true 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.0-auth.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: v4.0 6 | auth: 7 | user: root 8 | password: toor 9 | mongod: 10 | - name: host1 11 | - name: host2 12 | - name: host3 13 | 14 | # vim: ts=4 sts=4 sw=4 et: 15 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.0-mmapv1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet --storageEngine=mmapv1 5 | default_version: v4.0 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | 11 | # vim: ts=4 sts=4 sw=4 et: 12 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: v4.0 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | 11 | # vim: ts=4 sts=4 sw=4 et: 12 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: v4.1 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | 11 | # vim: ts=4 sts=4 sw=4 et: 12 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.2-auth-hidden.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | auth: 6 | user: root 7 | password: toor 8 | mongod: 9 | - name: host1 10 | - name: host2 11 | - name: host3 12 | - name: host4 13 | rs_config: 14 | priority: 0 15 | hidden: true 16 | 17 | # vim: ts=4 sts=4 sw=4 et: 18 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.2-hidden-auth.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: v4.2 6 | auth: 7 | user: root 8 | password: toor 9 | mongod: 10 | - name: host1 11 | - name: host2 12 | - name: host3 13 | - name: host4 14 | rs_config: 15 | priority: 0 16 | hidden: true 17 | 18 | # vim: ts=4 sts=4 sw=4 et: 19 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.2-hidden.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: v4.2 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | - name: host4 11 | rs_config: 12 | priority: 0 13 | hidden: true 14 | 15 | # vim: ts=4 sts=4 sw=4 et: 16 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: v4.2 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | 11 | # vim: ts=4 sts=4 sw=4 et: 12 | -------------------------------------------------------------------------------- /devel/config/replicaset-4.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: v4.4 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | 11 | # vim: ts=4 sts=4 sw=4 et: 12 | -------------------------------------------------------------------------------- /devel/config/replicaset-any-27017-single.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 5 | mongod: 6 | - name: host1 7 | port_override: 27017 8 | 9 | # vim: ts=4 sts=4 sw=4 et: 10 | 11 | -------------------------------------------------------------------------------- /devel/config/replicaset-any-27017.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: repl0 4 | default_args: -v --bind_ip 0.0.0.0 --quiet 5 | mongod: 6 | - name: host1 7 | port_override: 27017 8 | - name: host2 9 | port_override: 27018 10 | - name: host3 11 | port_override: 27019 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/replicaset-any-inMemory.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --nojournal --bind_ip 0.0.0.0 --quiet --storageEngine=inMemoryExperiment 5 | mongod: 6 | - name: host1 7 | - name: host2 8 | - name: host3 9 | rs_config: 10 | arbiterOnly: true 11 | 12 | # vim: ts=4 sts=4 sw=4 et: 13 | -------------------------------------------------------------------------------- /devel/config/replicaset-any-ssl.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --noprealloc --nojournal --smallfiles --nssize 6 --quiet 5 | ssl_config: 6 | mode: requireSSL 7 | servercn: "CN=localhost,OU=Server,O=MongoDB,L=New York,ST=New York,C=US" 8 | certs: 9 | server: devel/certs/server.pem 10 | ca: devel/certs/ca.pem 11 | mongod: 12 | - name: host1 13 | - name: host2 14 | - name: host3 15 | rs_config: 16 | arbiterOnly: true 17 | 18 | # vim: ts=4 sts=4 sw=4 et: 19 | -------------------------------------------------------------------------------- /devel/config/replicaset-any-w_auth_hidden.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 5 | auth: 6 | user: root 7 | password: toor 8 | mongod: 9 | - name: host1 10 | - name: host2 11 | - name: host3 12 | rs_config: 13 | priority: 0 14 | hidden: true 15 | 16 | # vim: ts=4 sts=4 sw=4 et: 17 | -------------------------------------------------------------------------------- /devel/config/replicaset-any-wiredtiger.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --nojournal --bind_ip 0.0.0.0 --quiet --storageEngine=wiredTiger 5 | mongod: 6 | - name: host1 7 | - name: host2 8 | - name: host3 9 | rs_config: 10 | arbiterOnly: true 11 | 12 | # vim: ts=4 sts=4 sw=4 et: 13 | -------------------------------------------------------------------------------- /devel/config/replicaset-any.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --noprealloc --nojournal --smallfiles --nssize 6 --quiet 5 | mongod: 6 | - name: host1 7 | - name: host2 8 | - name: host3 9 | rs_config: 10 | arbiterOnly: true 11 | 12 | # vim: ts=4 sts=4 sw=4 et: 13 | -------------------------------------------------------------------------------- /devel/config/replicaset-mixed.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | mongod: 6 | - name: host1 7 | version: 2.6 8 | - name: host2 9 | version: 2.4 10 | 11 | # vim: ts=4 sts=4 sw=4 et: 12 | -------------------------------------------------------------------------------- /devel/config/replicaset-multi-3.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 5 | default_version: 3.6 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | 11 | # vim: ts=4 sts=4 sw=4 et: 12 | -------------------------------------------------------------------------------- /devel/config/replicaset-multi-4.0-w_arbiter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 5 | default_version: 4.0 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | rs_config: 11 | arbiterOnly: true 12 | 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/replicaset-multi-4.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 5 | default_version: 4.0 6 | mongod: 7 | - name: host1 8 | - name: host2 9 | - name: host3 10 | 11 | # vim: ts=4 sts=4 sw=4 et: 12 | -------------------------------------------------------------------------------- /devel/config/replicaset-single-3.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | default_version: 3.2 6 | mongod: 7 | - name: host1 8 | 9 | # vim: ts=4 sts=4 sw=4 et: 10 | -------------------------------------------------------------------------------- /devel/config/replicaset-single-3.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 5 | default_version: 3.4 6 | mongod: 7 | - name: host1 8 | 9 | # vim: ts=4 sts=4 sw=4 et: 10 | -------------------------------------------------------------------------------- /devel/config/replicaset-single-3.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 5 | default_version: 3.6 6 | mongod: 7 | - name: host1 8 | 9 | # vim: ts=4 sts=4 sw=4 et: 10 | -------------------------------------------------------------------------------- /devel/config/replicaset-single-4.0-ssl.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: 4.0 6 | ssl_config: 7 | mode: requireSSL 8 | servercn: "CN=localhost,OU=Server,O=MongoDB,L=New York,ST=New York,C=US" 9 | certs: 10 | server: devel/certs/server.pem 11 | ca: devel/certs/ca.pem 12 | mongod: 13 | - name: host1 14 | 15 | # vim: ts=4 sts=4 sw=4 et: 16 | -------------------------------------------------------------------------------- /devel/config/replicaset-single-4.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: 4.0 6 | mongod: 7 | - name: host1 8 | 9 | # vim: ts=4 sts=4 sw=4 et: 10 | -------------------------------------------------------------------------------- /devel/config/replicaset-single-4.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --bind_ip 0.0.0.0 --enableMajorityReadConcern --quiet 5 | default_version: 4.2 6 | mongod: 7 | - name: host1 8 | 9 | # vim: ts=4 sts=4 sw=4 et: 10 | -------------------------------------------------------------------------------- /devel/config/replicaset-single-any.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: replica 3 | setName: foo 4 | default_args: -v --noprealloc --nojournal --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 5 | mongod: 6 | - name: host1 7 | 8 | # vim: ts=4 sts=4 sw=4 et: 9 | -------------------------------------------------------------------------------- /devel/config/rsghost-any.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: single 3 | default_args: -v --noprealloc --nojournal --smallfiles --bind_ip 0.0.0.0 --nssize 6 --replSet foo 4 | mongod: 5 | - name: host1 6 | -------------------------------------------------------------------------------- /devel/config/sharded-2.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 4 | default_version: 2.0 5 | mongoc: 6 | - name: config1 7 | mongos: 8 | - name: router1 9 | shards: 10 | - name: sh1 11 | type: single 12 | mongod: 13 | - name: db1 14 | # vim: ts=4 sts=4 sw=4 et: 15 | -------------------------------------------------------------------------------- /devel/config/sharded-2.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 4 | default_version: 2.2 5 | mongoc: 6 | - name: config1 7 | mongos: 8 | - name: router1 9 | shards: 10 | - name: sh1 11 | type: single 12 | mongod: 13 | - name: db1 14 | # vim: ts=4 sts=4 sw=4 et: 15 | -------------------------------------------------------------------------------- /devel/config/sharded-2.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 4 | default_version: 2.4 5 | mongoc: 6 | - name: config1 7 | mongos: 8 | - name: router1 9 | shards: 10 | - name: sh1 11 | type: single 12 | mongod: 13 | - name: db1 14 | # vim: ts=4 sts=4 sw=4 et: 15 | -------------------------------------------------------------------------------- /devel/config/sharded-2.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 4 | default_version: 2.6 5 | mongoc: 6 | - name: config1 7 | mongos: 8 | - name: router1 9 | shards: 10 | - name: sh1 11 | type: single 12 | mongod: 13 | - name: db1 14 | # vim: ts=4 sts=4 sw=4 et: 15 | -------------------------------------------------------------------------------- /devel/config/sharded-2mongos-3.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: --nohttpinterface --quiet 4 | default_version: 3.4 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | - name: router2 12 | shards: 13 | - name: sh1 14 | type: single 15 | mongod: 16 | - name: db1 17 | args: --enableMajorityReadConcern 18 | # vim: ts=4 sts=4 sw=4 et: 19 | -------------------------------------------------------------------------------- /devel/config/sharded-2mongos-4.1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 4.1 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | - name: router2 12 | shards: 13 | - name: sh1 14 | type: replica 15 | mongod: 16 | - name: host1 17 | - name: host2 18 | - name: host3 19 | # vim: ts=4 sts=4 sw=4 et: 20 | -------------------------------------------------------------------------------- /devel/config/sharded-2mongos.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: --noprealloc --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 4 | mongoc: 5 | - name: config1 6 | - name: config2 7 | - name: config3 8 | mongos: 9 | - name: router1 10 | - name: router2 11 | shards: 12 | - name: sh1 13 | type: single 14 | mongod: 15 | - name: db1 16 | # vim: ts=4 sts=4 sw=4 et: 17 | -------------------------------------------------------------------------------- /devel/config/sharded-2rs-2.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 4 | default_version: 2.6 5 | mongoc: 6 | - name: config1 7 | mongos: 8 | - name: router1 9 | shards: 10 | - name: sh1 11 | type: replica 12 | mongod: 13 | - name: host1 14 | - name: host2 15 | - name: host3 16 | rs_config: 17 | arbiterOnly: true 18 | - name: sh2 19 | type: replica 20 | mongod: 21 | - name: host4 22 | - name: host5 23 | - name: host6 24 | rs_config: 25 | arbiterOnly: true 26 | # vim: ts=4 sts=4 sw=4 et: 27 | -------------------------------------------------------------------------------- /devel/config/sharded-2rs-3.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 3.6 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | - name: router2 12 | shards: 13 | - name: sh1 14 | type: replica 15 | mongod: 16 | - name: host1 17 | - name: host2 18 | - name: host3 19 | # vim: ts=4 sts=4 sw=4 et: 20 | -------------------------------------------------------------------------------- /devel/config/sharded-3.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 4 | default_version: 3.0 5 | mongoc: 6 | - name: config1 7 | mongos: 8 | - name: router1 9 | shards: 10 | - name: sh1 11 | type: single 12 | mongod: 13 | - name: db1 14 | # vim: ts=4 sts=4 sw=4 et: 15 | -------------------------------------------------------------------------------- /devel/config/sharded-3.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --nohttpinterface --quiet 4 | default_version: 3.2 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | shards: 12 | - name: sh1 13 | type: single 14 | mongod: 15 | - name: db1 16 | args: --enableMajorityReadConcern 17 | # vim: ts=4 sts=4 sw=4 et: 18 | -------------------------------------------------------------------------------- /devel/config/sharded-3.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: --nohttpinterface --quiet 4 | default_version: 3.4 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | shards: 12 | - name: sh1 13 | type: single 14 | mongod: 15 | - name: db1 16 | args: --enableMajorityReadConcern 17 | # vim: ts=4 sts=4 sw=4 et: 18 | -------------------------------------------------------------------------------- /devel/config/sharded-3.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 3.6 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | shards: 12 | - name: sh1 13 | type: replica 14 | mongod: 15 | - name: host1 16 | # vim: ts=4 sts=4 sw=4 et: 17 | -------------------------------------------------------------------------------- /devel/config/sharded-4.0.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 4.0 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | shards: 12 | - name: sh1 13 | type: replica 14 | mongod: 15 | - name: host1 16 | - name: host2 17 | - name: host3 18 | # vim: ts=4 sts=4 sw=4 et: 19 | -------------------------------------------------------------------------------- /devel/config/sharded-4.1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 4.1 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | shards: 12 | - name: sh1 13 | type: replica 14 | mongod: 15 | - name: host1 16 | - name: host2 17 | - name: host3 18 | # vim: ts=4 sts=4 sw=4 et: 19 | -------------------------------------------------------------------------------- /devel/config/sharded-4.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 4.2 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | mongos: 9 | - name: router1 10 | - name: router2 11 | shards: 12 | - name: sh1 13 | type: replica 14 | mongod: 15 | - name: host1 16 | - name: sh2 17 | type: replica 18 | mongod: 19 | - name: host2 20 | # vim: ts=4 sts=4 sw=4 et: 21 | -------------------------------------------------------------------------------- /devel/config/sharded-any-inMemory.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | mongoc: 5 | - name: config1 6 | mongos: 7 | - name: router1 8 | shards: 9 | - name: sh1 10 | type: single 11 | mongod: 12 | - name: db1 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/sharded-any-wiredtiger.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --nojournal --bind_ip 0.0.0.0 --quiet --storageEngine=wiredTiger 4 | mongoc: 5 | - name: config1 6 | mongos: 7 | - name: router1 8 | shards: 9 | - name: sh1 10 | type: single 11 | mongod: 12 | - name: db1 13 | # vim: ts=4 sts=4 sw=4 et: 14 | -------------------------------------------------------------------------------- /devel/config/sharded-any.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: --noprealloc --smallfiles --bind_ip 0.0.0.0 --nssize 6 --quiet 4 | mongoc: 5 | - name: config1 6 | - name: config2 7 | - name: config3 8 | mongos: 9 | - name: router1 10 | shards: 11 | - name: sh1 12 | type: single 13 | mongod: 14 | - name: db1 15 | # vim: ts=4 sts=4 sw=4 et: 16 | -------------------------------------------------------------------------------- /devel/config/sharded-rs-3.4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 3.4 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | shards: 12 | - name: sh1 13 | type: replica 14 | mongod: 15 | - name: host1 16 | - name: host2 17 | - name: host3 18 | # vim: ts=4 sts=4 sw=4 et: 19 | -------------------------------------------------------------------------------- /devel/config/sharded-rs-3.6.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 3.6 5 | mongoc: 6 | - name: config1 7 | - name: config2 8 | - name: config3 9 | mongos: 10 | - name: router1 11 | shards: 12 | - name: sh1 13 | type: replica 14 | mongod: 15 | - name: host1 16 | - name: host2 17 | - name: host3 18 | # vim: ts=4 sts=4 sw=4 et: 19 | -------------------------------------------------------------------------------- /devel/config/sharded-single-4.2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --bind_ip 0.0.0.0 --quiet 4 | default_version: 4.2 5 | mongoc: 6 | - name: config1 7 | mongos: 8 | - name: router1 9 | shards: 10 | - name: sh1 11 | type: replica 12 | mongod: 13 | - name: host1 14 | # vim: ts=4 sts=4 sw=4 et: 15 | -------------------------------------------------------------------------------- /devel/cpanfile: -------------------------------------------------------------------------------- 1 | requires "CPAN::Meta::Requirements"; 2 | requires "IPC::Cmd"; 3 | requires "JSON"; 4 | requires "Log::Any::Adapter"; 5 | requires "MongoDB"; 6 | requires "Moo"; 7 | requires "MooseX::Role::Logger"; 8 | requires "Net::EmptyPort"; 9 | requires "Path::Tiny"; 10 | requires "Proc::Guard" => 0.07; 11 | requires "Sys::Hostname"; 12 | requires 'Test::DNS'; 13 | requires 'Test::Instance::DNS'; 14 | requires 'Test::Warnings'; 15 | requires "Try::Tiny::Retry" => 0.004; 16 | requires "Type::Utils"; 17 | requires "Types::Path::Tiny"; 18 | requires "Types::Standard"; 19 | requires "Version::Next"; 20 | requires "YAML::XS" => 0.67; 21 | requires "namespace::clean"; 22 | requires "version"; 23 | -------------------------------------------------------------------------------- /devel/lib/MongoDBTest/ServerSet.pm: -------------------------------------------------------------------------------- 1 | # Copyright 2014 - present MongoDB, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | use 5.010; 16 | use strict; 17 | use warnings; 18 | 19 | package MongoDBTest::ServerSet; 20 | 21 | use Moo; 22 | use namespace::clean; 23 | 24 | with 'MooseX::Role::Logger', 'MongoDBTest::Role::ServerSet'; 25 | 26 | 1; 27 | -------------------------------------------------------------------------------- /devel/t-dynamic/sharded-2.4-mixed.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 4 | default_version: 2.4 5 | mongoc: 6 | - name: config1 7 | version: 2.6 8 | mongos: 9 | - name: router1 10 | shards: 11 | - name: sh1 12 | type: single 13 | mongod: 14 | - name: host1 15 | version: 2.4 16 | - name: sh2 17 | type: single 18 | mongod: 19 | - name: host2 20 | version: 2.6 21 | # vim: ts=4 sts=4 sw=4 et: 22 | -------------------------------------------------------------------------------- /devel/t-dynamic/sharded-2.6-mixed.yml: -------------------------------------------------------------------------------- 1 | --- 2 | type: sharded 3 | default_args: -v --noprealloc --nojournal --smallfiles --nohttpinterface --nssize 6 --quiet 4 | default_version: 2.6 5 | mongoc: 6 | - name: config1 7 | mongos: 8 | - name: router1 9 | shards: 10 | - name: sh1 11 | type: single 12 | mongod: 13 | - name: host1 14 | version: 2.4 15 | - name: sh2 16 | type: single 17 | mongod: 18 | - name: host2 19 | version: 2.6 20 | # vim: ts=4 sts=4 sw=4 et: 21 | -------------------------------------------------------------------------------- /inc/Makefile.footer: -------------------------------------------------------------------------------- 1 | package MY; 2 | 3 | sub postamble { 4 | my $self = shift; 5 | return $self->SUPER::postamble . <<'HERE'; 6 | 7 | cover : pure_all 8 | HARNESS_PERL_SWITCHES=-MDevel::Cover make test 9 | 10 | ptest : pure_all 11 | HARNESS_OPTIONS=j9 make test 12 | 13 | HERE 14 | } 15 | 16 | package main; 17 | -------------------------------------------------------------------------------- /lib/MongoDB/Role/_CursorAPI.pm: -------------------------------------------------------------------------------- 1 | # Copyright 2016 - present MongoDB, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | use strict; 16 | use warnings; 17 | package MongoDB::Role::_CursorAPI; 18 | 19 | # Role providing a cursor interface 20 | 21 | use version; 22 | our $VERSION = 'v2.2.3'; 23 | 24 | use Moo::Role; 25 | use namespace::clean; 26 | 27 | requires qw/all has_next next/; 28 | 29 | 1; 30 | -------------------------------------------------------------------------------- /perlcritic.rc: -------------------------------------------------------------------------------- 1 | severity = 5 2 | verbose = [%p] %m at %f, line %l, column %c. (Severity: %s)\n 3 | 4 | [Variables::ProhibitPunctuationVars] 5 | allow = $@ $! 6 | 7 | [TestingAndDebugging::ProhibitNoStrict] 8 | allow = refs 9 | 10 | [Variables::ProhibitEvilVariables] 11 | variables = $DB::single 12 | 13 | # Turn these off 14 | [-BuiltinFunctions::ProhibitStringyEval] 15 | [-ControlStructures::ProhibitPostfixControls] 16 | [-ControlStructures::ProhibitUnlessBlocks] 17 | [-Documentation::RequirePodSections] 18 | [-InputOutput::ProhibitInteractiveTest] 19 | [-References::ProhibitDoubleSigils] 20 | [-RegularExpressions::RequireExtendedFormatting] 21 | [-InputOutput::ProhibitTwoArgOpen] 22 | [-Modules::ProhibitEvilModules] 23 | 24 | # Turn this on 25 | [Lax::ProhibitStringyEval::ExceptForRequire] 26 | 27 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/aggregate-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": "ping" 6 | } 7 | ], 8 | "minServerVersion": "3.4", 9 | "tests": [ 10 | { 11 | "description": "Aggregate with collation", 12 | "operation": { 13 | "name": "aggregate", 14 | "arguments": { 15 | "pipeline": [ 16 | { 17 | "$match": { 18 | "x": "PING" 19 | } 20 | } 21 | ], 22 | "collation": { 23 | "locale": "en_US", 24 | "strength": 2 25 | } 26 | } 27 | }, 28 | "outcome": { 29 | "result": [ 30 | { 31 | "_id": 1, 32 | "x": "ping" 33 | } 34 | ] 35 | } 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/aggregate-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 'ping'} 3 | minServerVersion: '3.4' 4 | 5 | tests: 6 | - 7 | description: "Aggregate with collation" 8 | operation: 9 | name: aggregate 10 | arguments: 11 | pipeline: 12 | - $match: 13 | x: 'PING' 14 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 15 | outcome: 16 | result: 17 | - {_id: 1, x: 'ping'} 18 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/aggregate.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 22} 4 | - {_id: 3, x: 33} 5 | 6 | tests: 7 | - 8 | description: "Aggregate with multiple stages" 9 | operation: 10 | name: aggregate 11 | arguments: 12 | pipeline: 13 | - $sort: {x: 1} 14 | - $match: 15 | _id: {$gt: 1} 16 | batchSize: 2 17 | 18 | outcome: 19 | result: 20 | - {_id: 2, x: 22} 21 | - {_id: 3, x: 33} 22 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/count-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 'PING'} 3 | minServerVersion: '3.4' 4 | 5 | tests: 6 | - 7 | description: "Count documents with collation" 8 | operation: 9 | name: countDocuments 10 | arguments: 11 | filter: { x: 'ping' } 12 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 13 | 14 | outcome: 15 | result: 1 16 | - 17 | description: "Deprecated count with collation" 18 | operation: 19 | name: count 20 | arguments: 21 | filter: { x: 'ping' } 22 | collation: { locale: 'en_US', strength: 2 } 23 | 24 | outcome: 25 | result: 1 26 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/count-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [], 3 | "tests": [ 4 | { 5 | "description": "Estimated document count with empty collection", 6 | "operation": { 7 | "name": "estimatedDocumentCount", 8 | "arguments": {} 9 | }, 10 | "outcome": { 11 | "result": 0 12 | } 13 | }, 14 | { 15 | "description": "Count documents with empty collection", 16 | "operation": { 17 | "name": "countDocuments", 18 | "arguments": { 19 | "filter": {} 20 | } 21 | }, 22 | "outcome": { 23 | "result": 0 24 | } 25 | }, 26 | { 27 | "description": "Deprecated count with empty collection", 28 | "operation": { 29 | "name": "count", 30 | "arguments": { 31 | "filter": {} 32 | } 33 | }, 34 | "outcome": { 35 | "result": 0 36 | } 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/count-empty.yml: -------------------------------------------------------------------------------- 1 | data: [] 2 | 3 | tests: 4 | - 5 | description: "Estimated document count with empty collection" 6 | operation: 7 | name: estimatedDocumentCount 8 | arguments: { } 9 | 10 | outcome: 11 | result: 0 12 | - 13 | description: "Count documents with empty collection" 14 | operation: 15 | name: countDocuments 16 | arguments: 17 | filter: { } 18 | 19 | outcome: 20 | result: 0 21 | - 22 | description: "Deprecated count with empty collection" 23 | operation: 24 | name: count 25 | arguments: 26 | filter: { } 27 | 28 | outcome: 29 | result: 0 30 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/distinct-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "string": "PING" 6 | }, 7 | { 8 | "_id": 2, 9 | "string": "ping" 10 | } 11 | ], 12 | "minServerVersion": "3.4", 13 | "tests": [ 14 | { 15 | "description": "Distinct with a collation", 16 | "operation": { 17 | "name": "distinct", 18 | "arguments": { 19 | "fieldName": "string", 20 | "collation": { 21 | "locale": "en_US", 22 | "strength": 2 23 | } 24 | } 25 | }, 26 | "outcome": { 27 | "result": [ 28 | "PING" 29 | ] 30 | } 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/distinct-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, string: 'PING'} 3 | - {_id: 2, string: 'ping'} 4 | minServerVersion: '3.4' 5 | 6 | tests: 7 | - 8 | description: "Distinct with a collation" 9 | operation: 10 | name: distinct 11 | arguments: 12 | fieldName: "string" 13 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 14 | 15 | outcome: 16 | result: 17 | - 'PING' 18 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/distinct.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 22} 4 | - {_id: 3, x: 33} 5 | 6 | tests: 7 | - 8 | description: "Distinct without a filter" 9 | operation: 10 | name: distinct 11 | arguments: 12 | fieldName: "x" 13 | filter: {} 14 | 15 | outcome: 16 | result: 17 | - 11 18 | - 22 19 | - 33 20 | - 21 | description: "Distinct with a filter" 22 | operation: 23 | name: distinct 24 | arguments: 25 | fieldName: "x" 26 | filter: 27 | _id: {$gt: 1} 28 | 29 | outcome: 30 | result: 31 | - 22 32 | - 33 -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/find-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": "ping" 6 | } 7 | ], 8 | "minServerVersion": "3.4", 9 | "tests": [ 10 | { 11 | "description": "Find with a collation", 12 | "operation": { 13 | "name": "find", 14 | "arguments": { 15 | "filter": { 16 | "x": "PING" 17 | }, 18 | "collation": { 19 | "locale": "en_US", 20 | "strength": 2 21 | } 22 | } 23 | }, 24 | "outcome": { 25 | "result": [ 26 | { 27 | "_id": 1, 28 | "x": "ping" 29 | } 30 | ] 31 | } 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/read/find-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 'ping'} 3 | minServerVersion: '3.4' 4 | 5 | tests: 6 | - 7 | description: "Find with a collation" 8 | operation: 9 | name: "find" 10 | arguments: 11 | filter: {x: 'PING'} 12 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 13 | outcome: 14 | result: 15 | - {_id: 1, x: 'ping'} 16 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/deleteMany-collation.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | }, 7 | { 8 | "_id": 2, 9 | "x": "ping" 10 | }, 11 | { 12 | "_id": 3, 13 | "x": "pINg" 14 | } 15 | ], 16 | "minServerVersion": "3.4", 17 | "tests": [ 18 | { 19 | "description": "DeleteMany when many documents match with collation", 20 | "operation": { 21 | "name": "deleteMany", 22 | "arguments": { 23 | "filter": { 24 | "x": "PING" 25 | }, 26 | "collation": { 27 | "locale": "en_US", 28 | "strength": 2 29 | } 30 | } 31 | }, 32 | "outcome": { 33 | "result": { 34 | "deletedCount": 2 35 | }, 36 | "collection": { 37 | "data": [ 38 | { 39 | "_id": 1, 40 | "x": 11 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/deleteMany-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 'ping'} 4 | - {_id: 3, x: 'pINg'} 5 | minServerVersion: '3.4' 6 | 7 | tests: 8 | - 9 | description: "DeleteMany when many documents match with collation" 10 | operation: 11 | name: "deleteMany" 12 | arguments: 13 | filter: 14 | x: 'PING' 15 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 16 | 17 | outcome: 18 | result: 19 | deletedCount: 2 20 | collection: 21 | data: 22 | - {_id: 1, x: 11} 23 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/deleteMany.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 22} 4 | - {_id: 3, x: 33} 5 | 6 | tests: 7 | - 8 | description: "DeleteMany when many documents match" 9 | operation: 10 | name: "deleteMany" 11 | arguments: 12 | filter: 13 | _id: {$gt: 1} 14 | 15 | outcome: 16 | result: 17 | deletedCount: 2 18 | collection: 19 | data: 20 | - {_id: 1, x: 11} 21 | - 22 | description: "DeleteMany when no document matches" 23 | operation: 24 | name: "deleteMany" 25 | arguments: 26 | filter: {_id: 4} 27 | 28 | outcome: 29 | result: 30 | deletedCount: 0 31 | collection: 32 | data: 33 | - {_id: 1, x: 11} 34 | - {_id: 2, x: 22} 35 | - {_id: 3, x: 33} 36 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/deleteOne-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 'ping'} 4 | - {_id: 3, x: 'pINg'} 5 | minServerVersion: '3.4' 6 | 7 | tests: 8 | - 9 | description: "DeleteOne when many documents matches with collation" 10 | operation: 11 | name: "deleteOne" 12 | arguments: 13 | filter: {x: 'PING'} 14 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 15 | 16 | outcome: 17 | result: 18 | deletedCount: 1 19 | collection: 20 | data: 21 | - {_id: 1, x: 11} 22 | - {_id: 3, x: 'pINg'} 23 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/findOneAndDelete-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 'ping'} 4 | - {_id: 3, x: 'pINg'} 5 | minServerVersion: '3.4' 6 | 7 | tests: 8 | - 9 | description: "FindOneAndDelete when one document matches with collation" 10 | operation: 11 | name: findOneAndDelete 12 | arguments: 13 | filter: {_id: 2, x: 'PING'} 14 | projection: {x: 1, _id: 0} 15 | sort: {x: 1} 16 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 17 | 18 | outcome: 19 | result: {x: 'ping'} 20 | collection: 21 | data: 22 | - {_id: 1, x: 11} 23 | - {_id: 3, x: 'pINg'} -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/findOneAndReplace-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 'ping'} 4 | minServerVersion: '3.4' 5 | 6 | tests: 7 | - 8 | description: "FindOneAndReplace when one document matches with collation returning the document after modification" 9 | operation: 10 | name: findOneAndReplace 11 | arguments: 12 | filter: {x: 'PING'} 13 | replacement: {x: 'pong'} 14 | projection: {x: 1, _id: 0} 15 | returnDocument: After 16 | sort: {x: 1} 17 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 18 | 19 | outcome: 20 | result: {x: 'pong'} 21 | collection: 22 | data: 23 | - {_id: 1, x: 11} 24 | - {_id: 2, x: 'pong'} 25 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/findOneAndUpdate-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 'ping'} 4 | - {_id: 3, x: 'pINg'} 5 | minServerVersion: '3.4' 6 | 7 | tests: 8 | - 9 | description: "FindOneAndUpdate when many documents match with collation returning the document before modification" 10 | operation: 11 | name: findOneAndUpdate 12 | arguments: 13 | filter: 14 | x: 'PING' 15 | update: 16 | $set: {x: 'pong'} 17 | projection: {x: 1, _id: 0} 18 | sort: {_id: 1} 19 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 20 | 21 | outcome: 22 | result: {x: 'ping'} 23 | collection: 24 | data: 25 | - {_id: 1, x: 11} 26 | - {_id: 2, x: 'pong'} 27 | - {_id: 3, x: 'pINg'} -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/insertOne.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "_id": 1, 5 | "x": 11 6 | } 7 | ], 8 | "tests": [ 9 | { 10 | "description": "InsertOne with a non-existing document", 11 | "operation": { 12 | "name": "insertOne", 13 | "arguments": { 14 | "document": { 15 | "_id": 2, 16 | "x": 22 17 | } 18 | } 19 | }, 20 | "outcome": { 21 | "result": { 22 | "insertedId": 2 23 | }, 24 | "collection": { 25 | "data": [ 26 | { 27 | "_id": 1, 28 | "x": 11 29 | }, 30 | { 31 | "_id": 2, 32 | "x": 22 33 | } 34 | ] 35 | } 36 | } 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/insertOne.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | 4 | tests: 5 | - 6 | description: "InsertOne with a non-existing document" 7 | operation: 8 | name: "insertOne" 9 | arguments: 10 | document: {_id: 2, x: 22} 11 | 12 | outcome: 13 | result: 14 | insertedId: 2 15 | collection: 16 | data: 17 | - {_id: 1, x: 11} 18 | - {_id: 2, x: 22} -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/replaceOne-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 'ping'} 4 | minServerVersion: '3.4' 5 | 6 | tests: 7 | - 8 | description: "ReplaceOne when one document matches with collation" 9 | operation: 10 | name: "replaceOne" 11 | arguments: 12 | filter: {x: 'PING'} 13 | replacement: {_id: 2, x: 'pong'} 14 | collation: {locale: 'en_US', strength: 2} # https://docs.mongodb.com/master/reference/collation/#collation-document 15 | 16 | outcome: 17 | result: 18 | matchedCount: 1 19 | modifiedCount: 1 20 | upsertedCount: 0 21 | collection: 22 | data: 23 | - {_id: 1, x: 11} 24 | - {_id: 2, x: 'pong'} -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/updateMany-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 'ping'} 4 | - {_id: 3, x: 'pINg'} 5 | minServerVersion: '3.4' 6 | 7 | tests: 8 | - 9 | description: "UpdateMany when many documents match with collation" 10 | operation: 11 | name: "updateMany" 12 | arguments: 13 | filter: 14 | x: 'ping' 15 | update: 16 | $set: {x: 'pong'} 17 | collation: { locale: 'en_US', strength: 2 } # https://docs.mongodb.com/master/reference/collation/#collation-document 18 | 19 | outcome: 20 | result: 21 | matchedCount: 2 22 | modifiedCount: 2 23 | upsertedCount: 0 24 | collection: 25 | data: 26 | - {_id: 1, x: 11} 27 | - {_id: 2, x: 'pong'} 28 | - {_id: 3, x: 'pong'} 29 | -------------------------------------------------------------------------------- /t/data/CRUD/v1/write/updateOne-collation.yml: -------------------------------------------------------------------------------- 1 | data: 2 | - {_id: 1, x: 11} 3 | - {_id: 2, x: 'ping'} 4 | minServerVersion: '3.4' 5 | 6 | tests: 7 | - 8 | description: "UpdateOne when one document matches with collation" 9 | operation: 10 | name: "updateOne" 11 | arguments: 12 | filter: {x: 'PING'} 13 | update: 14 | $set: {x: 'pong'} 15 | collation: { locale: 'en_US', strength: 2} # https://docs.mongodb.com/master/reference/collation/#collation-document 16 | 17 | outcome: 18 | result: 19 | matchedCount: 1 20 | modifiedCount: 1 21 | upsertedCount: 0 22 | collection: 23 | data: 24 | - {_id: 1, x: 11} 25 | - {_id: 2, x: 'pong'} 26 | -------------------------------------------------------------------------------- /t/data/SDAM/monitoring/README.rst: -------------------------------------------------------------------------------- 1 | ===================== 2 | SDAM Monitoring Tests 3 | ===================== 4 | 5 | The YAML and JSON files in this directory tree are platform-independent tests 6 | that drivers can use to prove their conformance to the SDAM Monitoring spec. 7 | 8 | Format 9 | ------ 10 | 11 | The format of the tests follows the standard SDAM test and should be able to leverage 12 | the existing test runner in each language for the SDAM tests. 13 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/ghost_discovered.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Ghost discovered", 3 | "uri": "mongodb://a,b/?replicaSet=rs", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "b:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": false, 12 | "isreplicaset": true, 13 | "minWireVersion": 0, 14 | "maxWireVersion": 6 15 | } 16 | ] 17 | ], 18 | "outcome": { 19 | "servers": { 20 | "a:27017": { 21 | "type": "Unknown", 22 | "setName": null 23 | }, 24 | "b:27017": { 25 | "type": "RSGhost", 26 | "setName": null 27 | } 28 | }, 29 | "topologyType": "ReplicaSetNoPrimary", 30 | "logicalSessionTimeoutMinutes": null, 31 | "setName": "rs" 32 | } 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/ghost_discovered.yml: -------------------------------------------------------------------------------- 1 | description: "Ghost discovered" 2 | 3 | uri: "mongodb://a,b/?replicaSet=rs" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["b:27017", { 11 | 12 | ok: 1, 13 | ismaster: false, 14 | isreplicaset: true, 15 | minWireVersion: 0, 16 | maxWireVersion: 6 17 | }] 18 | ], 19 | 20 | outcome: { 21 | 22 | servers: { 23 | 24 | "a:27017": { 25 | 26 | type: "Unknown", 27 | setName: 28 | }, 29 | 30 | "b:27017": { 31 | 32 | type: "RSGhost", 33 | setName: 34 | } 35 | }, 36 | topologyType: "ReplicaSetNoPrimary", 37 | logicalSessionTimeoutMinutes: null, 38 | setName: "rs" 39 | } 40 | } 41 | ] 42 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/hosts_differ_from_seeds.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Host list differs from seeds", 3 | "uri": "mongodb://a/?replicaSet=rs", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "setName": "rs", 13 | "hosts": [ 14 | "b:27017" 15 | ], 16 | "minWireVersion": 0, 17 | "maxWireVersion": 6 18 | } 19 | ] 20 | ], 21 | "outcome": { 22 | "servers": { 23 | "b:27017": { 24 | "type": "Unknown", 25 | "setName": null 26 | } 27 | }, 28 | "topologyType": "ReplicaSetNoPrimary", 29 | "logicalSessionTimeoutMinutes": null, 30 | "setName": "rs" 31 | } 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/hosts_differ_from_seeds.yml: -------------------------------------------------------------------------------- 1 | description: "Host list differs from seeds" 2 | 3 | uri: "mongodb://a/?replicaSet=rs" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | setName: "rs", 15 | hosts: ["b:27017"], 16 | minWireVersion: 0, 17 | maxWireVersion: 6 18 | }] 19 | ], 20 | 21 | outcome: { 22 | 23 | servers: { 24 | 25 | "b:27017": { 26 | 27 | type: "Unknown", 28 | setName: 29 | } 30 | }, 31 | topologyType: "ReplicaSetNoPrimary", 32 | logicalSessionTimeoutMinutes: null, 33 | setName: "rs" 34 | } 35 | } 36 | ] 37 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/non_rs_member.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Non replicaSet member responds", 3 | "uri": "mongodb://a,b/?replicaSet=rs", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "b:27017", 9 | { 10 | "ok": 1, 11 | "minWireVersion": 0, 12 | "maxWireVersion": 6 13 | } 14 | ] 15 | ], 16 | "outcome": { 17 | "servers": { 18 | "a:27017": { 19 | "type": "Unknown", 20 | "setName": null 21 | } 22 | }, 23 | "topologyType": "ReplicaSetNoPrimary", 24 | "logicalSessionTimeoutMinutes": null, 25 | "setName": "rs" 26 | } 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/non_rs_member.yml: -------------------------------------------------------------------------------- 1 | description: "Non replicaSet member responds" 2 | 3 | uri: "mongodb://a,b/?replicaSet=rs" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["b:27017", { 11 | ok: 1, 12 | minWireVersion: 0, 13 | maxWireVersion: 6 14 | }] 15 | ], 16 | 17 | outcome: { 18 | 19 | servers: { 20 | 21 | "a:27017": { 22 | 23 | type: "Unknown", 24 | setName: 25 | } 26 | }, 27 | topologyType: "ReplicaSetNoPrimary", 28 | logicalSessionTimeoutMinutes: null, 29 | setName: "rs" 30 | } 31 | } 32 | ] 33 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/primary_mismatched_me.yml: -------------------------------------------------------------------------------- 1 | description: Primary mismatched me 2 | phases: 3 | - outcome: 4 | servers: 5 | 'a:27017': 6 | setName: null 7 | type: Unknown 8 | 'b:27017': 9 | setName: null 10 | type: Unknown 11 | setName: rs 12 | topologyType: ReplicaSetNoPrimary 13 | logicalSessionTimeoutMinutes: null 14 | responses: 15 | - - 'localhost:27017' 16 | - me: 'a:27017' 17 | hosts: 18 | - 'a:27017' 19 | - 'b:27017' 20 | ismaster: true 21 | ok: 1 22 | setName: rs 23 | minWireVersion: 0 24 | maxWireVersion: 6 25 | uri: 'mongodb://localhost:27017/?replicaSet=rs' 26 | 27 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/primary_wrong_set_name.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Primary wrong setName", 3 | "uri": "mongodb://a/?replicaSet=rs", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "hosts": [ 13 | "a:27017" 14 | ], 15 | "setName": "wrong", 16 | "minWireVersion": 0, 17 | "maxWireVersion": 6 18 | } 19 | ] 20 | ], 21 | "outcome": { 22 | "servers": {}, 23 | "topologyType": "ReplicaSetNoPrimary", 24 | "logicalSessionTimeoutMinutes": null, 25 | "setName": "rs" 26 | } 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/primary_wrong_set_name.yml: -------------------------------------------------------------------------------- 1 | description: "Primary wrong setName" 2 | 3 | uri: "mongodb://a/?replicaSet=rs" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | hosts: ["a:27017"], 15 | setName: "wrong", 16 | minWireVersion: 0, 17 | maxWireVersion: 6 18 | }] 19 | ], 20 | 21 | outcome: { 22 | 23 | servers: {}, 24 | topologyType: "ReplicaSetNoPrimary", 25 | logicalSessionTimeoutMinutes: null, 26 | setName: "rs" 27 | } 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/secondary_mismatched_me.yml: -------------------------------------------------------------------------------- 1 | description: Secondary mismatched me 2 | phases: 3 | - outcome: 4 | servers: 5 | 'a:27017': 6 | setName: null 7 | type: Unknown 8 | 'b:27017': 9 | setName: null 10 | type: Unknown 11 | setName: rs 12 | topologyType: ReplicaSetNoPrimary 13 | logicalSessionTimeoutMinutes: null 14 | responses: 15 | - - 'localhost:27017' 16 | - me: 'a:27017' 17 | hosts: 18 | - 'a:27017' 19 | - 'b:27017' 20 | ismaster: false 21 | ok: 1 22 | setName: rs 23 | minWireVersion: 0 24 | maxWireVersion: 6 25 | uri: 'mongodb://localhost:27017/?replicaSet=rs' 26 | 27 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/secondary_wrong_set_name.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Secondary wrong setName", 3 | "uri": "mongodb://a/?replicaSet=rs", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": false, 12 | "secondary": true, 13 | "hosts": [ 14 | "a:27017" 15 | ], 16 | "setName": "wrong", 17 | "minWireVersion": 0, 18 | "maxWireVersion": 6 19 | } 20 | ] 21 | ], 22 | "outcome": { 23 | "servers": {}, 24 | "topologyType": "ReplicaSetNoPrimary", 25 | "logicalSessionTimeoutMinutes": null, 26 | "setName": "rs" 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/secondary_wrong_set_name.yml: -------------------------------------------------------------------------------- 1 | description: "Secondary wrong setName" 2 | 3 | uri: "mongodb://a/?replicaSet=rs" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: false, 14 | secondary: true, 15 | hosts: ["a:27017"], 16 | setName: "wrong", 17 | minWireVersion: 0, 18 | maxWireVersion: 6 19 | }] 20 | ], 21 | 22 | outcome: { 23 | 24 | servers: {}, 25 | topologyType: "ReplicaSetNoPrimary", 26 | logicalSessionTimeoutMinutes: null, 27 | setName: "rs" 28 | } 29 | } 30 | ] 31 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/unexpected_mongos.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Unexpected mongos", 3 | "uri": "mongodb://b/?replicaSet=rs", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "b:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "msg": "isdbgrid", 13 | "minWireVersion": 0, 14 | "maxWireVersion": 6 15 | } 16 | ] 17 | ], 18 | "outcome": { 19 | "servers": {}, 20 | "topologyType": "ReplicaSetNoPrimary", 21 | "logicalSessionTimeoutMinutes": null, 22 | "setName": "rs" 23 | } 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/unexpected_mongos.yml: -------------------------------------------------------------------------------- 1 | description: "Unexpected mongos" 2 | 3 | uri: "mongodb://b/?replicaSet=rs" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["b:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | msg: "isdbgrid", 15 | minWireVersion: 0, 16 | maxWireVersion: 6 17 | }] 18 | ], 19 | 20 | outcome: { 21 | 22 | servers: {}, 23 | topologyType: "ReplicaSetNoPrimary", 24 | logicalSessionTimeoutMinutes: null, 25 | setName: "rs" 26 | } 27 | } 28 | ] 29 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/wrong_set_name.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Wrong setName", 3 | "uri": "mongodb://a,b/?replicaSet=rs", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "b:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": false, 12 | "secondary": true, 13 | "hosts": [ 14 | "b:27017", 15 | "c:27017" 16 | ], 17 | "setName": "wrong", 18 | "minWireVersion": 0, 19 | "maxWireVersion": 6 20 | } 21 | ] 22 | ], 23 | "outcome": { 24 | "servers": { 25 | "a:27017": { 26 | "type": "Unknown", 27 | "setName": null 28 | } 29 | }, 30 | "topologyType": "ReplicaSetNoPrimary", 31 | "logicalSessionTimeoutMinutes": null, 32 | "setName": "rs" 33 | } 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /t/data/SDAM/rs/wrong_set_name.yml: -------------------------------------------------------------------------------- 1 | description: "Wrong setName" 2 | 3 | uri: "mongodb://a,b/?replicaSet=rs" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["b:27017", { 11 | 12 | ok: 1, 13 | ismaster: false, 14 | secondary: true, 15 | hosts: ["b:27017", "c:27017"], 16 | setName: "wrong", 17 | minWireVersion: 0, 18 | maxWireVersion: 6 19 | }] 20 | ], 21 | 22 | outcome: { 23 | 24 | servers: { 25 | 26 | "a:27017": { 27 | 28 | type: "Unknown", 29 | setName: 30 | } 31 | }, 32 | topologyType: "ReplicaSetNoPrimary", 33 | logicalSessionTimeoutMinutes: null, 34 | setName: "rs" 35 | } 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /t/data/SDAM/sharded/normalize_uri_case.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Normalize URI case", 3 | "uri": "mongodb://A,B", 4 | "phases": [ 5 | { 6 | "responses": [], 7 | "outcome": { 8 | "servers": { 9 | "a:27017": { 10 | "type": "Unknown", 11 | "setName": null 12 | }, 13 | "b:27017": { 14 | "type": "Unknown", 15 | "setName": null 16 | } 17 | }, 18 | "topologyType": "Unknown", 19 | "logicalSessionTimeoutMinutes": null, 20 | "setName": null 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /t/data/SDAM/sharded/normalize_uri_case.yml: -------------------------------------------------------------------------------- 1 | description: "Normalize URI case" 2 | 3 | uri: "mongodb://A,B" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | ], 10 | 11 | outcome: { 12 | 13 | servers: { 14 | 15 | "a:27017": { 16 | 17 | type: "Unknown", 18 | setName: 19 | }, 20 | 21 | "b:27017": { 22 | 23 | type: "Unknown", 24 | setName: 25 | } 26 | }, 27 | topologyType: "Unknown", 28 | logicalSessionTimeoutMinutes: null, 29 | setName: 30 | } 31 | } 32 | ] 33 | -------------------------------------------------------------------------------- /t/data/SDAM/single/compatible.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Standalone with large maxWireVersion", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "minWireVersion": 0, 13 | "maxWireVersion": 6 14 | } 15 | ] 16 | ], 17 | "outcome": { 18 | "servers": { 19 | "a:27017": { 20 | "type": "Standalone", 21 | "setName": null 22 | } 23 | }, 24 | "topologyType": "Single", 25 | "logicalSessionTimeoutMinutes": null, 26 | "setName": null, 27 | "compatible": true 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /t/data/SDAM/single/compatible.yml: -------------------------------------------------------------------------------- 1 | description: "Standalone with large maxWireVersion" 2 | uri: "mongodb://a" 3 | phases: [ 4 | { 5 | responses: [ 6 | ["a:27017", { 7 | ok: 1, 8 | ismaster: true, 9 | minWireVersion: 0, 10 | maxWireVersion: 6 11 | }] 12 | ], 13 | outcome: { 14 | servers: { 15 | "a:27017": { 16 | type: "Standalone", 17 | setName: 18 | } 19 | }, 20 | topologyType: "Single", 21 | logicalSessionTimeoutMinutes: null, 22 | setName: , 23 | compatible: true 24 | } 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_external_ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Direct connection to RSPrimary via external IP", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "hosts": [ 13 | "b:27017" 14 | ], 15 | "setName": "rs", 16 | "minWireVersion": 0, 17 | "maxWireVersion": 6 18 | } 19 | ] 20 | ], 21 | "outcome": { 22 | "servers": { 23 | "a:27017": { 24 | "type": "RSPrimary", 25 | "setName": "rs" 26 | } 27 | }, 28 | "topologyType": "Single", 29 | "logicalSessionTimeoutMinutes": null, 30 | "setName": null 31 | } 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_external_ip.yml: -------------------------------------------------------------------------------- 1 | description: "Direct connection to RSPrimary via external IP" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | hosts: ["b:27017"], # Internal IP. 15 | setName: "rs", 16 | minWireVersion: 0, 17 | maxWireVersion: 6 18 | }] 19 | ], 20 | 21 | outcome: { 22 | 23 | servers: { 24 | 25 | "a:27017": { 26 | 27 | type: "RSPrimary", 28 | setName: "rs" 29 | } 30 | }, 31 | topologyType: "Single", 32 | logicalSessionTimeoutMinutes: null, 33 | setName: 34 | } 35 | } 36 | ] 37 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_mongos.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Connect to mongos", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "msg": "isdbgrid", 13 | "minWireVersion": 0, 14 | "maxWireVersion": 6 15 | } 16 | ] 17 | ], 18 | "outcome": { 19 | "servers": { 20 | "a:27017": { 21 | "type": "Mongos", 22 | "setName": null 23 | } 24 | }, 25 | "topologyType": "Single", 26 | "logicalSessionTimeoutMinutes": null, 27 | "setName": null 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_mongos.yml: -------------------------------------------------------------------------------- 1 | description: "Connect to mongos" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | msg: "isdbgrid", 15 | minWireVersion: 0, 16 | maxWireVersion: 6 17 | }] 18 | ], 19 | 20 | outcome: { 21 | 22 | servers: { 23 | 24 | "a:27017": { 25 | 26 | type: "Mongos", 27 | setName: 28 | } 29 | }, 30 | topologyType: "Single", 31 | logicalSessionTimeoutMinutes: null, 32 | setName: 33 | } 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_rsarbiter.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Connect to RSArbiter", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": false, 12 | "arbiterOnly": true, 13 | "hosts": [ 14 | "a:27017", 15 | "b:27017" 16 | ], 17 | "setName": "rs", 18 | "minWireVersion": 0, 19 | "maxWireVersion": 6 20 | } 21 | ] 22 | ], 23 | "outcome": { 24 | "servers": { 25 | "a:27017": { 26 | "type": "RSArbiter", 27 | "setName": "rs" 28 | } 29 | }, 30 | "topologyType": "Single", 31 | "logicalSessionTimeoutMinutes": null, 32 | "setName": null 33 | } 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_rsarbiter.yml: -------------------------------------------------------------------------------- 1 | description: "Connect to RSArbiter" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: false, 14 | arbiterOnly: true, 15 | hosts: ["a:27017", "b:27017"], 16 | setName: "rs", 17 | minWireVersion: 0, 18 | maxWireVersion: 6 19 | }] 20 | ], 21 | 22 | outcome: { 23 | 24 | servers: { 25 | 26 | "a:27017": { 27 | 28 | type: "RSArbiter", 29 | setName: "rs" 30 | } 31 | }, 32 | topologyType: "Single", 33 | logicalSessionTimeoutMinutes: null, 34 | setName: 35 | } 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_rsprimary.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Connect to RSPrimary", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "hosts": [ 13 | "a:27017", 14 | "b:27017" 15 | ], 16 | "setName": "rs", 17 | "minWireVersion": 0, 18 | "maxWireVersion": 6 19 | } 20 | ] 21 | ], 22 | "outcome": { 23 | "servers": { 24 | "a:27017": { 25 | "type": "RSPrimary", 26 | "setName": "rs" 27 | } 28 | }, 29 | "topologyType": "Single", 30 | "logicalSessionTimeoutMinutes": null, 31 | "setName": null 32 | } 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_rsprimary.yml: -------------------------------------------------------------------------------- 1 | description: "Connect to RSPrimary" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | hosts: ["a:27017", "b:27017"], 15 | setName: "rs", 16 | minWireVersion: 0, 17 | maxWireVersion: 6 18 | }] 19 | ], 20 | 21 | outcome: { 22 | 23 | servers: { 24 | 25 | "a:27017": { 26 | 27 | type: "RSPrimary", 28 | setName: "rs" 29 | } 30 | }, 31 | topologyType: "Single", 32 | logicalSessionTimeoutMinutes: null, 33 | setName: 34 | } 35 | } 36 | ] 37 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_rssecondary.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Connect to RSSecondary", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": false, 12 | "secondary": true, 13 | "hosts": [ 14 | "a:27017", 15 | "b:27017" 16 | ], 17 | "setName": "rs", 18 | "minWireVersion": 0, 19 | "maxWireVersion": 6 20 | } 21 | ] 22 | ], 23 | "outcome": { 24 | "servers": { 25 | "a:27017": { 26 | "type": "RSSecondary", 27 | "setName": "rs" 28 | } 29 | }, 30 | "topologyType": "Single", 31 | "logicalSessionTimeoutMinutes": null, 32 | "setName": null 33 | } 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_rssecondary.yml: -------------------------------------------------------------------------------- 1 | description: "Connect to RSSecondary" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: false, 14 | secondary: true, 15 | hosts: ["a:27017", "b:27017"], 16 | setName: "rs", 17 | minWireVersion: 0, 18 | maxWireVersion: 6 19 | }] 20 | ], 21 | 22 | outcome: { 23 | 24 | servers: { 25 | 26 | "a:27017": { 27 | 28 | type: "RSSecondary", 29 | setName: "rs" 30 | } 31 | }, 32 | topologyType: "Single", 33 | logicalSessionTimeoutMinutes: null, 34 | setName: 35 | } 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_slave.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Direct connection to slave", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": false, 12 | "minWireVersion": 0, 13 | "maxWireVersion": 6 14 | } 15 | ] 16 | ], 17 | "outcome": { 18 | "servers": { 19 | "a:27017": { 20 | "type": "Standalone", 21 | "setName": null 22 | } 23 | }, 24 | "topologyType": "Single", 25 | "logicalSessionTimeoutMinutes": null, 26 | "setName": null 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_slave.yml: -------------------------------------------------------------------------------- 1 | description: "Direct connection to slave" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: false, 14 | minWireVersion: 0, 15 | maxWireVersion: 6 16 | }] 17 | ], 18 | 19 | outcome: { 20 | 21 | servers: { 22 | 23 | "a:27017": { 24 | 25 | type: "Standalone", 26 | setName: 27 | } 28 | }, 29 | topologyType: "Single", 30 | logicalSessionTimeoutMinutes: null, 31 | setName: 32 | } 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_standalone.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Connect to standalone", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "minWireVersion": 0, 13 | "maxWireVersion": 6 14 | } 15 | ] 16 | ], 17 | "outcome": { 18 | "servers": { 19 | "a:27017": { 20 | "type": "Standalone", 21 | "setName": null 22 | } 23 | }, 24 | "topologyType": "Single", 25 | "logicalSessionTimeoutMinutes": null, 26 | "setName": null 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /t/data/SDAM/single/direct_connection_standalone.yml: -------------------------------------------------------------------------------- 1 | description: "Connect to standalone" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | minWireVersion: 0, 15 | maxWireVersion: 6 16 | }] 17 | ], 18 | 19 | outcome: { 20 | 21 | servers: { 22 | 23 | "a:27017": { 24 | 25 | type: "Standalone", 26 | setName: 27 | } 28 | }, 29 | topologyType: "Single", 30 | logicalSessionTimeoutMinutes: null, 31 | setName: 32 | } 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /t/data/SDAM/single/ls_timeout_standalone.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Parse logicalSessionTimeoutMinutes from standalone", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "logicalSessionTimeoutMinutes": 7, 13 | "minWireVersion": 0, 14 | "maxWireVersion": 6 15 | } 16 | ] 17 | ], 18 | "outcome": { 19 | "servers": { 20 | "a:27017": { 21 | "type": "Standalone", 22 | "setName": null 23 | } 24 | }, 25 | "topologyType": "Single", 26 | "logicalSessionTimeoutMinutes": 7, 27 | "setName": null 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /t/data/SDAM/single/ls_timeout_standalone.yml: -------------------------------------------------------------------------------- 1 | description: "Parse logicalSessionTimeoutMinutes from standalone" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | logicalSessionTimeoutMinutes: 7, 15 | minWireVersion: 0, 16 | maxWireVersion: 6 17 | }] 18 | ], 19 | 20 | outcome: { 21 | 22 | servers: { 23 | 24 | "a:27017": { 25 | 26 | type: "Standalone", 27 | setName: 28 | } 29 | }, 30 | topologyType: "Single", 31 | logicalSessionTimeoutMinutes: 7, 32 | setName: 33 | } 34 | } 35 | ] 36 | -------------------------------------------------------------------------------- /t/data/SDAM/single/not_ok_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Handle a not-ok ismaster response", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "minWireVersion": 0, 13 | "maxWireVersion": 6 14 | } 15 | ], 16 | [ 17 | "a:27017", 18 | { 19 | "ok": 0, 20 | "ismaster": true, 21 | "minWireVersion": 0, 22 | "maxWireVersion": 6 23 | } 24 | ] 25 | ], 26 | "outcome": { 27 | "servers": { 28 | "a:27017": { 29 | "type": "Unknown", 30 | "setName": null 31 | } 32 | }, 33 | "topologyType": "Single", 34 | "logicalSessionTimeoutMinutes": null, 35 | "setName": null 36 | } 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /t/data/SDAM/single/standalone_removed.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Standalone removed from multi-server topology", 3 | "uri": "mongodb://a,b", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "minWireVersion": 0, 13 | "maxWireVersion": 6 14 | } 15 | ] 16 | ], 17 | "outcome": { 18 | "servers": { 19 | "b:27017": { 20 | "type": "Unknown", 21 | "setName": null 22 | } 23 | }, 24 | "topologyType": "Unknown", 25 | "logicalSessionTimeoutMinutes": null, 26 | "setName": null 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /t/data/SDAM/single/standalone_removed.yml: -------------------------------------------------------------------------------- 1 | description: "Standalone removed from multi-server topology" 2 | 3 | uri: "mongodb://a,b" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", { 11 | 12 | ok: 1, 13 | ismaster: true, 14 | minWireVersion: 0, 15 | maxWireVersion: 6 16 | }] 17 | ], 18 | 19 | outcome: { 20 | 21 | servers: { 22 | 23 | "b:27017": { 24 | 25 | type: "Unknown", 26 | setName: 27 | } 28 | }, 29 | topologyType: "Unknown", 30 | logicalSessionTimeoutMinutes: null, 31 | setName: 32 | } 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /t/data/SDAM/single/too_new.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Standalone with large minWireVersion", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true, 12 | "minWireVersion": 999, 13 | "maxWireVersion": 1000 14 | } 15 | ] 16 | ], 17 | "outcome": { 18 | "servers": { 19 | "a:27017": { 20 | "type": "Standalone", 21 | "setName": null 22 | } 23 | }, 24 | "topologyType": "Single", 25 | "logicalSessionTimeoutMinutes": null, 26 | "setName": null, 27 | "compatible": false 28 | } 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /t/data/SDAM/single/too_new.yml: -------------------------------------------------------------------------------- 1 | description: "Standalone with large minWireVersion" 2 | uri: "mongodb://a" 3 | phases: [ 4 | { 5 | responses: [ 6 | ["a:27017", { 7 | ok: 1, 8 | ismaster: true, 9 | minWireVersion: 999, 10 | maxWireVersion: 1000 11 | }] 12 | ], 13 | outcome: { 14 | servers: { 15 | "a:27017": { 16 | type: "Standalone", 17 | setName: 18 | } 19 | }, 20 | topologyType: "Single", 21 | logicalSessionTimeoutMinutes: null, 22 | setName: , 23 | compatible: false 24 | } 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /t/data/SDAM/single/too_old.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Standalone with default maxWireVersion of 0", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | { 10 | "ok": 1, 11 | "ismaster": true 12 | } 13 | ] 14 | ], 15 | "outcome": { 16 | "servers": { 17 | "a:27017": { 18 | "type": "Standalone", 19 | "setName": null 20 | } 21 | }, 22 | "topologyType": "Single", 23 | "logicalSessionTimeoutMinutes": null, 24 | "setName": null, 25 | "compatible": false 26 | } 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /t/data/SDAM/single/too_old.yml: -------------------------------------------------------------------------------- 1 | description: "Standalone with default maxWireVersion of 0" 2 | uri: "mongodb://a" 3 | phases: [ 4 | { 5 | responses: [ 6 | ["a:27017", { 7 | ok: 1, 8 | ismaster: true 9 | }] 10 | ], 11 | outcome: { 12 | servers: { 13 | "a:27017": { 14 | type: "Standalone", 15 | setName: 16 | } 17 | }, 18 | topologyType: "Single", 19 | logicalSessionTimeoutMinutes: null, 20 | setName: , 21 | compatible: false 22 | } 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /t/data/SDAM/single/unavailable_seed.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Unavailable seed", 3 | "uri": "mongodb://a", 4 | "phases": [ 5 | { 6 | "responses": [ 7 | [ 8 | "a:27017", 9 | {} 10 | ] 11 | ], 12 | "outcome": { 13 | "servers": { 14 | "a:27017": { 15 | "type": "Unknown", 16 | "setName": null 17 | } 18 | }, 19 | "topologyType": "Single", 20 | "logicalSessionTimeoutMinutes": null, 21 | "setName": null 22 | } 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /t/data/SDAM/single/unavailable_seed.yml: -------------------------------------------------------------------------------- 1 | description: "Unavailable seed" 2 | 3 | uri: "mongodb://a" 4 | 5 | phases: [ 6 | 7 | { 8 | responses: [ 9 | 10 | ["a:27017", {}] 11 | ], 12 | 13 | outcome: { 14 | 15 | servers: { 16 | 17 | "a:27017": { 18 | 19 | type: "Unknown", 20 | setName: 21 | } 22 | }, 23 | topologyType: "Single", 24 | logicalSessionTimeoutMinutes: null, 25 | setName: 26 | } 27 | } 28 | ] 29 | -------------------------------------------------------------------------------- /t/data/SS/rtt/first_value.json: -------------------------------------------------------------------------------- 1 | { 2 | "avg_rtt_ms": "NULL", 3 | "new_avg_rtt": 10, 4 | "new_rtt_ms": 10 5 | } 6 | -------------------------------------------------------------------------------- /t/data/SS/rtt/first_value.yml: -------------------------------------------------------------------------------- 1 | --- 2 | avg_rtt_ms: 'NULL' 3 | new_rtt_ms: 10 4 | new_avg_rtt: 10 5 | -------------------------------------------------------------------------------- /t/data/SS/rtt/first_value_zero.json: -------------------------------------------------------------------------------- 1 | { 2 | "avg_rtt_ms": "NULL", 3 | "new_avg_rtt": 0, 4 | "new_rtt_ms": 0 5 | } 6 | -------------------------------------------------------------------------------- /t/data/SS/rtt/first_value_zero.yml: -------------------------------------------------------------------------------- 1 | --- 2 | avg_rtt_ms: 'NULL' 3 | new_rtt_ms: 0 4 | new_avg_rtt: 0 5 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "avg_rtt_ms": 0, 3 | "new_avg_rtt": 1.0, 4 | "new_rtt_ms": 5 5 | } 6 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_1.yml: -------------------------------------------------------------------------------- 1 | --- 2 | avg_rtt_ms: 0 3 | new_rtt_ms: 5 4 | new_avg_rtt: 1.0 5 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "avg_rtt_ms": 3.1, 3 | "new_avg_rtt": 9.68, 4 | "new_rtt_ms": 36 5 | } 6 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_2.yml: -------------------------------------------------------------------------------- 1 | --- 2 | avg_rtt_ms: 3.1 3 | new_rtt_ms: 36 4 | new_avg_rtt: 9.68 5 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "avg_rtt_ms": 9.12, 3 | "new_avg_rtt": 9.12, 4 | "new_rtt_ms": 9.12 5 | } 6 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | avg_rtt_ms: 9.12 3 | new_rtt_ms: 9.12 4 | new_avg_rtt: 9.12 5 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "avg_rtt_ms": 1, 3 | "new_avg_rtt": 200.8, 4 | "new_rtt_ms": 1000 5 | } 6 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_4.yml: -------------------------------------------------------------------------------- 1 | --- 2 | avg_rtt_ms: 1 3 | new_rtt_ms: 1000 4 | new_avg_rtt: 200.8 5 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_5.json: -------------------------------------------------------------------------------- 1 | { 2 | "avg_rtt_ms": 0, 3 | "new_avg_rtt": 0.05, 4 | "new_rtt_ms": 0.25 5 | } 6 | -------------------------------------------------------------------------------- /t/data/SS/rtt/value_test_5.yml: -------------------------------------------------------------------------------- 1 | --- 2 | avg_rtt_ms: 0 3 | new_rtt_ms: 0.25 4 | new_avg_rtt: 0.05 5 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Nearest.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 5 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &2 11 | address: c:27017 12 | avg_rtt_ms: 100 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | operation: read 17 | read_preference: 18 | mode: Nearest 19 | tag_sets: 20 | - data_center: nyc 21 | suitable_servers: 22 | - *1 23 | - *2 24 | in_latency_window: 25 | - *1 26 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Nearest_multiple.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 10 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &2 11 | address: c:27017 12 | avg_rtt_ms: 20 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | operation: read 17 | read_preference: 18 | mode: Nearest 19 | tag_sets: 20 | - data_center: nyc 21 | suitable_servers: 22 | - *1 23 | - *2 24 | in_latency_window: 25 | - *1 26 | - *2 27 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Nearest_non_matching.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "ReplicaSetNoPrimary", 4 | "servers": [ 5 | { 6 | "address": "b:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "RSSecondary", 9 | "tags": { 10 | "data_center": "nyc" 11 | } 12 | }, 13 | { 14 | "address": "c:27017", 15 | "avg_rtt_ms": 100, 16 | "type": "RSSecondary", 17 | "tags": { 18 | "data_center": "nyc" 19 | } 20 | } 21 | ] 22 | }, 23 | "operation": "read", 24 | "read_preference": { 25 | "mode": "Nearest", 26 | "tag_sets": [ 27 | { 28 | "data_center": "sf" 29 | } 30 | ] 31 | }, 32 | "suitable_servers": [], 33 | "in_latency_window": [] 34 | } 35 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Nearest_non_matching.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | operation: read 15 | read_preference: 16 | mode: Nearest 17 | tag_sets: 18 | - data_center: sf 19 | suitable_servers: [] 20 | in_latency_window: [] 21 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/PossiblePrimary.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "ReplicaSetNoPrimary", 4 | "servers": [ 5 | { 6 | "address": "b:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "PossiblePrimary" 9 | } 10 | ] 11 | }, 12 | "operation": "read", 13 | "read_preference": { 14 | "mode": "Primary", 15 | "tag_sets": [ 16 | {} 17 | ] 18 | }, 19 | "suitable_servers": [], 20 | "in_latency_window": [] 21 | } 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/PossiblePrimary.yml: -------------------------------------------------------------------------------- 1 | # Test that PossiblePrimary isn't candidate for any read preference mode. 2 | --- 3 | topology_description: 4 | type: ReplicaSetNoPrimary 5 | servers: 6 | - address: b:27017 7 | avg_rtt_ms: 5 8 | type: PossiblePrimary 9 | operation: read 10 | read_preference: 11 | mode: Primary 12 | tag_sets: 13 | - {} 14 | suitable_servers: [] 15 | in_latency_window: [] 16 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/PossiblePrimaryNearest.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "ReplicaSetNoPrimary", 4 | "servers": [ 5 | { 6 | "address": "b:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "PossiblePrimary" 9 | } 10 | ] 11 | }, 12 | "operation": "read", 13 | "read_preference": { 14 | "mode": "Nearest", 15 | "tag_sets": [ 16 | {} 17 | ] 18 | }, 19 | "suitable_servers": [], 20 | "in_latency_window": [] 21 | } 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/PossiblePrimaryNearest.yml: -------------------------------------------------------------------------------- 1 | # Test that PossiblePrimary isn't candidate for any read preference mode. 2 | --- 3 | topology_description: 4 | type: ReplicaSetNoPrimary 5 | servers: 6 | - address: b:27017 7 | avg_rtt_ms: 5 8 | type: PossiblePrimary 9 | operation: read 10 | read_preference: 11 | mode: Nearest 12 | tag_sets: 13 | - {} 14 | suitable_servers: [] 15 | in_latency_window: [] 16 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Primary.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "ReplicaSetNoPrimary", 4 | "servers": [ 5 | { 6 | "address": "b:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "RSSecondary", 9 | "tags": { 10 | "data_center": "nyc" 11 | } 12 | }, 13 | { 14 | "address": "c:27017", 15 | "avg_rtt_ms": 100, 16 | "type": "RSSecondary", 17 | "tags": { 18 | "data_center": "nyc" 19 | } 20 | } 21 | ] 22 | }, 23 | "operation": "read", 24 | "read_preference": { 25 | "mode": "Primary" 26 | }, 27 | "suitable_servers": [], 28 | "in_latency_window": [] 29 | } 30 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Primary.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | operation: read 15 | read_preference: 16 | mode: Primary 17 | suitable_servers: [] 18 | in_latency_window: [] 19 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 5 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &2 11 | address: c:27017 12 | avg_rtt_ms: 100 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | operation: read 17 | read_preference: 18 | mode: PrimaryPreferred 19 | tag_sets: 20 | - {} 21 | suitable_servers: 22 | - *1 23 | - *2 24 | in_latency_window: 25 | - *1 26 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "ReplicaSetNoPrimary", 4 | "servers": [ 5 | { 6 | "address": "b:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "RSSecondary", 9 | "tags": { 10 | "data_center": "nyc" 11 | } 12 | }, 13 | { 14 | "address": "c:27017", 15 | "avg_rtt_ms": 100, 16 | "type": "RSSecondary", 17 | "tags": { 18 | "data_center": "nyc" 19 | } 20 | } 21 | ] 22 | }, 23 | "operation": "read", 24 | "read_preference": { 25 | "mode": "PrimaryPreferred", 26 | "tag_sets": [ 27 | { 28 | "data_center": "sf" 29 | } 30 | ] 31 | }, 32 | "suitable_servers": [], 33 | "in_latency_window": [] 34 | } 35 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | operation: read 15 | read_preference: 16 | mode: PrimaryPreferred 17 | tag_sets: 18 | - data_center: sf 19 | suitable_servers: [] 20 | in_latency_window: [] 21 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Secondary.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 5 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &2 11 | address: c:27017 12 | avg_rtt_ms: 100 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | operation: read 17 | read_preference: 18 | mode: Secondary 19 | tag_sets: 20 | - data_center: nyc 21 | suitable_servers: 22 | - *1 23 | - *2 24 | in_latency_window: 25 | - *1 26 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 5 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &2 11 | address: c:27017 12 | avg_rtt_ms: 100 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | operation: read 17 | read_preference: 18 | mode: SecondaryPreferred 19 | tag_sets: 20 | - data_center: nyc 21 | suitable_servers: 22 | - *1 23 | - *2 24 | in_latency_window: 25 | - *1 26 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "ReplicaSetNoPrimary", 4 | "servers": [ 5 | { 6 | "address": "b:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "RSSecondary", 9 | "tags": { 10 | "data_center": "nyc" 11 | } 12 | }, 13 | { 14 | "address": "c:27017", 15 | "avg_rtt_ms": 100, 16 | "type": "RSSecondary", 17 | "tags": { 18 | "data_center": "nyc" 19 | } 20 | } 21 | ] 22 | }, 23 | "operation": "read", 24 | "read_preference": { 25 | "mode": "SecondaryPreferred", 26 | "tag_sets": [ 27 | { 28 | "data_center": "sf" 29 | } 30 | ] 31 | }, 32 | "suitable_servers": [], 33 | "in_latency_window": [] 34 | } 35 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | operation: read 15 | read_preference: 16 | mode: SecondaryPreferred 17 | tag_sets: 18 | - data_center: sf 19 | suitable_servers: [] 20 | in_latency_window: [] 21 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags.yml: -------------------------------------------------------------------------------- 1 | # Catch bugs like CDRIVER-1447, ensure clients select a server that matches all 2 | # tags, even when the other server mismatches multiple tags. 3 | --- 4 | topology_description: 5 | type: ReplicaSetNoPrimary 6 | servers: 7 | - &1 8 | address: b:27017 9 | avg_rtt_ms: 5 10 | type: RSSecondary 11 | tags: 12 | rack: one 13 | data_center: nyc 14 | - &2 15 | address: c:27017 16 | avg_rtt_ms: 5 17 | type: RSSecondary 18 | tags: 19 | rack: two 20 | data_center: sf 21 | operation: read 22 | read_preference: 23 | mode: Secondary 24 | tag_sets: 25 | - data_center: nyc 26 | rack: one 27 | - other_tag: doesntexist 28 | suitable_servers: 29 | - *1 30 | in_latency_window: 31 | - *1 32 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags2.yml: -------------------------------------------------------------------------------- 1 | # Ensure clients select a server that matches all tags, even when the other 2 | # server matches one tag and doesn't match the other. 3 | --- 4 | topology_description: 5 | type: ReplicaSetNoPrimary 6 | servers: 7 | - &1 8 | address: b:27017 9 | avg_rtt_ms: 5 10 | type: RSSecondary 11 | tags: 12 | rack: one 13 | data_center: nyc 14 | - &2 15 | address: c:27017 16 | avg_rtt_ms: 5 17 | type: RSSecondary 18 | tags: 19 | rack: two # mismatch 20 | data_center: nyc # match 21 | operation: read 22 | read_preference: 23 | mode: Secondary 24 | tag_sets: 25 | - data_center: nyc 26 | rack: one 27 | - other_tag: doesntexist 28 | suitable_servers: 29 | - *1 30 | in_latency_window: 31 | - *1 32 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Secondary_non_matching.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "ReplicaSetNoPrimary", 4 | "servers": [ 5 | { 6 | "address": "b:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "RSSecondary", 9 | "tags": { 10 | "data_center": "nyc" 11 | } 12 | }, 13 | { 14 | "address": "c:27017", 15 | "avg_rtt_ms": 100, 16 | "type": "RSSecondary", 17 | "tags": { 18 | "data_center": "nyc" 19 | } 20 | } 21 | ] 22 | }, 23 | "operation": "read", 24 | "read_preference": { 25 | "mode": "Secondary", 26 | "tag_sets": [ 27 | { 28 | "data_center": "sf" 29 | } 30 | ] 31 | }, 32 | "suitable_servers": [], 33 | "in_latency_window": [] 34 | } 35 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/read/Secondary_non_matching.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | operation: read 15 | read_preference: 16 | mode: Secondary 17 | tag_sets: 18 | - data_center: sf 19 | suitable_servers: [] 20 | in_latency_window: [] 21 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/write/SecondaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "ReplicaSetNoPrimary", 4 | "servers": [ 5 | { 6 | "address": "b:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "RSSecondary", 9 | "tags": { 10 | "data_center": "nyc" 11 | } 12 | }, 13 | { 14 | "address": "c:27017", 15 | "avg_rtt_ms": 100, 16 | "type": "RSSecondary", 17 | "tags": { 18 | "data_center": "nyc" 19 | } 20 | } 21 | ] 22 | }, 23 | "operation": "write", 24 | "read_preference": { 25 | "mode": "SecondaryPreferred", 26 | "tag_sets": [ 27 | { 28 | "data_center": "nyc" 29 | } 30 | ] 31 | }, 32 | "suitable_servers": [], 33 | "in_latency_window": [] 34 | } 35 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetNoPrimary/write/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetNoPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | operation: write 15 | read_preference: 16 | mode: SecondaryPreferred 17 | tag_sets: 18 | - data_center: nyc 19 | suitable_servers: [] 20 | in_latency_window: [] 21 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/Nearest.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 5 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &3 11 | address: c:27017 12 | avg_rtt_ms: 100 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | - &2 17 | address: a:27017 18 | avg_rtt_ms: 26 19 | type: RSPrimary 20 | tags: 21 | data_center: nyc 22 | operation: read 23 | read_preference: 24 | mode: Nearest 25 | tag_sets: 26 | - data_center: nyc 27 | suitable_servers: 28 | - *1 29 | - *2 30 | - *3 31 | in_latency_window: 32 | - *1 33 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/Nearest_multiple.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 10 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &3 11 | address: c:27017 12 | avg_rtt_ms: 100 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | - &2 17 | address: a:27017 18 | avg_rtt_ms: 20 19 | type: RSPrimary 20 | tags: 21 | data_center: nyc 22 | operation: read 23 | read_preference: 24 | mode: Nearest 25 | tag_sets: 26 | - data_center: nyc 27 | suitable_servers: 28 | - *1 29 | - *2 30 | - *3 31 | in_latency_window: 32 | - *1 33 | - *2 34 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/Nearest_non_matching.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | - address: a:27017 15 | avg_rtt_ms: 26 16 | type: RSPrimary 17 | tags: 18 | data_center: nyc 19 | operation: read 20 | read_preference: 21 | mode: Nearest 22 | tag_sets: 23 | - data_center: sf 24 | suitable_servers: [] 25 | in_latency_window: [] 26 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/Primary.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | - &1 15 | address: a:27017 16 | avg_rtt_ms: 26 17 | type: RSPrimary 18 | tags: 19 | data_center: nyc 20 | operation: read 21 | read_preference: 22 | mode: Primary 23 | suitable_servers: 24 | - *1 25 | in_latency_window: 26 | - *1 27 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | - &1 15 | address: a:27017 16 | avg_rtt_ms: 26 17 | type: RSPrimary 18 | tags: 19 | data_center: nyc 20 | operation: read 21 | read_preference: 22 | mode: PrimaryPreferred 23 | tag_sets: 24 | - {} 25 | suitable_servers: 26 | - *1 27 | in_latency_window: 28 | - *1 29 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred_non_matching.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | - &1 15 | address: a:27017 16 | avg_rtt_ms: 26 17 | type: RSPrimary 18 | tags: 19 | data_center: nyc 20 | operation: read 21 | read_preference: 22 | mode: PrimaryPreferred 23 | tag_sets: 24 | - data_center: sf 25 | suitable_servers: 26 | - *1 27 | in_latency_window: 28 | - *1 29 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/Secondary.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 5 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &2 11 | address: c:27017 12 | avg_rtt_ms: 100 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | - address: a:27017 17 | avg_rtt_ms: 26 18 | type: RSPrimary 19 | tags: 20 | data_center: nyc 21 | operation: read 22 | read_preference: 23 | mode: Secondary 24 | tag_sets: 25 | - data_center: nyc 26 | suitable_servers: 27 | - *1 28 | - *2 29 | in_latency_window: 30 | - *1 31 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - &1 5 | address: b:27017 6 | avg_rtt_ms: 5 7 | type: RSSecondary 8 | tags: 9 | data_center: nyc 10 | - &2 11 | address: c:27017 12 | avg_rtt_ms: 100 13 | type: RSSecondary 14 | tags: 15 | data_center: nyc 16 | - address: a:27017 17 | avg_rtt_ms: 26 18 | type: RSPrimary 19 | tags: 20 | data_center: nyc 21 | operation: read 22 | read_preference: 23 | mode: SecondaryPreferred 24 | tag_sets: 25 | - data_center: nyc 26 | suitable_servers: 27 | - *1 28 | - *2 29 | in_latency_window: 30 | - *1 31 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_non_matching.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | - &1 15 | address: a:27017 16 | avg_rtt_ms: 26 17 | type: RSPrimary 18 | tags: 19 | data_center: nyc 20 | operation: read 21 | read_preference: 22 | mode: SecondaryPreferred 23 | tag_sets: 24 | - data_center: sf 25 | suitable_servers: 26 | - *1 27 | in_latency_window: 28 | - *1 29 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_tags.yml: -------------------------------------------------------------------------------- 1 | # Attempt to select the secondary, except its tag doesn't match. 2 | # Fall back to primary. 3 | --- 4 | topology_description: 5 | type: ReplicaSetWithPrimary 6 | servers: 7 | - &1 8 | address: a:27017 9 | avg_rtt_ms: 5 10 | type: RSPrimary 11 | tags: 12 | data_center: nyc 13 | - &2 14 | address: b:27017 15 | avg_rtt_ms: 5 16 | type: RSSecondary 17 | tags: 18 | data_center: sf # No match. 19 | operation: read 20 | read_preference: 21 | mode: SecondaryPreferred 22 | tag_sets: 23 | - data_center: nyc 24 | suitable_servers: 25 | - *1 26 | in_latency_window: 27 | - *1 28 | 29 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/read/Secondary_non_matching.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | - address: a:27017 15 | avg_rtt_ms: 26 16 | type: RSPrimary 17 | tags: 18 | data_center: nyc 19 | operation: read 20 | read_preference: 21 | mode: Secondary 22 | tag_sets: 23 | - data_center: sf 24 | suitable_servers: [] 25 | in_latency_window: [] 26 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/ReplicaSetWithPrimary/write/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: ReplicaSetWithPrimary 3 | servers: 4 | - address: b:27017 5 | avg_rtt_ms: 5 6 | type: RSSecondary 7 | tags: 8 | data_center: nyc 9 | - address: c:27017 10 | avg_rtt_ms: 100 11 | type: RSSecondary 12 | tags: 13 | data_center: nyc 14 | - &1 15 | address: a:27017 16 | avg_rtt_ms: 26 17 | type: RSPrimary 18 | tags: 19 | data_center: nyc 20 | operation: write 21 | read_preference: 22 | mode: SecondaryPreferred 23 | tag_sets: 24 | - data_center: nyc 25 | suitable_servers: 26 | - *1 27 | in_latency_window: 28 | - *1 29 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/Nearest.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "read", 18 | "read_preference": { 19 | "mode": "Nearest", 20 | "tag_sets": [ 21 | { 22 | "data_center": "nyc" 23 | } 24 | ] 25 | }, 26 | "suitable_servers": [ 27 | { 28 | "address": "g:27017", 29 | "avg_rtt_ms": 5, 30 | "type": "Mongos" 31 | }, 32 | { 33 | "address": "h:27017", 34 | "avg_rtt_ms": 35, 35 | "type": "Mongos" 36 | } 37 | ], 38 | "in_latency_window": [ 39 | { 40 | "address": "g:27017", 41 | "avg_rtt_ms": 5, 42 | "type": "Mongos" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/Nearest.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: read 13 | read_preference: 14 | mode: Nearest 15 | tag_sets: 16 | - data_center: nyc 17 | suitable_servers: 18 | - *1 19 | - *2 20 | in_latency_window: 21 | - *1 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/Primary.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "read", 18 | "read_preference": { 19 | "mode": "Primary" 20 | }, 21 | "suitable_servers": [ 22 | { 23 | "address": "g:27017", 24 | "avg_rtt_ms": 5, 25 | "type": "Mongos" 26 | }, 27 | { 28 | "address": "h:27017", 29 | "avg_rtt_ms": 35, 30 | "type": "Mongos" 31 | } 32 | ], 33 | "in_latency_window": [ 34 | { 35 | "address": "g:27017", 36 | "avg_rtt_ms": 5, 37 | "type": "Mongos" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/Primary.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: read 13 | read_preference: 14 | mode: Primary 15 | suitable_servers: 16 | - *1 17 | - *2 18 | in_latency_window: 19 | - *1 20 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/PrimaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "read", 18 | "read_preference": { 19 | "mode": "PrimaryPreferred", 20 | "tag_sets": [ 21 | { 22 | "data_center": "nyc" 23 | } 24 | ] 25 | }, 26 | "suitable_servers": [ 27 | { 28 | "address": "g:27017", 29 | "avg_rtt_ms": 5, 30 | "type": "Mongos" 31 | }, 32 | { 33 | "address": "h:27017", 34 | "avg_rtt_ms": 35, 35 | "type": "Mongos" 36 | } 37 | ], 38 | "in_latency_window": [ 39 | { 40 | "address": "g:27017", 41 | "avg_rtt_ms": 5, 42 | "type": "Mongos" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/PrimaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: read 13 | read_preference: 14 | mode: PrimaryPreferred 15 | tag_sets: 16 | - data_center: nyc 17 | suitable_servers: 18 | - *1 19 | - *2 20 | in_latency_window: 21 | - *1 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/Secondary.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "read", 18 | "read_preference": { 19 | "mode": "Secondary", 20 | "tag_sets": [ 21 | { 22 | "data_center": "nyc" 23 | } 24 | ] 25 | }, 26 | "suitable_servers": [ 27 | { 28 | "address": "g:27017", 29 | "avg_rtt_ms": 5, 30 | "type": "Mongos" 31 | }, 32 | { 33 | "address": "h:27017", 34 | "avg_rtt_ms": 35, 35 | "type": "Mongos" 36 | } 37 | ], 38 | "in_latency_window": [ 39 | { 40 | "address": "g:27017", 41 | "avg_rtt_ms": 5, 42 | "type": "Mongos" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/Secondary.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: read 13 | read_preference: 14 | mode: Secondary 15 | tag_sets: 16 | - data_center: nyc 17 | suitable_servers: 18 | - *1 19 | - *2 20 | in_latency_window: 21 | - *1 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/SecondaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "read", 18 | "read_preference": { 19 | "mode": "SecondaryPreferred", 20 | "tag_sets": [ 21 | { 22 | "data_center": "nyc" 23 | } 24 | ] 25 | }, 26 | "suitable_servers": [ 27 | { 28 | "address": "g:27017", 29 | "avg_rtt_ms": 5, 30 | "type": "Mongos" 31 | }, 32 | { 33 | "address": "h:27017", 34 | "avg_rtt_ms": 35, 35 | "type": "Mongos" 36 | } 37 | ], 38 | "in_latency_window": [ 39 | { 40 | "address": "g:27017", 41 | "avg_rtt_ms": 5, 42 | "type": "Mongos" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/read/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: read 13 | read_preference: 14 | mode: SecondaryPreferred 15 | tag_sets: 16 | - data_center: nyc 17 | suitable_servers: 18 | - *1 19 | - *2 20 | in_latency_window: 21 | - *1 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/Nearest.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "write", 18 | "read_preference": { 19 | "mode": "Nearest", 20 | "tag_sets": [ 21 | { 22 | "data_center": "nyc" 23 | } 24 | ] 25 | }, 26 | "suitable_servers": [ 27 | { 28 | "address": "g:27017", 29 | "avg_rtt_ms": 5, 30 | "type": "Mongos" 31 | }, 32 | { 33 | "address": "h:27017", 34 | "avg_rtt_ms": 35, 35 | "type": "Mongos" 36 | } 37 | ], 38 | "in_latency_window": [ 39 | { 40 | "address": "g:27017", 41 | "avg_rtt_ms": 5, 42 | "type": "Mongos" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/Nearest.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: write 13 | read_preference: 14 | mode: Nearest 15 | tag_sets: 16 | - data_center: nyc 17 | suitable_servers: 18 | - *1 19 | - *2 20 | in_latency_window: 21 | - *1 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/Primary.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "write", 18 | "read_preference": { 19 | "mode": "Primary" 20 | }, 21 | "suitable_servers": [ 22 | { 23 | "address": "g:27017", 24 | "avg_rtt_ms": 5, 25 | "type": "Mongos" 26 | }, 27 | { 28 | "address": "h:27017", 29 | "avg_rtt_ms": 35, 30 | "type": "Mongos" 31 | } 32 | ], 33 | "in_latency_window": [ 34 | { 35 | "address": "g:27017", 36 | "avg_rtt_ms": 5, 37 | "type": "Mongos" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/Primary.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: write 13 | read_preference: 14 | mode: Primary 15 | suitable_servers: 16 | - *1 17 | - *2 18 | in_latency_window: 19 | - *1 20 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/PrimaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "write", 18 | "read_preference": { 19 | "mode": "PrimaryPreferred", 20 | "tag_sets": [ 21 | { 22 | "data_center": "nyc" 23 | } 24 | ] 25 | }, 26 | "suitable_servers": [ 27 | { 28 | "address": "g:27017", 29 | "avg_rtt_ms": 5, 30 | "type": "Mongos" 31 | }, 32 | { 33 | "address": "h:27017", 34 | "avg_rtt_ms": 35, 35 | "type": "Mongos" 36 | } 37 | ], 38 | "in_latency_window": [ 39 | { 40 | "address": "g:27017", 41 | "avg_rtt_ms": 5, 42 | "type": "Mongos" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/PrimaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: write 13 | read_preference: 14 | mode: PrimaryPreferred 15 | tag_sets: 16 | - data_center: nyc 17 | suitable_servers: 18 | - *1 19 | - *2 20 | in_latency_window: 21 | - *1 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/Secondary.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "write", 18 | "read_preference": { 19 | "mode": "Secondary", 20 | "tag_sets": [ 21 | { 22 | "data_center": "nyc" 23 | } 24 | ] 25 | }, 26 | "suitable_servers": [ 27 | { 28 | "address": "g:27017", 29 | "avg_rtt_ms": 5, 30 | "type": "Mongos" 31 | }, 32 | { 33 | "address": "h:27017", 34 | "avg_rtt_ms": 35, 35 | "type": "Mongos" 36 | } 37 | ], 38 | "in_latency_window": [ 39 | { 40 | "address": "g:27017", 41 | "avg_rtt_ms": 5, 42 | "type": "Mongos" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/Secondary.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: write 13 | read_preference: 14 | mode: Secondary 15 | tag_sets: 16 | - data_center: nyc 17 | suitable_servers: 18 | - *1 19 | - *2 20 | in_latency_window: 21 | - *1 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/SecondaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Sharded", 4 | "servers": [ 5 | { 6 | "address": "g:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Mongos" 9 | }, 10 | { 11 | "address": "h:27017", 12 | "avg_rtt_ms": 35, 13 | "type": "Mongos" 14 | } 15 | ] 16 | }, 17 | "operation": "write", 18 | "read_preference": { 19 | "mode": "SecondaryPreferred", 20 | "tag_sets": [ 21 | { 22 | "data_center": "nyc" 23 | } 24 | ] 25 | }, 26 | "suitable_servers": [ 27 | { 28 | "address": "g:27017", 29 | "avg_rtt_ms": 5, 30 | "type": "Mongos" 31 | }, 32 | { 33 | "address": "h:27017", 34 | "avg_rtt_ms": 35, 35 | "type": "Mongos" 36 | } 37 | ], 38 | "in_latency_window": [ 39 | { 40 | "address": "g:27017", 41 | "avg_rtt_ms": 5, 42 | "type": "Mongos" 43 | } 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Sharded/write/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Sharded 3 | servers: 4 | - &1 5 | address: g:27017 6 | avg_rtt_ms: 5 7 | type: Mongos 8 | - &2 9 | address: h:27017 10 | avg_rtt_ms: 35 11 | type: Mongos 12 | operation: write 13 | read_preference: 14 | mode: SecondaryPreferred 15 | tag_sets: 16 | - data_center: nyc 17 | suitable_servers: 18 | - *1 19 | - *2 20 | in_latency_window: 21 | - *1 22 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Single/read/SecondaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Single", 4 | "servers": [ 5 | { 6 | "address": "a:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Standalone", 9 | "tags": { 10 | "data_center": "dc" 11 | } 12 | } 13 | ] 14 | }, 15 | "operation": "read", 16 | "read_preference": { 17 | "mode": "SecondaryPreferred", 18 | "tag_sets": [ 19 | { 20 | "data_center": "nyc" 21 | } 22 | ] 23 | }, 24 | "suitable_servers": [ 25 | { 26 | "address": "a:27017", 27 | "avg_rtt_ms": 5, 28 | "type": "Standalone", 29 | "tags": { 30 | "data_center": "dc" 31 | } 32 | } 33 | ], 34 | "in_latency_window": [ 35 | { 36 | "address": "a:27017", 37 | "avg_rtt_ms": 5, 38 | "type": "Standalone", 39 | "tags": { 40 | "data_center": "dc" 41 | } 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Single/read/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Single 3 | servers: 4 | - &1 5 | address: a:27017 6 | avg_rtt_ms: 5 7 | type: Standalone 8 | tags: 9 | data_center: dc 10 | operation: read 11 | read_preference: 12 | mode: SecondaryPreferred 13 | tag_sets: 14 | - data_center: nyc 15 | suitable_servers: 16 | - *1 17 | in_latency_window: 18 | - *1 19 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Single/write/SecondaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Single", 4 | "servers": [ 5 | { 6 | "address": "a:27017", 7 | "avg_rtt_ms": 5, 8 | "type": "Standalone", 9 | "tags": { 10 | "data_center": "dc" 11 | } 12 | } 13 | ] 14 | }, 15 | "operation": "write", 16 | "read_preference": { 17 | "mode": "SecondaryPreferred", 18 | "tag_sets": [ 19 | { 20 | "data_center": "nyc" 21 | } 22 | ] 23 | }, 24 | "suitable_servers": [ 25 | { 26 | "address": "a:27017", 27 | "avg_rtt_ms": 5, 28 | "type": "Standalone", 29 | "tags": { 30 | "data_center": "dc" 31 | } 32 | } 33 | ], 34 | "in_latency_window": [ 35 | { 36 | "address": "a:27017", 37 | "avg_rtt_ms": 5, 38 | "type": "Standalone", 39 | "tags": { 40 | "data_center": "dc" 41 | } 42 | } 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Single/write/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Single 3 | servers: 4 | - &1 5 | address: a:27017 6 | avg_rtt_ms: 5 7 | type: Standalone 8 | tags: 9 | data_center: dc 10 | operation: write 11 | read_preference: 12 | mode: SecondaryPreferred 13 | tag_sets: 14 | - data_center: nyc 15 | suitable_servers: 16 | - *1 17 | in_latency_window: 18 | - *1 19 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Unknown/read/SecondaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Unknown", 4 | "servers": [] 5 | }, 6 | "operation": "read", 7 | "read_preference": { 8 | "mode": "SecondaryPreferred", 9 | "tag_sets": [ 10 | { 11 | "data_center": "nyc" 12 | } 13 | ] 14 | }, 15 | "suitable_servers": [], 16 | "in_latency_window": [] 17 | } 18 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Unknown/read/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Unknown 3 | servers: [] 4 | operation: read 5 | read_preference: 6 | mode: SecondaryPreferred 7 | tag_sets: 8 | - data_center: nyc 9 | suitable_servers: [] 10 | in_latency_window: [] 11 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Unknown/write/SecondaryPreferred.json: -------------------------------------------------------------------------------- 1 | { 2 | "topology_description": { 3 | "type": "Unknown", 4 | "servers": [] 5 | }, 6 | "operation": "write", 7 | "read_preference": { 8 | "mode": "SecondaryPreferred", 9 | "tag_sets": [ 10 | { 11 | "data_center": "nyc" 12 | } 13 | ] 14 | }, 15 | "suitable_servers": [], 16 | "in_latency_window": [] 17 | } 18 | -------------------------------------------------------------------------------- /t/data/SS/server_selection/Unknown/write/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | topology_description: 2 | type: Unknown 3 | servers: [] 4 | operation: write 5 | read_preference: 6 | mode: SecondaryPreferred 7 | tag_sets: 8 | - data_center: nyc 9 | suitable_servers: [] 10 | in_latency_window: [] 11 | -------------------------------------------------------------------------------- /t/data/connection_string/valid-options.json: -------------------------------------------------------------------------------- 1 | { 2 | "tests": [ 3 | { 4 | "description": "Option names are normalized to lowercase", 5 | "uri": "mongodb://alice:secret@example.com/admin?AUTHMechanism=MONGODB-CR", 6 | "valid": true, 7 | "warning": false, 8 | "hosts": [ 9 | { 10 | "type": "hostname", 11 | "host": "example.com", 12 | "port": null 13 | } 14 | ], 15 | "auth": { 16 | "username": "alice", 17 | "password": "secret", 18 | "db": "admin" 19 | }, 20 | "options": { 21 | "authmechanism": "MONGODB-CR" 22 | } 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /t/data/connection_string/valid-options.yml: -------------------------------------------------------------------------------- 1 | tests: 2 | - 3 | description: "Option names are normalized to lowercase" 4 | uri: "mongodb://alice:secret@example.com/admin?AUTHMechanism=MONGODB-CR" 5 | valid: true 6 | warning: false 7 | hosts: 8 | - 9 | type: "hostname" 10 | host: "example.com" 11 | port: ~ 12 | auth: 13 | username: "alice" 14 | password: "secret" 15 | db: "admin" 16 | options: 17 | authmechanism: "MONGODB-CR" 18 | -------------------------------------------------------------------------------- /t/data/gridfs/.gitattributes: -------------------------------------------------------------------------------- 1 | /big.txt binary 2 | /data.bin binary 3 | /input.txt binary 4 | -------------------------------------------------------------------------------- /t/data/gridfs/data.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-labs/mongo-perl-driver/6ea528c8051368f253583668e37bc452acb5a632/t/data/gridfs/data.bin -------------------------------------------------------------------------------- /t/data/gridfs/input.txt: -------------------------------------------------------------------------------- 1 | abc 2 | 3 | zyw 4 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/longer-parent-in-return.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test18.test.build.10gen.cc/?replicaSet=repl0", 3 | "seeds": [ 4 | "localhost.sub.test.build.10gen.cc:27017" 5 | ], 6 | "hosts": [ 7 | "localhost:27017", 8 | "localhost:27018", 9 | "localhost:27019" 10 | ], 11 | "options": { 12 | "replicaSet": "repl0", 13 | "ssl": true 14 | }, 15 | "comment": "Is correct, as returned host name shared the URI root \"test.build.10gen.cc\"." 16 | } 17 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/longer-parent-in-return.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test18.test.build.10gen.cc/?replicaSet=repl0" 2 | seeds: 3 | - localhost.sub.test.build.10gen.cc:27017 4 | hosts: 5 | - localhost:27017 6 | - localhost:27018 7 | - localhost:27019 8 | options: 9 | replicaSet: repl0 10 | ssl: true 11 | comment: Is correct, as returned host name shared the URI root "test.build.10gen.cc". 12 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/misformatted-option.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test8.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because the options in the TXT record are incorrectly formatted (misses value)." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/misformatted-option.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test8.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because the options in the TXT record are incorrectly formatted (misses value). 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/no-results.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test4.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because no SRV records are present for this URI." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/no-results.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test4.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because no SRV records are present for this URI. 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/not-enough-parts.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because host in URI does not have {hostname}, {domainname} and {tld}." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/not-enough-parts.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because host in URI does not have {hostname}, {domainname} and {tld}. 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/one-result-default-port.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test3.test.build.10gen.cc/?replicaSet=repl0", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27017" 5 | ], 6 | "hosts": [ 7 | "localhost:27017", 8 | "localhost:27018", 9 | "localhost:27019" 10 | ], 11 | "options": { 12 | "replicaSet": "repl0", 13 | "ssl": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/one-result-default-port.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test3.test.build.10gen.cc/?replicaSet=repl0" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27017 4 | hosts: 5 | - localhost:27017 6 | - localhost:27018 7 | - localhost:27019 8 | options: 9 | replicaSet: repl0 10 | ssl: true 11 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/one-txt-record-multiple-strings.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test11.test.build.10gen.cc/", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27017" 5 | ], 6 | "hosts": [ 7 | "localhost:27017", 8 | "localhost:27018", 9 | "localhost:27019" 10 | ], 11 | "options": { 12 | "replicaSet": "repl0", 13 | "ssl": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/one-txt-record-multiple-strings.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test11.test.build.10gen.cc/" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27017 4 | hosts: 5 | - localhost:27017 6 | - localhost:27018 7 | - localhost:27019 8 | options: 9 | replicaSet: repl0 10 | ssl: true 11 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/one-txt-record.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test5.test.build.10gen.cc/", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27017" 5 | ], 6 | "hosts": [ 7 | "localhost:27017", 8 | "localhost:27018", 9 | "localhost:27019" 10 | ], 11 | "options": { 12 | "replicaSet": "repl0", 13 | "authSource": "thisDB", 14 | "ssl": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/one-txt-record.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test5.test.build.10gen.cc/" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27017 4 | hosts: 5 | - localhost:27017 6 | - localhost:27018 7 | - localhost:27019 8 | options: 9 | replicaSet: repl0 10 | authSource: thisDB 11 | ssl: true 12 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch1.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test14.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because returned host name's part \"not-test\" mismatches URI parent part \"test\"." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch1.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test14.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because returned host name's part "not-test" mismatches URI parent part "test". 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch2.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test15.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because returned host name's part \"not-build\" mismatches URI parent part \"build\"." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch2.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test15.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because returned host name's part "not-build" mismatches URI parent part "build". 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch3.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test16.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because returned host name's part \"not-10gen\" mismatches URI parent part \"10gen\"." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch3.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test16.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because returned host name's part "not-10gen" mismatches URI parent part "10gen". 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch4.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test17.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because returned host name's TLD \"not-cc\" mismatches URI TLD \"cc\"." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch4.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test17.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because returned host name's TLD "not-cc" mismatches URI TLD "cc". 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch5.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test19.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because one of the returned host names' domain name parts \"evil\" mismatches \"test\"." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/parent-part-mismatch5.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test19.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because one of the returned host names' domain name parts "evil" mismatches "test". 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/returned-parent-too-short.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test13.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because returned host name's parent (build.10gen.cc) misses \"test.\"" 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/returned-parent-too-short.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test13.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because returned host name's parent (build.10gen.cc) misses "test." 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/returned-parent-wrong.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test12.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because returned host name is too short and mismatches a parent." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/returned-parent-wrong.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test12.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because returned host name is too short and mismatches a parent. 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/two-results-default-port.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27017", 5 | "localhost.test.build.10gen.cc:27018" 6 | ], 7 | "hosts": [ 8 | "localhost:27017", 9 | "localhost:27018", 10 | "localhost:27019" 11 | ], 12 | "options": { 13 | "replicaSet": "repl0", 14 | "ssl": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/two-results-default-port.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27017 4 | - localhost.test.build.10gen.cc:27018 5 | hosts: 6 | - localhost:27017 7 | - localhost:27018 8 | - localhost:27019 9 | options: 10 | replicaSet: repl0 11 | ssl: true 12 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/two-results-nonstandard-port.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test2.test.build.10gen.cc/?replicaSet=repl0", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27018", 5 | "localhost.test.build.10gen.cc:27019" 6 | ], 7 | "hosts": [ 8 | "localhost:27017", 9 | "localhost:27018", 10 | "localhost:27019" 11 | ], 12 | "options": { 13 | "replicaSet": "repl0", 14 | "ssl": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/two-results-nonstandard-port.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test2.test.build.10gen.cc/?replicaSet=repl0" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27018 4 | - localhost.test.build.10gen.cc:27019 5 | hosts: 6 | - localhost:27017 7 | - localhost:27018 8 | - localhost:27019 9 | options: 10 | replicaSet: repl0 11 | ssl: true 12 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/two-txt-records.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test6.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because there are two TXT records." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/two-txt-records.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test6.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because there are two TXT records. 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/txt-record-not-allowed-option.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test10.test.build.10gen.cc/?replicaSet=repl0", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because socketTimeoutMS is not an allowed option." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/txt-record-not-allowed-option.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test10.test.build.10gen.cc/?replicaSet=repl0" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because socketTimeoutMS is not an allowed option. 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/txt-record-with-overridden-ssl-option.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test5.test.build.10gen.cc/?ssl=false", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27017" 5 | ], 6 | "hosts": [ 7 | "localhost:27017", 8 | "localhost:27018", 9 | "localhost:27019" 10 | ], 11 | "options": { 12 | "replicaSet": "repl0", 13 | "authSource": "thisDB", 14 | "ssl": false 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/txt-record-with-overridden-ssl-option.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test5.test.build.10gen.cc/?ssl=false" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27017 4 | hosts: 5 | - localhost:27017 6 | - localhost:27018 7 | - localhost:27019 8 | options: 9 | replicaSet: repl0 10 | authSource: thisDB 11 | ssl: false 12 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/txt-record-with-overridden-uri-option.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test5.test.build.10gen.cc/?authSource=otherDB", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27017" 5 | ], 6 | "hosts": [ 7 | "localhost:27017", 8 | "localhost:27018", 9 | "localhost:27019" 10 | ], 11 | "options": { 12 | "replicaSet": "repl0", 13 | "authSource": "otherDB", 14 | "ssl": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/txt-record-with-overridden-uri-option.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test5.test.build.10gen.cc/?authSource=otherDB" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27017 4 | hosts: 5 | - localhost:27017 6 | - localhost:27018 7 | - localhost:27019 8 | options: 9 | replicaSet: repl0 10 | authSource: otherDB 11 | ssl: true 12 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/txt-record-with-unallowed-option.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test7.test.build.10gen.cc/", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because \"ssl\" is not an allowed option." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/txt-record-with-unallowed-option.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test7.test.build.10gen.cc/" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because "ssl" is not an allowed option. 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/uri-with-admin-database.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test1.test.build.10gen.cc/adminDB?replicaSet=repl0", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27017", 5 | "localhost.test.build.10gen.cc:27018" 6 | ], 7 | "hosts": [ 8 | "localhost:27017", 9 | "localhost:27018", 10 | "localhost:27019" 11 | ], 12 | "options": { 13 | "replicaSet": "repl0", 14 | "ssl": true 15 | }, 16 | "parsed_options": { 17 | "auth_database": "adminDB" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/uri-with-admin-database.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test1.test.build.10gen.cc/adminDB?replicaSet=repl0" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27017 4 | - localhost.test.build.10gen.cc:27018 5 | hosts: 6 | - localhost:27017 7 | - localhost:27018 8 | - localhost:27019 9 | options: 10 | replicaSet: repl0 11 | ssl: true 12 | parsed_options: 13 | auth_database: adminDB 14 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/uri-with-auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://auser:apass@test1.test.build.10gen.cc/?replicaSet=repl0", 3 | "seeds": [ 4 | "localhost.test.build.10gen.cc:27017", 5 | "localhost.test.build.10gen.cc:27018" 6 | ], 7 | "hosts": [ 8 | "localhost:27017", 9 | "localhost:27018", 10 | "localhost:27019" 11 | ], 12 | "parsed_options": { 13 | "user": "auser", 14 | "password": "apass" 15 | }, 16 | "comment": "Should preserve auth credentials" 17 | } 18 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/uri-with-auth.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://auser:apass@test1.test.build.10gen.cc/?replicaSet=repl0" 2 | seeds: 3 | - localhost.test.build.10gen.cc:27017 4 | - localhost.test.build.10gen.cc:27018 5 | hosts: 6 | - localhost:27017 7 | - localhost:27018 8 | - localhost:27019 9 | parsed_options: 10 | user: auser 11 | password: apass 12 | comment: Should preserve auth credentials 13 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/uri-with-port.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test5.test.build.10gen.cc:8123/?replicaSet=repl0", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because the mongodb+srv URI includes a port." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/uri-with-port.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test5.test.build.10gen.cc:8123/?replicaSet=repl0" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because the mongodb+srv URI includes a port. 6 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/uri-with-two-hosts.json: -------------------------------------------------------------------------------- 1 | { 2 | "uri": "mongodb+srv://test5.test.build.10gen.cc,test6.test.build.10gen.cc/?replicaSet=repl0", 3 | "seeds": [], 4 | "hosts": [], 5 | "error": true, 6 | "comment": "Should fail because the mongodb+srv URI includes two host names." 7 | } 8 | -------------------------------------------------------------------------------- /t/data/initial_dns_seedlist_discovery/uri-with-two-hosts.yml: -------------------------------------------------------------------------------- 1 | uri: "mongodb+srv://test5.test.build.10gen.cc,test6.test.build.10gen.cc/?replicaSet=repl0" 2 | seeds: [] 3 | hosts: [] 4 | error: true 5 | comment: Should fail because the mongodb+srv URI includes two host names. 6 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/DefaultNoMaxStaleness.yml: -------------------------------------------------------------------------------- 1 | # By default, a read preference sets no maximum on staleness. 2 | --- 3 | topology_description: 4 | type: ReplicaSetNoPrimary 5 | servers: 6 | - &1 7 | address: a:27017 8 | type: RSSecondary 9 | avg_rtt_ms: 50 # Too far. 10 | lastUpdateTime: 0 11 | maxWireVersion: 5 12 | lastWrite: {lastWriteDate: {$numberLong: "1000001"}} 13 | - &2 14 | address: b:27017 15 | type: RSSecondary 16 | avg_rtt_ms: 5 17 | lastUpdateTime: 0 18 | maxWireVersion: 5 19 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Very stale. 20 | read_preference: 21 | mode: Nearest 22 | suitable_servers: # Very stale server is fine. 23 | - *1 24 | - *2 25 | in_latency_window: 26 | - *2 27 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/Incompatible.yml: -------------------------------------------------------------------------------- 1 | # During server selection, clients (drivers or mongos) MUST raise an error if 2 | # maxStalenessSeconds is defined and not -1 and any server's ``maxWireVersion`` 3 | # is less than 5 (`SERVER-23893`_). 4 | --- 5 | topology_description: 6 | type: ReplicaSetNoPrimary 7 | servers: 8 | - &1 9 | address: a:27017 10 | type: RSSecondary 11 | avg_rtt_ms: 5 12 | lastUpdateTime: 0 13 | maxWireVersion: 5 14 | lastWrite: {lastWriteDate: {$numberLong: "2"}} 15 | - &2 16 | address: b:27017 17 | type: RSSecondary 18 | avg_rtt_ms: 5 19 | lastUpdateTime: 0 20 | maxWireVersion: 4 # Incompatible. 21 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 22 | read_preference: 23 | mode: Nearest 24 | maxStalenessSeconds: 120 25 | error: true 26 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/Nearest.yml: -------------------------------------------------------------------------------- 1 | heartbeatFrequencyMS: 25000 # 25 seconds. 2 | topology_description: 3 | type: ReplicaSetNoPrimary 4 | servers: 5 | - &1 6 | address: a:27017 7 | type: RSSecondary 8 | avg_rtt_ms: 5 9 | lastUpdateTime: 0 10 | lastWrite: {lastWriteDate: {$numberLong: "125002"}} 11 | maxWireVersion: 5 12 | - &2 13 | address: b:27017 14 | type: RSSecondary 15 | avg_rtt_ms: 50 # Too far. 16 | lastUpdateTime: 0 17 | lastWrite: {lastWriteDate: {$numberLong: "2"}} # 125 sec stale + 25 sec heartbeat <= 150 sec maxStaleness. 18 | maxWireVersion: 5 19 | - &3 20 | address: c:27017 21 | avg_rtt_ms: 5 22 | lastUpdateTime: 0 23 | type: RSSecondary 24 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Too stale. 25 | maxWireVersion: 5 26 | read_preference: 27 | mode: Nearest 28 | maxStalenessSeconds: 150 29 | suitable_servers: 30 | - *1 31 | - *2 32 | in_latency_window: 33 | - *1 34 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/Nearest2.yml: -------------------------------------------------------------------------------- 1 | heartbeatFrequencyMS: 25000 # 25 seconds. 2 | topology_description: 3 | type: ReplicaSetNoPrimary 4 | servers: 5 | - &1 6 | address: a:27017 7 | type: RSSecondary 8 | avg_rtt_ms: 50 # Too far. 9 | lastUpdateTime: 0 10 | lastWrite: {lastWriteDate: {$numberLong: "125002"}} 11 | maxWireVersion: 5 12 | - &2 13 | address: b:27017 14 | type: RSSecondary 15 | avg_rtt_ms: 5 16 | lastUpdateTime: 0 17 | lastWrite: {lastWriteDate: {$numberLong: "2"}} # 125 sec stale + 25 sec heartbeat <= 150 sec maxStaleness. 18 | maxWireVersion: 5 19 | - &3 20 | address: c:27017 21 | avg_rtt_ms: 5 22 | lastUpdateTime: 0 23 | type: RSSecondary 24 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Too stale. 25 | maxWireVersion: 5 26 | read_preference: 27 | mode: Nearest 28 | maxStalenessSeconds: 150 29 | suitable_servers: 30 | - *1 31 | - *2 32 | in_latency_window: 33 | - *2 34 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/NoKnownServers.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": true, 3 | "read_preference": { 4 | "maxStalenessSeconds": 1, 5 | "mode": "Nearest" 6 | }, 7 | "topology_description": { 8 | "servers": [ 9 | { 10 | "address": "a:27017", 11 | "type": "Unknown" 12 | }, 13 | { 14 | "address": "b:27017", 15 | "type": "Unknown" 16 | } 17 | ], 18 | "type": "ReplicaSetNoPrimary" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/NoKnownServers.yml: -------------------------------------------------------------------------------- 1 | # maxStalenessSeconds must be at least 90 seconds, even with no known servers. 2 | --- 3 | topology_description: 4 | type: ReplicaSetNoPrimary 5 | servers: 6 | - &1 7 | address: a:27017 8 | type: Unknown 9 | - &2 10 | address: b:27017 11 | type: Unknown 12 | read_preference: 13 | mode: Nearest 14 | maxStalenessSeconds: 1 # Too small. 15 | error: true 16 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/PrimaryPreferred.yml: -------------------------------------------------------------------------------- 1 | # Fallback to secondary if no primary. 2 | --- 3 | heartbeatFrequencyMS: 25000 # 25 seconds. 4 | topology_description: 5 | type: ReplicaSetNoPrimary 6 | servers: 7 | - &1 8 | address: a:27017 9 | type: RSSecondary 10 | avg_rtt_ms: 5 11 | lastUpdateTime: 0 12 | maxWireVersion: 5 13 | lastWrite: {lastWriteDate: {$numberLong: "1000001"}} 14 | - &2 15 | address: b:27017 16 | type: RSSecondary 17 | avg_rtt_ms: 5 18 | lastUpdateTime: 0 19 | maxWireVersion: 5 20 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Very stale. 21 | read_preference: 22 | mode: PrimaryPreferred 23 | maxStalenessSeconds: 90 24 | suitable_servers: 25 | - *1 26 | in_latency_window: 27 | - *1 28 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | # Filter out the stale secondary. 2 | --- 3 | topology_description: 4 | type: ReplicaSetNoPrimary 5 | servers: 6 | - &1 7 | address: a:27017 8 | type: RSSecondary 9 | avg_rtt_ms: 5 10 | lastUpdateTime: 0 11 | maxWireVersion: 5 12 | lastWrite: {lastWriteDate: {$numberLong: "1000001"}} 13 | - &2 14 | address: b:27017 15 | type: RSSecondary 16 | avg_rtt_ms: 5 17 | lastUpdateTime: 0 18 | maxWireVersion: 5 19 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Very stale. 20 | read_preference: 21 | mode: SecondaryPreferred 22 | maxStalenessSeconds: 120 23 | suitable_servers: 24 | - *1 25 | in_latency_window: 26 | - *1 27 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetNoPrimary/ZeroMaxStaleness.yml: -------------------------------------------------------------------------------- 1 | # maxStalenessSeconds=0 is prohibited. 2 | --- 3 | topology_description: 4 | type: ReplicaSetNoPrimary 5 | servers: 6 | - &1 7 | address: a:27017 8 | type: RSSecondary 9 | avg_rtt_ms: 5 10 | lastUpdateTime: 0 11 | maxWireVersion: 5 12 | lastWrite: {lastWriteDate: {$numberLong: "2"}} 13 | - &2 14 | address: b:27017 15 | type: RSSecondary 16 | avg_rtt_ms: 5 17 | lastUpdateTime: 0 18 | maxWireVersion: 4 # Incompatible. 19 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 20 | read_preference: 21 | mode: Nearest 22 | maxStalenessSeconds: 0 23 | error: true 24 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/DefaultNoMaxStaleness.yml: -------------------------------------------------------------------------------- 1 | # By default, a read preference sets no maximum on staleness. 2 | --- 3 | topology_description: 4 | type: ReplicaSetWithPrimary 5 | servers: 6 | - &1 7 | address: a:27017 8 | type: RSPrimary 9 | avg_rtt_ms: 50 # Too far. 10 | lastUpdateTime: 0 11 | maxWireVersion: 5 12 | lastWrite: {lastWriteDate: {$numberLong: "1000001"}} 13 | - &2 14 | address: b:27017 15 | type: RSSecondary 16 | avg_rtt_ms: 5 17 | lastUpdateTime: 0 18 | maxWireVersion: 5 19 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Very stale. 20 | read_preference: 21 | mode: Nearest 22 | suitable_servers: # Very stale server is fine. 23 | - *1 24 | - *2 25 | in_latency_window: 26 | - *2 27 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/Incompatible.yml: -------------------------------------------------------------------------------- 1 | # During server selection, clients (drivers or mongos) MUST raise an error if 2 | # maxStalenessSeconds is defined and not -1 and any server's ``maxWireVersion`` 3 | # is less than 5 (`SERVER-23893`_). 4 | --- 5 | topology_description: 6 | type: ReplicaSetWithPrimary 7 | servers: 8 | - &1 9 | address: a:27017 10 | type: RSPrimary 11 | avg_rtt_ms: 5 12 | lastUpdateTime: 0 13 | maxWireVersion: 5 14 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 15 | - &2 16 | address: b:27017 17 | type: RSSecondary 18 | avg_rtt_ms: 5 19 | lastUpdateTime: 0 20 | maxWireVersion: 4 # Incompatible. 21 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 22 | read_preference: 23 | mode: Nearest 24 | maxStalenessSeconds: 120 25 | error: true 26 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/LongHeartbeat.yml: -------------------------------------------------------------------------------- 1 | # If users configure a longer ``heartbeatFrequencyMS`` than the default, 2 | # ``maxStalenessSeconds`` might have a larger minimum. 3 | --- 4 | heartbeatFrequencyMS: 120000 # 120 seconds. 5 | topology_description: 6 | type: ReplicaSetWithPrimary 7 | servers: 8 | - &1 9 | address: a:27017 10 | type: RSPrimary 11 | avg_rtt_ms: 5 12 | lastUpdateTime: 0 13 | maxWireVersion: 5 14 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 15 | - &2 16 | address: b:27017 17 | type: RSSecondary 18 | avg_rtt_ms: 50 # Too far. 19 | lastUpdateTime: 0 20 | maxWireVersion: 5 21 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 22 | read_preference: 23 | mode: Nearest 24 | maxStalenessSeconds: 130 # OK, must be 120 + 10 = 130 seconds. 25 | suitable_servers: 26 | - *1 27 | - *2 28 | in_latency_window: 29 | - *1 30 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/LongHeartbeat2.yml: -------------------------------------------------------------------------------- 1 | # If users configure a longer ``heartbeatFrequencyMS`` than the default, 2 | # ``maxStalenessSeconds`` might have a larger minimum. 3 | --- 4 | heartbeatFrequencyMS: 120000 # 120 seconds. 5 | topology_description: 6 | type: ReplicaSetWithPrimary 7 | servers: 8 | - &1 9 | address: a:27017 10 | type: RSPrimary 11 | avg_rtt_ms: 5 12 | lastUpdateTime: 0 13 | maxWireVersion: 5 14 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 15 | - &2 16 | address: b:27017 17 | type: RSSecondary 18 | avg_rtt_ms: 5 19 | lastUpdateTime: 0 20 | maxWireVersion: 5 21 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 22 | read_preference: 23 | mode: Nearest 24 | maxStalenessSeconds: 129 # Too small, must be 120 + 10 = 130 seconds. 25 | error: true 26 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/MaxStalenessTooSmall.yml: -------------------------------------------------------------------------------- 1 | # A driver MUST raise an error 2 | # if the TopologyType is ReplicaSetWithPrimary or ReplicaSetNoPrimary 3 | # and ``maxStalenessSeconds`` is less than 90. 4 | --- 5 | heartbeatFrequencyMS: 500 6 | topology_description: 7 | type: ReplicaSetWithPrimary 8 | servers: 9 | - &1 10 | address: a:27017 11 | type: RSPrimary 12 | avg_rtt_ms: 5 13 | lastUpdateTime: 0 14 | maxWireVersion: 5 15 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 16 | - &2 17 | address: b:27017 18 | type: RSSecondary 19 | avg_rtt_ms: 5 20 | lastUpdateTime: 0 21 | maxWireVersion: 5 22 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 23 | read_preference: 24 | mode: Nearest 25 | maxStalenessSeconds: 89 # Too small. 26 | error: true 27 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.yml: -------------------------------------------------------------------------------- 1 | # Drivers MUST raise an error if maxStalenessSeconds is defined and not -1 2 | # and the ``mode`` field is 'primary'. 3 | --- 4 | topology_description: 5 | type: ReplicaSetWithPrimary 6 | servers: 7 | - &1 8 | address: a:27017 9 | type: RSPrimary 10 | avg_rtt_ms: 5 11 | lastUpdateTime: 0 12 | maxWireVersion: 5 13 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 14 | - &2 15 | address: b:27017 16 | type: RSSecondary 17 | avg_rtt_ms: 5 18 | lastUpdateTime: 0 19 | maxWireVersion: 5 20 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 21 | read_preference: 22 | maxStalenessSeconds: 120 23 | error: true 24 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/Nearest.yml: -------------------------------------------------------------------------------- 1 | heartbeatFrequencyMS: 25000 # 25 seconds. 2 | topology_description: 3 | type: ReplicaSetWithPrimary 4 | servers: 5 | - &1 6 | address: a:27017 7 | type: RSPrimary 8 | avg_rtt_ms: 5 9 | lastUpdateTime: 0 10 | lastWrite: {lastWriteDate: {$numberLong: "125002"}} 11 | maxWireVersion: 5 12 | - &2 13 | address: b:27017 14 | type: RSSecondary 15 | avg_rtt_ms: 50 # Too far. 16 | lastUpdateTime: 0 17 | lastWrite: {lastWriteDate: {$numberLong: "2"}} # 125 sec stale + 25 sec heartbeat <= 150 sec maxStaleness. 18 | maxWireVersion: 5 19 | - &3 20 | address: c:27017 21 | avg_rtt_ms: 5 22 | lastUpdateTime: 0 23 | type: RSSecondary 24 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Too stale. 25 | maxWireVersion: 5 26 | read_preference: 27 | mode: Nearest 28 | maxStalenessSeconds: 150 29 | suitable_servers: 30 | - *1 31 | - *2 32 | in_latency_window: 33 | - *1 34 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/Nearest2.yml: -------------------------------------------------------------------------------- 1 | heartbeatFrequencyMS: 25000 # 25 seconds. 2 | topology_description: 3 | type: ReplicaSetWithPrimary 4 | servers: 5 | - &1 6 | address: a:27017 7 | type: RSPrimary 8 | avg_rtt_ms: 50 # Too far. 9 | lastUpdateTime: 0 10 | lastWrite: {lastWriteDate: {$numberLong: "125002"}} 11 | maxWireVersion: 5 12 | - &2 13 | address: b:27017 14 | type: RSSecondary 15 | avg_rtt_ms: 5 16 | lastUpdateTime: 0 17 | lastWrite: {lastWriteDate: {$numberLong: "2"}} # 125 sec stale + 25 sec heartbeat <= 150 sec maxStaleness. 18 | maxWireVersion: 5 19 | - &3 20 | address: c:27017 21 | avg_rtt_ms: 5 22 | lastUpdateTime: 0 23 | type: RSSecondary 24 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Too stale. 25 | maxWireVersion: 5 26 | read_preference: 27 | mode: Nearest 28 | maxStalenessSeconds: 150 29 | suitable_servers: 30 | - *1 31 | - *2 32 | in_latency_window: 33 | - *2 34 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/PrimaryPreferred.yml: -------------------------------------------------------------------------------- 1 | # Ignore maxStalenessSeconds if primary is available. 2 | --- 3 | heartbeatFrequencyMS: 25000 # 25 seconds. 4 | topology_description: 5 | type: ReplicaSetWithPrimary 6 | servers: 7 | - &1 8 | address: a:27017 9 | type: RSPrimary 10 | avg_rtt_ms: 5 11 | lastUpdateTime: 0 12 | maxWireVersion: 5 13 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 14 | - &2 15 | address: b:27017 16 | type: RSSecondary 17 | avg_rtt_ms: 5 18 | lastUpdateTime: 0 19 | maxWireVersion: 5 20 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 21 | read_preference: 22 | mode: PrimaryPreferred 23 | maxStalenessSeconds: 150 24 | suitable_servers: 25 | - *1 26 | in_latency_window: 27 | - *1 28 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/PrimaryPreferred_incompatible.yml: -------------------------------------------------------------------------------- 1 | # Primary has wire version 5, secondary has 4, read preference primaryPreferred 2 | # with maxStalenessSeconds. The client must error, even though it uses primary and 3 | # never applies maxStalenessSeconds. Proves that the compatibility check precedes 4 | # filtration. 5 | --- 6 | topology_description: 7 | type: ReplicaSetWithPrimary 8 | servers: 9 | - &1 10 | address: a:27017 11 | type: RSPrimary 12 | avg_rtt_ms: 5 13 | lastUpdateTime: 0 14 | maxWireVersion: 5 15 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 16 | - &2 17 | address: b:27017 18 | type: RSSecondary 19 | avg_rtt_ms: 5 20 | lastUpdateTime: 0 21 | maxWireVersion: 4 # Too old. 22 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 23 | read_preference: 24 | mode: PrimaryPreferred 25 | maxStalenessSeconds: 150 26 | error: true 27 | 28 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred.yml: -------------------------------------------------------------------------------- 1 | # Fallback to primary if no secondary is fresh enough. 2 | --- 3 | topology_description: 4 | type: ReplicaSetWithPrimary 5 | servers: 6 | - &1 7 | address: a:27017 8 | type: RSPrimary 9 | avg_rtt_ms: 5 10 | lastUpdateTime: 0 11 | maxWireVersion: 5 12 | lastWrite: {lastWriteDate: {$numberLong: "1000001"}} 13 | - &2 14 | address: b:27017 15 | type: RSSecondary 16 | avg_rtt_ms: 5 17 | lastUpdateTime: 0 18 | maxWireVersion: 5 19 | lastWrite: {lastWriteDate: {$numberLong: "1"}} # Very stale. 20 | read_preference: 21 | mode: SecondaryPreferred 22 | maxStalenessSeconds: 120 23 | suitable_servers: 24 | - *1 25 | in_latency_window: 26 | - *1 27 | -------------------------------------------------------------------------------- /t/data/max_staleness/ReplicaSetWithPrimary/ZeroMaxStaleness.yml: -------------------------------------------------------------------------------- 1 | # maxStalenessSeconds=0 is prohibited. 2 | --- 3 | topology_description: 4 | type: ReplicaSetWithPrimary 5 | servers: 6 | - &1 7 | address: a:27017 8 | type: RSPrimary 9 | avg_rtt_ms: 5 10 | lastUpdateTime: 0 11 | maxWireVersion: 5 12 | lastWrite: {lastWriteDate: {$numberLong: "2"}} 13 | - &2 14 | address: b:27017 15 | type: RSSecondary 16 | avg_rtt_ms: 5 17 | lastUpdateTime: 0 18 | maxWireVersion: 4 # Incompatible. 19 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 20 | read_preference: 21 | mode: Nearest 22 | maxStalenessSeconds: 0 23 | error: true 24 | -------------------------------------------------------------------------------- /t/data/max_staleness/Sharded/Incompatible.yml: -------------------------------------------------------------------------------- 1 | # During server selection, clients (drivers or mongos) MUST raise an error if 2 | # maxStalenessSeconds is defined and not -1 and any server's ``maxWireVersion`` 3 | # is less than 5 (`SERVER-23893`_). 4 | --- 5 | topology_description: 6 | type: Sharded 7 | servers: 8 | - &1 9 | address: a:27017 10 | type: Mongos 11 | avg_rtt_ms: 5 12 | lastUpdateTime: 0 13 | maxWireVersion: 5 14 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 15 | - &2 16 | address: b:27017 17 | type: Mongos 18 | avg_rtt_ms: 5 19 | lastUpdateTime: 0 20 | maxWireVersion: 4 # Incompatible. 21 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 22 | read_preference: 23 | mode: Nearest 24 | maxStalenessSeconds: 120 25 | error: true 26 | -------------------------------------------------------------------------------- /t/data/max_staleness/Sharded/SmallMaxStaleness.yml: -------------------------------------------------------------------------------- 1 | # Driver doesn't validate maxStalenessSeconds for mongos 2 | --- 3 | heartbeatFrequencyMS: 10000 4 | topology_description: 5 | type: Sharded 6 | servers: 7 | - &1 8 | address: a:27017 9 | type: Mongos 10 | avg_rtt_ms: 5 11 | lastUpdateTime: 0 12 | maxWireVersion: 5 13 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 14 | - &2 15 | address: b:27017 16 | type: Mongos 17 | avg_rtt_ms: 50 # Too far. 18 | lastUpdateTime: 0 19 | maxWireVersion: 5 20 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 21 | read_preference: 22 | mode: Nearest 23 | maxStalenessSeconds: 1 # OK for sharding. 24 | suitable_servers: 25 | - *1 26 | - *2 27 | in_latency_window: 28 | - *1 29 | -------------------------------------------------------------------------------- /t/data/max_staleness/Single/Incompatible.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": true, 3 | "read_preference": { 4 | "maxStalenessSeconds": 120, 5 | "mode": "Nearest" 6 | }, 7 | "topology_description": { 8 | "servers": [ 9 | { 10 | "address": "a:27017", 11 | "avg_rtt_ms": 5, 12 | "lastUpdateTime": 0, 13 | "lastWrite": { 14 | "lastWriteDate": { 15 | "$numberLong": "1" 16 | } 17 | }, 18 | "maxWireVersion": 4, 19 | "type": "Standalone" 20 | } 21 | ], 22 | "type": "Single" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /t/data/max_staleness/Single/Incompatible.yml: -------------------------------------------------------------------------------- 1 | # During server selection, clients (drivers or mongos) MUST raise an error if 2 | # maxStalenessSeconds is defined and not -1 and any server's ``maxWireVersion`` 3 | # is less than 5 (`SERVER-23893`_). 4 | --- 5 | topology_description: 6 | type: Single 7 | servers: 8 | - &1 9 | address: a:27017 10 | type: Standalone 11 | avg_rtt_ms: 5 12 | lastUpdateTime: 0 13 | maxWireVersion: 4 # Incompatible. 14 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 15 | read_preference: 16 | mode: Nearest 17 | maxStalenessSeconds: 120 18 | error: true 19 | -------------------------------------------------------------------------------- /t/data/max_staleness/Single/SmallMaxStaleness.yml: -------------------------------------------------------------------------------- 1 | # Driver doesn't validate maxStalenessSeconds for direct connection. 2 | --- 3 | heartbeatFrequencyMS: 10000 4 | topology_description: 5 | type: Single 6 | servers: 7 | - &1 8 | address: a:27017 9 | type: Standalone 10 | avg_rtt_ms: 5 11 | lastUpdateTime: 0 12 | maxWireVersion: 5 13 | lastWrite: {lastWriteDate: {$numberLong: "1"}} 14 | read_preference: 15 | mode: Nearest 16 | maxStalenessSeconds: 1 17 | suitable_servers: 18 | - *1 19 | in_latency_window: 20 | - *1 21 | -------------------------------------------------------------------------------- /t/data/max_staleness/Unknown/SmallMaxStaleness.json: -------------------------------------------------------------------------------- 1 | { 2 | "heartbeatFrequencyMS": 10000, 3 | "in_latency_window": [], 4 | "read_preference": { 5 | "maxStalenessSeconds": 1, 6 | "mode": "Nearest" 7 | }, 8 | "suitable_servers": [], 9 | "topology_description": { 10 | "servers": [ 11 | { 12 | "address": "a:27017", 13 | "type": "Unknown" 14 | } 15 | ], 16 | "type": "Unknown" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /t/data/max_staleness/Unknown/SmallMaxStaleness.yml: -------------------------------------------------------------------------------- 1 | # Driver doesn't validate maxStalenessSeconds while TopologyType is Unknown. 2 | --- 3 | heartbeatFrequencyMS: 10000 4 | topology_description: 5 | type: Unknown 6 | servers: 7 | - &1 8 | address: a:27017 9 | type: Unknown 10 | read_preference: 11 | mode: Nearest 12 | maxStalenessSeconds: 1 13 | suitable_servers: [] 14 | in_latency_window: [] 15 | -------------------------------------------------------------------------------- /t/data/retryable-writes/deleteMany.json: -------------------------------------------------------------------------------- 1 | { 2 | "runOn": [ 3 | { 4 | "minServerVersion": "3.6", 5 | "topology": [ 6 | "replicaset", 7 | "sharded" 8 | ] 9 | } 10 | ], 11 | "data": [ 12 | { 13 | "_id": 1, 14 | "x": 11 15 | }, 16 | { 17 | "_id": 2, 18 | "x": 22 19 | } 20 | ], 21 | "tests": [ 22 | { 23 | "description": "DeleteMany ignores retryWrites", 24 | "useMultipleMongoses": true, 25 | "operation": { 26 | "name": "deleteMany", 27 | "arguments": { 28 | "filter": {} 29 | } 30 | }, 31 | "outcome": { 32 | "result": { 33 | "deletedCount": 2 34 | }, 35 | "collection": { 36 | "data": [] 37 | } 38 | } 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /t/data/retryable-writes/deleteMany.yml: -------------------------------------------------------------------------------- 1 | runOn: 2 | - 3 | minServerVersion: "3.6" 4 | topology: ["replicaset", "sharded"] 5 | 6 | data: 7 | - { _id: 1, x: 11 } 8 | - { _id: 2, x: 22 } 9 | 10 | tests: 11 | - 12 | description: "DeleteMany ignores retryWrites" 13 | useMultipleMongoses: true 14 | operation: 15 | name: "deleteMany" 16 | arguments: 17 | filter: { } 18 | outcome: 19 | result: 20 | deletedCount: 2 21 | collection: 22 | data: [] -------------------------------------------------------------------------------- /t/data/retryable-writes/updateMany.yml: -------------------------------------------------------------------------------- 1 | runOn: 2 | - 3 | minServerVersion: "3.6" 4 | topology: ["replicaset", "sharded"] 5 | 6 | data: 7 | - { _id: 1, x: 11 } 8 | - { _id: 2, x: 22 } 9 | 10 | tests: 11 | - 12 | description: "UpdateMany ignores retryWrites" 13 | useMultipleMongoses: true 14 | operation: 15 | name: "updateMany" 16 | arguments: 17 | filter: { } 18 | update: { $inc: { x : 1 }} 19 | outcome: 20 | result: 21 | matchedCount: 2 22 | modifiedCount: 2 23 | upsertedCount: 0 24 | collection: 25 | data: 26 | - { _id: 1, x: 12 } 27 | - { _id: 2, x: 23 } -------------------------------------------------------------------------------- /t/data/uri/auth-options.json: -------------------------------------------------------------------------------- 1 | { 2 | "tests": [ 3 | { 4 | "description": "Valid auth options are parsed correctly", 5 | "uri": "mongodb://foo:bar@example.com/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true&authSource=$external", 6 | "valid": true, 7 | "warning": false, 8 | "hosts": null, 9 | "auth": null, 10 | "options": { 11 | "authMechanism": "GSSAPI", 12 | "authMechanismProperties": { 13 | "SERVICE_NAME": "other", 14 | "CANONICALIZE_HOST_NAME": true 15 | }, 16 | "authSource": "$external" 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /t/data/uri/auth-options.yml: -------------------------------------------------------------------------------- 1 | tests: 2 | - 3 | description: "Valid auth options are parsed correctly" 4 | uri: "mongodb://foo:bar@example.com/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true&authSource=$external" 5 | valid: true 6 | warning: false 7 | hosts: ~ 8 | auth: ~ 9 | options: 10 | authMechanism: "GSSAPI" 11 | authMechanismProperties: 12 | SERVICE_NAME: "other" 13 | CANONICALIZE_HOST_NAME: true 14 | authSource: "$external" 15 | -------------------------------------------------------------------------------- /t/data/uri/ca.pem: -------------------------------------------------------------------------------- 1 | # This file exists solely for the purpose of facilitating drivers which check for the existence of files specified in the URI options at parse time. 2 | -------------------------------------------------------------------------------- /t/data/uri/cert.pem: -------------------------------------------------------------------------------- 1 | # This file exists solely for the purpose of facilitating drivers which check for the existence of files specified in the URI options at parse time. 2 | -------------------------------------------------------------------------------- /t/data/uri/client.pem: -------------------------------------------------------------------------------- 1 | # This file exists solely for the purpose of facilitating drivers which check for the existence of files specified in the URI options at parse time. 2 | -------------------------------------------------------------------------------- /t/data/uri/connection-pool-options.json: -------------------------------------------------------------------------------- 1 | { 2 | "tests": [ 3 | { 4 | "description": "Valid connection pool options are parsed correctly", 5 | "uri": "mongodb://example.com/?maxIdleTimeMS=50000", 6 | "valid": true, 7 | "warning": false, 8 | "hosts": null, 9 | "auth": null, 10 | "options": { 11 | "maxIdleTimeMS": 50000 12 | } 13 | }, 14 | { 15 | "description": "Non-numeric maxIdleTimeMS causes a warning", 16 | "uri": "mongodb://example.com/?maxIdleTimeMS=invalid", 17 | "valid": true, 18 | "warning": true, 19 | "hosts": null, 20 | "auth": null, 21 | "options": {} 22 | }, 23 | { 24 | "description": "Too low maxIdleTimeMS causes a warning", 25 | "uri": "mongodb://example.com/?maxIdleTimeMS=-2", 26 | "valid": true, 27 | "warning": true, 28 | "hosts": null, 29 | "auth": null, 30 | "options": {} 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /t/data/uri/connection-pool-options.yml: -------------------------------------------------------------------------------- 1 | tests: 2 | - 3 | description: "Valid connection pool options are parsed correctly" 4 | uri: "mongodb://example.com/?maxIdleTimeMS=50000" 5 | valid: true 6 | warning: false 7 | hosts: ~ 8 | auth: ~ 9 | options: 10 | maxIdleTimeMS: 50000 11 | - 12 | description: "Non-numeric maxIdleTimeMS causes a warning" 13 | uri: "mongodb://example.com/?maxIdleTimeMS=invalid" 14 | valid: true 15 | warning: true 16 | hosts: ~ 17 | auth: ~ 18 | options: {} 19 | - 20 | description: "Too low maxIdleTimeMS causes a warning" 21 | uri: "mongodb://example.com/?maxIdleTimeMS=-2" 22 | valid: true 23 | warning: true 24 | hosts: ~ 25 | auth: ~ 26 | options: {} 27 | -------------------------------------------------------------------------------- /t/data/uri/single-threaded-options.json: -------------------------------------------------------------------------------- 1 | { 2 | "tests": [ 3 | { 4 | "description": "Valid options specific to single-threaded drivers are parsed correctly", 5 | "uri": "mongodb://example.com/?serverSelectionTryOnce=false", 6 | "valid": true, 7 | "warning": false, 8 | "hosts": null, 9 | "auth": null, 10 | "options": { 11 | "serverSelectionTryOnce": false 12 | } 13 | }, 14 | { 15 | "description": "Invalid serverSelectionTryOnce causes a warning", 16 | "uri": "mongodb://example.com/?serverSelectionTryOnce=invalid", 17 | "valid": true, 18 | "warning": true, 19 | "hosts": null, 20 | "auth": null, 21 | "options": {} 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /t/data/uri/single-threaded-options.yml: -------------------------------------------------------------------------------- 1 | tests: 2 | - 3 | description: "Valid options specific to single-threaded drivers are parsed correctly" 4 | uri: "mongodb://example.com/?serverSelectionTryOnce=false" 5 | valid: true 6 | warning: false 7 | hosts: ~ 8 | auth: ~ 9 | options: 10 | serverSelectionTryOnce: false 11 | - 12 | description: "Invalid serverSelectionTryOnce causes a warning" 13 | uri: "mongodb://example.com/?serverSelectionTryOnce=invalid" 14 | valid: true 15 | warning: true 16 | hosts: ~ 17 | auth: ~ 18 | options: {} 19 | -------------------------------------------------------------------------------- /t/testrules.yml: -------------------------------------------------------------------------------- 1 | --- 2 | seq: 3 | - seq: t/00-report-mongod.t 4 | - seq: t/max_time_ms.t 5 | - seq: t/using_profiler.t 6 | - seq: t/changestreams.t 7 | - seq: t/changestreams_spec.t 8 | - seq: t/examples/changestream.t 9 | - seq: t/retryable-writes-spec.t 10 | - seq: t/retryable-writes-split-batch.t 11 | - seq: t/retryable-reads-spec.t 12 | - seq: t/sessions-spec.t 13 | - seq: t/transactions-spec.t 14 | - seq: t/transactions-convenient-api-spec.t 15 | - seq: t/connections-survive-step-down.t 16 | - par: ** 17 | -------------------------------------------------------------------------------- /weaver.ini: -------------------------------------------------------------------------------- 1 | [@CorePrep] 2 | 3 | [-SingleEncoding] 4 | 5 | [Name] 6 | [Version] 7 | 8 | [Region / prelude] 9 | 10 | [Generic / DEPRECATED] 11 | 12 | [Generic / SYNOPSIS] 13 | [Generic / DESCRIPTION] 14 | [Generic / USAGE] 15 | 16 | [Collect / ATTRIBUTES] 17 | command = attr 18 | 19 | [Collect / METHODS] 20 | command = method 21 | 22 | [Leftovers] 23 | 24 | [Region / postlude] 25 | 26 | [Authors] 27 | [Contributors] 28 | [Legal] 29 | 30 | [-Transformer / Lists] 31 | transformer = List 32 | 33 | --------------------------------------------------------------------------------