mongo 2.15.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.md +1 -1
- data/lib/mongo/auth/aws/request.rb +0 -1
- data/lib/mongo/bulk_write.rb +2 -2
- data/lib/mongo/client.rb +49 -5
- data/lib/mongo/cluster/periodic_executor.rb +4 -3
- data/lib/mongo/cluster/reapers/cursor_reaper.rb +76 -43
- data/lib/mongo/cluster/sdam_flow.rb +9 -3
- data/lib/mongo/cluster/topology/base.rb +13 -9
- data/lib/mongo/cluster/topology/load_balanced.rb +102 -0
- data/lib/mongo/cluster/topology.rb +28 -8
- data/lib/mongo/cluster.rb +136 -51
- data/lib/mongo/collection/view/aggregation.rb +63 -23
- data/lib/mongo/collection/view/builder/aggregation.rb +16 -17
- data/lib/mongo/collection/view/builder/map_reduce.rb +12 -49
- data/lib/mongo/collection/view/builder.rb +0 -4
- data/lib/mongo/collection/view/change_stream.rb +7 -3
- data/lib/mongo/collection/view/iterable.rb +60 -27
- data/lib/mongo/collection/view/map_reduce.rb +41 -15
- data/lib/mongo/collection/view/readable.rb +84 -52
- data/lib/mongo/collection/view/writable.rb +201 -175
- data/lib/mongo/collection/view.rb +15 -21
- data/lib/mongo/collection.rb +34 -14
- data/lib/mongo/cursor/kill_spec.rb +38 -0
- data/lib/mongo/cursor.rb +72 -31
- data/lib/mongo/database/view.rb +5 -3
- data/lib/mongo/database.rb +6 -6
- data/lib/mongo/error/bad_load_balancer_target.rb +26 -0
- data/lib/mongo/error/missing_service_id.rb +26 -0
- data/lib/mongo/error/no_service_connection_available.rb +49 -0
- data/lib/mongo/error/notable.rb +7 -0
- data/lib/mongo/error/snapshot_session_invalid_server_version.rb +31 -0
- data/lib/mongo/error/snapshot_session_transaction_prohibited.rb +30 -0
- data/lib/mongo/error.rb +5 -0
- data/lib/mongo/grid/fs_bucket.rb +21 -2
- data/lib/mongo/id.rb +7 -5
- data/lib/mongo/index/view.rb +22 -41
- data/lib/mongo/monitoring/event/cmap/pool_cleared.rb +7 -4
- data/lib/mongo/monitoring/event/command_failed.rb +1 -1
- data/lib/mongo/monitoring/event/command_started.rb +2 -0
- data/lib/mongo/monitoring/publishable.rb +2 -2
- data/lib/mongo/operation/aggregate/command.rb +8 -0
- data/lib/mongo/operation/context.rb +19 -1
- data/lib/mongo/operation/count/command.rb +6 -0
- data/lib/mongo/operation/count/op_msg.rb +6 -0
- data/lib/mongo/operation/create/command.rb +7 -1
- data/lib/mongo/operation/create/op_msg.rb +7 -0
- data/lib/mongo/operation/create_index/command.rb +17 -1
- data/lib/mongo/operation/create_index/op_msg.rb +17 -4
- data/lib/mongo/operation/delete/command.rb +6 -3
- data/lib/mongo/operation/delete/legacy.rb +9 -2
- data/lib/mongo/operation/delete/op_msg.rb +9 -1
- data/lib/mongo/operation/distinct/command.rb +6 -0
- data/lib/mongo/operation/distinct/op_msg.rb +7 -0
- data/lib/mongo/operation/explain/command.rb +13 -1
- data/lib/mongo/operation/explain/legacy.rb +12 -5
- data/lib/mongo/operation/explain/op_msg.rb +9 -1
- data/lib/mongo/operation/find/builder/command.rb +111 -0
- data/lib/mongo/{collection/view → operation/find}/builder/flags.rb +10 -14
- data/lib/mongo/operation/find/builder/legacy.rb +123 -0
- data/lib/mongo/{collection/view → operation/find}/builder/modifiers.rb +31 -25
- data/lib/mongo/{cursor → operation/find}/builder.rb +4 -4
- data/lib/mongo/operation/find/command.rb +9 -0
- data/lib/mongo/operation/find/legacy.rb +10 -1
- data/lib/mongo/operation/find/op_msg.rb +12 -0
- data/lib/mongo/operation/find.rb +1 -0
- data/lib/mongo/operation/get_more/command.rb +1 -0
- data/lib/mongo/operation/get_more/command_builder.rb +38 -0
- data/lib/mongo/operation/get_more/op_msg.rb +1 -0
- data/lib/mongo/operation/get_more.rb +1 -0
- data/lib/mongo/operation/kill_cursors/command.rb +8 -0
- data/lib/mongo/operation/kill_cursors/command_builder.rb +35 -0
- data/lib/mongo/operation/kill_cursors/legacy.rb +2 -1
- data/lib/mongo/operation/kill_cursors/op_msg.rb +10 -0
- data/lib/mongo/operation/kill_cursors.rb +1 -0
- data/lib/mongo/operation/map_reduce/command.rb +8 -0
- data/lib/mongo/operation/map_reduce/op_msg.rb +1 -1
- data/lib/mongo/operation/result.rb +6 -0
- data/lib/mongo/operation/shared/executable.rb +19 -1
- data/lib/mongo/operation/shared/polymorphic_operation.rb +1 -1
- data/lib/mongo/operation/shared/read_preference_supported.rb +3 -1
- data/lib/mongo/operation/shared/response_handling.rb +1 -0
- data/lib/mongo/operation/shared/sessions_supported.rb +28 -12
- data/lib/mongo/operation/shared/specifiable.rb +11 -29
- data/lib/mongo/operation/shared/validatable.rb +87 -0
- data/lib/mongo/operation/shared/write.rb +1 -1
- data/lib/mongo/operation/update/command.rb +6 -3
- data/lib/mongo/operation/update/legacy.rb +19 -11
- data/lib/mongo/operation/update/op_msg.rb +8 -4
- data/lib/mongo/operation/write_command/command.rb +51 -0
- data/lib/mongo/operation/write_command/op_msg.rb +43 -0
- data/lib/mongo/operation/write_command.rb +32 -0
- data/lib/mongo/operation.rb +10 -0
- data/lib/mongo/protocol/query.rb +35 -18
- data/lib/mongo/server/connection.rb +25 -3
- data/lib/mongo/server/connection_base.rb +12 -1
- data/lib/mongo/server/connection_common.rb +38 -1
- data/lib/mongo/server/connection_pool/generation_manager.rb +71 -0
- data/lib/mongo/server/connection_pool.rb +100 -27
- data/lib/mongo/server/description/features.rb +20 -17
- data/lib/mongo/server/description/load_balancer.rb +33 -0
- data/lib/mongo/server/description.rb +85 -6
- data/lib/mongo/server/monitor/connection.rb +5 -6
- data/lib/mongo/server/monitor.rb +2 -1
- data/lib/mongo/server/pending_connection.rb +47 -31
- data/lib/mongo/server/push_monitor.rb +10 -1
- data/lib/mongo/server.rb +73 -26
- data/lib/mongo/server_selector/base.rb +31 -5
- data/lib/mongo/session/session_pool.rb +11 -0
- data/lib/mongo/session.rb +40 -1
- data/lib/mongo/socket/ocsp_cache.rb +2 -3
- data/lib/mongo/socket/ocsp_verifier.rb +6 -37
- data/lib/mongo/socket.rb +1 -5
- data/lib/mongo/uri/options_mapper.rb +1 -0
- data/lib/mongo/uri/srv_protocol.rb +6 -8
- data/lib/mongo/uri.rb +18 -0
- data/lib/mongo/utils.rb +0 -13
- data/lib/mongo/version.rb +1 -1
- data/mongo.gemspec +1 -1
- data/spec/integration/auth_spec.rb +31 -1
- data/spec/integration/awaited_ismaster_spec.rb +1 -1
- data/spec/integration/bulk_write_spec.rb +1 -1
- data/spec/integration/change_stream_spec.rb +3 -3
- data/spec/integration/client_construction_spec.rb +54 -0
- data/spec/integration/client_side_encryption/auto_encryption_bulk_writes_spec.rb +1 -1
- data/spec/integration/client_side_encryption/auto_encryption_command_monitoring_spec.rb +1 -1
- data/spec/integration/client_side_encryption/bson_size_limit_spec.rb +1 -1
- data/spec/integration/client_side_encryption/data_key_spec.rb +1 -1
- data/spec/integration/client_spec.rb +2 -0
- data/spec/integration/command_monitoring_spec.rb +1 -1
- data/spec/integration/command_spec.rb +1 -1
- data/spec/integration/connection_spec.rb +52 -35
- data/spec/integration/crud_spec.rb +174 -1
- data/spec/integration/cursor_pinning_spec.rb +121 -0
- data/spec/integration/cursor_reaping_spec.rb +8 -4
- data/spec/integration/fork_reconnect_spec.rb +1 -5
- data/spec/integration/get_more_spec.rb +1 -1
- data/spec/integration/heartbeat_events_spec.rb +1 -1
- data/spec/integration/map_reduce_spec.rb +77 -0
- data/spec/integration/query_cache_spec.rb +47 -2
- data/spec/integration/query_cache_transactions_spec.rb +1 -1
- data/spec/integration/read_concern_spec.rb +1 -1
- data/spec/integration/read_preference_spec.rb +17 -13
- data/spec/integration/reconnect_spec.rb +30 -12
- data/spec/integration/retryable_errors_spec.rb +1 -1
- data/spec/integration/retryable_writes/retryable_writes_36_and_older_spec.rb +1 -1
- data/spec/integration/retryable_writes/retryable_writes_40_and_newer_spec.rb +1 -1
- data/spec/integration/sdam_error_handling_spec.rb +5 -3
- data/spec/integration/sdam_events_spec.rb +35 -19
- data/spec/integration/sdam_prose_spec.rb +1 -1
- data/spec/integration/server_monitor_spec.rb +1 -0
- data/spec/integration/server_selector_spec.rb +22 -5
- data/spec/integration/server_spec.rb +2 -0
- data/spec/integration/srv_monitoring_spec.rb +1 -1
- data/spec/integration/step_down_spec.rb +1 -1
- data/spec/integration/transaction_pinning_spec.rb +120 -0
- data/spec/integration/versioned_api_examples_spec.rb +45 -0
- data/spec/integration/x509_auth_spec.rb +1 -1
- data/spec/lite_spec_helper.rb +1 -2
- data/spec/mongo/address/unix_spec.rb +1 -0
- data/spec/mongo/auth/cr_spec.rb +2 -3
- data/spec/mongo/auth/ldap_spec.rb +2 -3
- data/spec/mongo/auth/scram_spec.rb +2 -3
- data/spec/mongo/auth/user/view_spec.rb +1 -1
- data/spec/mongo/auth/x509_spec.rb +2 -3
- data/spec/mongo/bulk_write_spec.rb +3 -3
- data/spec/mongo/client_construction_spec.rb +259 -28
- data/spec/mongo/client_spec.rb +6 -4
- data/spec/mongo/cluster/cursor_reaper_spec.rb +36 -21
- data/spec/mongo/cluster/periodic_executor_spec.rb +3 -1
- data/spec/mongo/cluster_spec.rb +44 -3
- data/spec/mongo/collection/view/aggregation_spec.rb +72 -96
- data/spec/mongo/collection/view/builder/find_command_spec.rb +4 -0
- data/spec/mongo/collection/view/builder/op_query_spec.rb +4 -0
- data/spec/mongo/collection/view/change_stream_spec.rb +1 -1
- data/spec/mongo/collection/view/map_reduce_spec.rb +15 -2
- data/spec/mongo/collection_crud_spec.rb +7 -2
- data/spec/mongo/collection_ddl_spec.rb +1 -1
- data/spec/mongo/collection_spec.rb +1 -1
- data/spec/mongo/cursor/builder/get_more_command_spec.rb +4 -0
- data/spec/mongo/cursor/builder/op_get_more_spec.rb +4 -0
- data/spec/mongo/cursor_spec.rb +15 -5
- data/spec/mongo/database_spec.rb +15 -15
- data/spec/mongo/error/operation_failure_heavy_spec.rb +1 -1
- data/spec/mongo/grid/fs_bucket_spec.rb +18 -12
- data/spec/mongo/grid/stream/write_spec.rb +3 -9
- data/spec/mongo/grid/stream_spec.rb +1 -1
- data/spec/mongo/index/view_spec.rb +2 -2
- data/spec/mongo/operation/delete/op_msg_spec.rb +1 -1
- data/spec/mongo/{collection/view → operation/find}/builder/flags_spec.rb +2 -2
- data/spec/mongo/{collection/view → operation/find}/builder/modifiers_spec.rb +2 -2
- data/spec/mongo/operation/find/legacy_spec.rb +1 -0
- data/spec/mongo/operation/insert/bulk_spec.rb +1 -1
- data/spec/mongo/operation/insert/op_msg_spec.rb +1 -1
- data/spec/mongo/operation/kill_cursors_spec.rb +4 -1
- data/spec/mongo/operation/read_preference_legacy_spec.rb +4 -0
- data/spec/mongo/operation/read_preference_op_msg_spec.rb +26 -1
- data/spec/mongo/operation/update/bulk_spec.rb +1 -1
- data/spec/mongo/operation/update/op_msg_spec.rb +1 -1
- data/spec/mongo/query_cache_spec.rb +6 -2
- data/spec/mongo/server/connection_common_spec.rb +62 -11
- data/spec/mongo/server/connection_pool_spec.rb +73 -7
- data/spec/mongo/server/connection_spec.rb +138 -43
- data/spec/mongo/server/description_spec.rb +1 -1
- data/spec/mongo/server/monitor/connection_spec.rb +22 -0
- data/spec/mongo/server/monitor_spec.rb +4 -3
- data/spec/mongo/server/push_monitor_spec.rb +101 -0
- data/spec/mongo/server_selector_spec.rb +136 -15
- data/spec/mongo/session/session_pool_spec.rb +42 -10
- data/spec/mongo/session_transaction_spec.rb +15 -30
- data/spec/mongo/socket/ssl_spec.rb +26 -58
- data/spec/mongo/socket/unix_spec.rb +1 -0
- data/spec/mongo/uri_option_parsing_spec.rb +38 -5
- data/spec/mongo/utils_spec.rb +0 -14
- data/spec/runners/change_streams/test.rb +1 -1
- data/spec/runners/cmap.rb +1 -1
- data/spec/runners/connection_string.rb +7 -3
- data/spec/runners/crud/operation.rb +5 -3
- data/spec/runners/crud/requirement.rb +1 -0
- data/spec/runners/crud/verifier.rb +1 -2
- data/spec/runners/crud.rb +1 -1
- data/spec/runners/sdam.rb +2 -1
- data/spec/runners/transactions/test.rb +2 -2
- data/spec/runners/unified/assertions.rb +5 -4
- data/spec/runners/unified/crud_operations.rb +77 -23
- data/spec/runners/unified/ddl_operations.rb +29 -1
- data/spec/runners/unified/entity_map.rb +3 -3
- data/spec/runners/unified/event_subscriber.rb +2 -2
- data/spec/runners/unified/support_operations.rb +16 -3
- data/spec/runners/unified/test.rb +18 -3
- data/spec/runners/unified.rb +1 -1
- data/spec/shared/lib/mrss/cluster_config.rb +6 -1
- data/spec/shared/lib/mrss/constraints.rb +11 -5
- data/spec/shared/lib/mrss/event_subscriber.rb +200 -0
- data/spec/shared/lib/mrss/server_version_registry.rb +17 -12
- data/spec/shared/share/Dockerfile.erb +5 -4
- data/spec/shared/shlib/server.sh +70 -20
- data/spec/spec_tests/change_streams_spec.rb +1 -1
- data/spec/spec_tests/cmap_spec.rb +4 -1
- data/spec/spec_tests/command_monitoring_spec.rb +2 -2
- data/spec/spec_tests/data/command_monitoring/find.yml +9 -9
- data/spec/spec_tests/data/crud/read/aggregate-collation.yml +2 -1
- data/spec/spec_tests/data/crud/read/aggregate-out.yml +1 -0
- data/spec/spec_tests/data/crud/read/count-collation.yml +2 -1
- data/spec/spec_tests/data/crud/read/distinct-collation.yml +2 -1
- data/spec/spec_tests/data/crud/read/find-collation.yml +2 -1
- data/spec/spec_tests/data/crud/write/bulkWrite-collation.yml +2 -1
- data/spec/spec_tests/data/crud/write/deleteMany-collation.yml +2 -1
- data/spec/spec_tests/data/crud/write/deleteOne-collation.yml +2 -1
- data/spec/spec_tests/data/crud/write/findOneAndDelete-collation.yml +3 -2
- data/spec/spec_tests/data/crud/write/findOneAndReplace-collation.yml +2 -1
- data/spec/spec_tests/data/crud/write/findOneAndUpdate-collation.yml +3 -2
- data/spec/spec_tests/data/crud/write/replaceOne-collation.yml +3 -2
- data/spec/spec_tests/data/crud/write/updateMany-collation.yml +2 -1
- data/spec/spec_tests/data/crud/write/updateOne-collation.yml +2 -1
- data/spec/spec_tests/data/crud_unified/aggregate-let.yml +138 -0
- data/spec/spec_tests/data/crud_unified/aggregate-write-readPreference.yml +155 -0
- data/spec/spec_tests/data/crud_unified/db-aggregate-write-readPreference.yml +151 -0
- data/spec/spec_tests/data/crud_unified/deleteMany-let.yml +91 -0
- data/spec/spec_tests/data/crud_unified/deleteOne-let.yml +89 -0
- data/spec/spec_tests/data/crud_unified/find-let.yml +71 -0
- data/spec/spec_tests/data/crud_unified/findOneAndDelete-let.yml +88 -0
- data/spec/spec_tests/data/crud_unified/findOneAndReplace-let.yml +94 -0
- data/spec/spec_tests/data/crud_unified/findOneAndUpdate-let.yml +96 -0
- data/spec/spec_tests/data/crud_unified/updateMany-let.yml +103 -0
- data/spec/spec_tests/data/crud_unified/updateOne-let.yml +98 -0
- data/spec/spec_tests/data/load_balancers/event-monitoring.yml +99 -0
- data/spec/spec_tests/data/load_balancers/lb-connection-establishment.yml +36 -0
- data/spec/spec_tests/data/load_balancers/non-lb-connection-establishment.yml +56 -0
- data/spec/spec_tests/data/load_balancers/server-selection.yml +50 -0
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/DefaultNoMaxStaleness.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/LastUpdateTime.yml +3 -3
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/Nearest.yml +3 -3
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/Nearest2.yml +3 -3
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/PrimaryPreferred.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/PrimaryPreferred_tags.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/Secondary.yml +4 -4
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/SecondaryPreferred.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/SecondaryPreferred_tags.yml +4 -4
- data/spec/spec_tests/data/max_staleness/ReplicaSetNoPrimary/ZeroMaxStaleness.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/DefaultNoMaxStaleness.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/LastUpdateTime.yml +3 -3
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/LongHeartbeat.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/LongHeartbeat2.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/MaxStalenessTooSmall.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Nearest.yml +3 -3
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Nearest2.yml +3 -3
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Nearest_tags.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/PrimaryPreferred.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred.yml +2 -2
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred_tags.yml +5 -5
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/SecondaryPreferred_tags2.yml +3 -3
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Secondary_tags.yml +5 -5
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/Secondary_tags2.yml +3 -3
- data/spec/spec_tests/data/max_staleness/ReplicaSetWithPrimary/ZeroMaxStaleness.yml +2 -2
- data/spec/spec_tests/data/max_staleness/Sharded/SmallMaxStaleness.yml +2 -2
- data/spec/spec_tests/data/max_staleness/Single/SmallMaxStaleness.yml +1 -1
- data/spec/spec_tests/data/max_staleness/Unknown/SmallMaxStaleness.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-client.watch-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-client.watch.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.coll.watch-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.coll.watch.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.watch-serverErrors.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/changeStreams-db.watch.yml +1 -1
- data/spec/spec_tests/data/retryable_reads/mapReduce.yml +3 -1
- data/spec/spec_tests/data/sdam/load-balanced/discover_load_balancer.yml +25 -0
- data/spec/spec_tests/data/sdam_integration/find-network-error.yml +2 -0
- data/spec/spec_tests/data/sdam_integration/find-shutdown-error.yml +2 -0
- data/spec/spec_tests/data/sdam_integration/hello-command-error.yml +3 -1
- data/spec/spec_tests/data/sdam_integration/hello-network-error.yml +3 -1
- data/spec/spec_tests/data/sdam_integration/hello-timeout.yml +2 -0
- data/spec/spec_tests/data/sdam_integration/insert-network-error.yml +2 -0
- data/spec/spec_tests/data/sdam_integration/insert-shutdown-error.yml +2 -0
- data/spec/spec_tests/data/sdam_monitoring/load_balancer.yml +65 -0
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-directConnection.yml +13 -0
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-replicaSet-errors.yml +6 -0
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-true-multiple-hosts.yml +5 -0
- data/spec/spec_tests/data/seed_list_discovery/load-balanced/loadBalanced-true-txt.yml +10 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/direct-connection-false.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/direct-connection-true.yml +0 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/encoded-userinfo-and-db.yml +15 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/loadBalanced-false-txt.yml +10 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/longer-parent-in-return.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/misformatted-option.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/no-results.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/not-enough-parts.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/one-result-default-port.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/one-txt-record-multiple-strings.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/one-txt-record.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/parent-part-mismatch1.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/parent-part-mismatch2.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/parent-part-mismatch3.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/parent-part-mismatch4.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/parent-part-mismatch5.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/returned-parent-too-short.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/returned-parent-wrong.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/two-results-default-port.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/two-results-nonstandard-port.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/two-txt-records.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/txt-record-not-allowed-option.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/txt-record-with-overridden-ssl-option.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/txt-record-with-overridden-uri-option.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/txt-record-with-unallowed-option.yml +0 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/uri-with-admin-database.yml +13 -0
- data/spec/spec_tests/data/seed_list_discovery/replica-set/uri-with-auth.yml +12 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/uri-with-port.yml +0 -0
- data/spec/spec_tests/data/{dns_seedlist_discovery → seed_list_discovery/replica-set}/uri-with-two-hosts.yml +0 -0
- data/spec/spec_tests/data/sessions_unified/snapshot-sessions-not-supported-client-error.yml +69 -0
- data/spec/spec_tests/data/sessions_unified/snapshot-sessions-not-supported-server-error.yml +102 -0
- data/spec/spec_tests/data/sessions_unified/snapshot-sessions-unsupported-ops.yml +258 -0
- data/spec/spec_tests/data/sessions_unified/snapshot-sessions.yml +482 -0
- data/spec/spec_tests/data/transactions/retryable-abort-errorLabels.yml +2 -0
- data/spec/spec_tests/data/transactions/retryable-abort.yml +2 -0
- data/spec/spec_tests/data/transactions/retryable-commit-errorLabels.yml +2 -0
- data/spec/spec_tests/data/transactions/retryable-commit.yml +2 -0
- data/spec/spec_tests/data/transactions/retryable-writes.yml +2 -0
- data/spec/spec_tests/data/uri_options/connection-options.yml +60 -0
- data/spec/spec_tests/load_balancers_spec.rb +15 -0
- data/spec/spec_tests/retryable_reads_spec.rb +2 -2
- data/spec/spec_tests/retryable_writes_spec.rb +1 -1
- data/spec/spec_tests/sdam_integration_spec.rb +1 -1
- data/spec/spec_tests/sdam_monitoring_spec.rb +10 -5
- data/spec/spec_tests/sdam_spec.rb +1 -1
- data/spec/spec_tests/seed_list_discovery_spec.rb +118 -0
- data/spec/spec_tests/sessions_unified_spec.rb +13 -0
- data/spec/spec_tests/uri_options_spec.rb +4 -4
- data/spec/stress/fork_reconnect_stress_spec.rb +1 -5
- data/spec/stress/push_monitor_close_spec.rb +44 -0
- data/spec/support/certificates/atlas-ocsp-ca.crt +82 -90
- data/spec/support/certificates/atlas-ocsp.crt +127 -122
- data/spec/support/common_shortcuts.rb +2 -3
- data/spec/support/matchers.rb +13 -0
- data/spec/support/shared/auth_context.rb +16 -0
- data/spec/support/shared/session.rb +2 -2
- data/spec/support/spec_config.rb +10 -11
- data/spec/support/using_hash.rb +31 -0
- data/spec/support/utils.rb +1 -1
- data.tar.gz.sig +3 -4
- metadata +1111 -1029
- metadata.gz.sig +2 -3
- data/lib/mongo/collection/view/builder/find_command.rb +0 -173
- data/lib/mongo/collection/view/builder/op_query.rb +0 -94
- data/lib/mongo/cursor/builder/get_more_command.rb +0 -80
- data/lib/mongo/cursor/builder/kill_cursors_command.rb +0 -111
- data/lib/mongo/cursor/builder/op_get_more.rb +0 -64
- data/lib/mongo/cursor/builder/op_kill_cursors.rb +0 -106
- data/lib/mongo/server/context.rb +0 -72
- data/spec/mongo/cursor/builder/op_kill_cursors_spec.rb +0 -66
- data/spec/runners/unified/using_hash.rb +0 -34
- data/spec/spec_tests/dns_seedlist_discovery_spec.rb +0 -79
- data/spec/support/event_subscriber.rb +0 -221
@@ -0,0 +1,88 @@
|
|
1
|
+
description: "findOneAndDelete-let"
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
createEntities:
|
6
|
+
- client:
|
7
|
+
id: &client0 client0
|
8
|
+
observeEvents: [ commandStartedEvent ]
|
9
|
+
- database:
|
10
|
+
id: &database0 database0
|
11
|
+
client: *client0
|
12
|
+
databaseName: &database0Name crud-tests
|
13
|
+
- collection:
|
14
|
+
id: &collection0 collection0
|
15
|
+
database: *database0
|
16
|
+
collectionName: &collection0Name coll0
|
17
|
+
|
18
|
+
initialData: &initialData
|
19
|
+
- collectionName: *collection0Name
|
20
|
+
databaseName: *database0Name
|
21
|
+
documents:
|
22
|
+
- { _id: 1 }
|
23
|
+
- { _id: 2 }
|
24
|
+
|
25
|
+
tests:
|
26
|
+
- description: "findOneAndDelete with let option"
|
27
|
+
runOnRequirements:
|
28
|
+
- minServerVersion: "5.0"
|
29
|
+
operations:
|
30
|
+
- name: findOneAndDelete
|
31
|
+
object: *collection0
|
32
|
+
arguments:
|
33
|
+
filter: &filter
|
34
|
+
$expr:
|
35
|
+
$eq: [ "$_id", "$$id" ]
|
36
|
+
let: &let0
|
37
|
+
id: 1
|
38
|
+
expectEvents:
|
39
|
+
- client: *client0
|
40
|
+
events:
|
41
|
+
- commandStartedEvent:
|
42
|
+
command:
|
43
|
+
findAndModify: *collection0Name
|
44
|
+
query: *filter
|
45
|
+
remove: true
|
46
|
+
let: *let0
|
47
|
+
outcome:
|
48
|
+
-
|
49
|
+
collectionName: *collection0Name
|
50
|
+
databaseName: *database0Name
|
51
|
+
documents:
|
52
|
+
- { _id: 2 }
|
53
|
+
|
54
|
+
- description: "findOneAndDelete with let option unsupported (server-side error)"
|
55
|
+
runOnRequirements:
|
56
|
+
- minServerVersion: "4.2.0"
|
57
|
+
maxServerVersion: "4.4.99"
|
58
|
+
operations:
|
59
|
+
- name: findOneAndDelete
|
60
|
+
object: *collection0
|
61
|
+
arguments:
|
62
|
+
filter: &filter1
|
63
|
+
$expr:
|
64
|
+
$eq: [ "$_id", "$$id" ]
|
65
|
+
let: &let1
|
66
|
+
id: 1
|
67
|
+
expectError:
|
68
|
+
# This error message is consistent between 4.2.x and 4.4.x servers.
|
69
|
+
# Older servers return a different error message.
|
70
|
+
errorContains: "field 'let' is an unknown field"
|
71
|
+
isClientError: false
|
72
|
+
expectEvents:
|
73
|
+
- client: *client0
|
74
|
+
events:
|
75
|
+
- commandStartedEvent:
|
76
|
+
command:
|
77
|
+
findAndModify: *collection0Name
|
78
|
+
query: *filter1
|
79
|
+
remove: true
|
80
|
+
let: *let1
|
81
|
+
outcome:
|
82
|
+
-
|
83
|
+
collectionName: *collection0Name
|
84
|
+
databaseName: *database0Name
|
85
|
+
documents:
|
86
|
+
- { _id: 1 }
|
87
|
+
- { _id: 2 }
|
88
|
+
|
@@ -0,0 +1,94 @@
|
|
1
|
+
description: "findOneAndReplace-let"
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
createEntities:
|
6
|
+
- client:
|
7
|
+
id: &client0 client0
|
8
|
+
observeEvents: [ commandStartedEvent ]
|
9
|
+
- database:
|
10
|
+
id: &database0 database0
|
11
|
+
client: *client0
|
12
|
+
databaseName: &database0Name crud-tests
|
13
|
+
- collection:
|
14
|
+
id: &collection0 collection0
|
15
|
+
database: *database0
|
16
|
+
collectionName: &collection0Name coll0
|
17
|
+
|
18
|
+
initialData: &initialData
|
19
|
+
- collectionName: *collection0Name
|
20
|
+
databaseName: *database0Name
|
21
|
+
documents:
|
22
|
+
- { _id: 1 }
|
23
|
+
- { _id: 2 }
|
24
|
+
|
25
|
+
tests:
|
26
|
+
- description: "findOneAndReplace with let option"
|
27
|
+
runOnRequirements:
|
28
|
+
- minServerVersion: "5.0"
|
29
|
+
operations:
|
30
|
+
- name: findOneAndReplace
|
31
|
+
object: *collection0
|
32
|
+
arguments:
|
33
|
+
filter: &filter
|
34
|
+
$expr:
|
35
|
+
$eq: [ "$_id", "$$id" ]
|
36
|
+
replacement: &replacement
|
37
|
+
x: "x"
|
38
|
+
let: &let0
|
39
|
+
id: 1
|
40
|
+
expectResult:
|
41
|
+
_id: 1
|
42
|
+
expectEvents:
|
43
|
+
- client: *client0
|
44
|
+
events:
|
45
|
+
- commandStartedEvent:
|
46
|
+
command:
|
47
|
+
findAndModify: *collection0Name
|
48
|
+
query: *filter
|
49
|
+
update: *replacement
|
50
|
+
let: *let0
|
51
|
+
outcome:
|
52
|
+
-
|
53
|
+
collectionName: *collection0Name
|
54
|
+
databaseName: *database0Name
|
55
|
+
documents:
|
56
|
+
- { _id: 1, x: "x" }
|
57
|
+
- { _id: 2 }
|
58
|
+
|
59
|
+
- description: "findOneAndReplace with let option unsupported (server-side error)"
|
60
|
+
runOnRequirements:
|
61
|
+
- minServerVersion: "4.2.0"
|
62
|
+
maxServerVersion: "4.4.99"
|
63
|
+
operations:
|
64
|
+
- name: findOneAndReplace
|
65
|
+
object: *collection0
|
66
|
+
arguments:
|
67
|
+
filter: &filter1
|
68
|
+
$expr:
|
69
|
+
$eq: [ "$_id", "$$id" ]
|
70
|
+
replacement: &replacement1
|
71
|
+
x: "x"
|
72
|
+
let: &let1
|
73
|
+
id: 1
|
74
|
+
expectError:
|
75
|
+
# This error message is consistent between 4.2.x and 4.4.x servers.
|
76
|
+
# Older servers return a different error message.
|
77
|
+
errorContains: "field 'let' is an unknown field"
|
78
|
+
isClientError: false
|
79
|
+
expectEvents:
|
80
|
+
- client: *client0
|
81
|
+
events:
|
82
|
+
- commandStartedEvent:
|
83
|
+
command:
|
84
|
+
findAndModify: *collection0Name
|
85
|
+
query: *filter1
|
86
|
+
update: *replacement1
|
87
|
+
let: *let1
|
88
|
+
outcome:
|
89
|
+
-
|
90
|
+
collectionName: *collection0Name
|
91
|
+
databaseName: *database0Name
|
92
|
+
documents:
|
93
|
+
- { _id: 1 }
|
94
|
+
- { _id: 2 }
|
@@ -0,0 +1,96 @@
|
|
1
|
+
description: "findOneAndUpdate-let"
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
createEntities:
|
6
|
+
- client:
|
7
|
+
id: &client0 client0
|
8
|
+
observeEvents: [ commandStartedEvent ]
|
9
|
+
- database:
|
10
|
+
id: &database0 database0
|
11
|
+
client: *client0
|
12
|
+
databaseName: &database0Name crud-tests
|
13
|
+
- collection:
|
14
|
+
id: &collection0 collection0
|
15
|
+
database: *database0
|
16
|
+
collectionName: &collection0Name coll0
|
17
|
+
|
18
|
+
initialData: &initialData
|
19
|
+
- collectionName: *collection0Name
|
20
|
+
databaseName: *database0Name
|
21
|
+
documents:
|
22
|
+
- { _id: 1 }
|
23
|
+
- { _id: 2 }
|
24
|
+
|
25
|
+
tests:
|
26
|
+
- description: "findOneAndUpdate with let option"
|
27
|
+
runOnRequirements:
|
28
|
+
- minServerVersion: "5.0"
|
29
|
+
operations:
|
30
|
+
- name: findOneAndUpdate
|
31
|
+
object: *collection0
|
32
|
+
arguments:
|
33
|
+
filter: &filter
|
34
|
+
$expr:
|
35
|
+
$eq: [ "$_id", "$$id" ]
|
36
|
+
update: &update
|
37
|
+
- $set: {x: "$$x" }
|
38
|
+
let: &let0
|
39
|
+
id: 1
|
40
|
+
x: "foo"
|
41
|
+
expectResult:
|
42
|
+
_id: 1
|
43
|
+
expectEvents:
|
44
|
+
- client: *client0
|
45
|
+
events:
|
46
|
+
- commandStartedEvent:
|
47
|
+
command:
|
48
|
+
findAndModify: *collection0Name
|
49
|
+
query: *filter
|
50
|
+
update: *update
|
51
|
+
let: *let0
|
52
|
+
outcome:
|
53
|
+
-
|
54
|
+
collectionName: *collection0Name
|
55
|
+
databaseName: *database0Name
|
56
|
+
documents:
|
57
|
+
- { _id: 1, x: "foo" }
|
58
|
+
- { _id: 2 }
|
59
|
+
|
60
|
+
- description: "findOneAndUpdate with let option unsupported (server-side error)"
|
61
|
+
runOnRequirements:
|
62
|
+
- minServerVersion: "4.2.0"
|
63
|
+
maxServerVersion: "4.4.99"
|
64
|
+
operations:
|
65
|
+
- name: findOneAndUpdate
|
66
|
+
object: *collection0
|
67
|
+
arguments:
|
68
|
+
filter: &filter1
|
69
|
+
$expr:
|
70
|
+
$eq: [ "$_id", "$$id" ]
|
71
|
+
update: &update1
|
72
|
+
- $set: {x: "$$x"}
|
73
|
+
let: &let1
|
74
|
+
id: 1
|
75
|
+
x: "foo"
|
76
|
+
expectError:
|
77
|
+
# This error message is consistent between 4.2.x and 4.4.x servers.
|
78
|
+
# Older servers return a different error message.
|
79
|
+
errorContains: "field 'let' is an unknown field"
|
80
|
+
isClientError: false
|
81
|
+
expectEvents:
|
82
|
+
- client: *client0
|
83
|
+
events:
|
84
|
+
- commandStartedEvent:
|
85
|
+
command:
|
86
|
+
findAndModify: *collection0Name
|
87
|
+
query: *filter1
|
88
|
+
update: *update1
|
89
|
+
let: *let1
|
90
|
+
outcome:
|
91
|
+
-
|
92
|
+
collectionName: *collection0Name
|
93
|
+
databaseName: *database0Name
|
94
|
+
documents:
|
95
|
+
- { _id: 1 }
|
96
|
+
- { _id: 2 }
|
@@ -0,0 +1,103 @@
|
|
1
|
+
description: "updateMany-let"
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
createEntities:
|
6
|
+
- client:
|
7
|
+
id: &client0 client0
|
8
|
+
observeEvents: [ commandStartedEvent ]
|
9
|
+
- database:
|
10
|
+
id: &database0 database0
|
11
|
+
client: *client0
|
12
|
+
databaseName: &database0Name crud-tests
|
13
|
+
- collection:
|
14
|
+
id: &collection0 collection0
|
15
|
+
database: *database0
|
16
|
+
collectionName: &collection0Name coll0
|
17
|
+
|
18
|
+
initialData: &initialData
|
19
|
+
- collectionName: *collection0Name
|
20
|
+
databaseName: *database0Name
|
21
|
+
documents:
|
22
|
+
- { _id: 1 }
|
23
|
+
- { _id: 2, name: "name" }
|
24
|
+
- { _id: 3, name: "name" }
|
25
|
+
|
26
|
+
|
27
|
+
tests:
|
28
|
+
- description: "updateMany with let option"
|
29
|
+
runOnRequirements:
|
30
|
+
- minServerVersion: "5.0"
|
31
|
+
operations:
|
32
|
+
- name: updateMany
|
33
|
+
object: *collection0
|
34
|
+
arguments:
|
35
|
+
filter: &filter
|
36
|
+
$expr:
|
37
|
+
$eq: [ "$name", "$$name" ]
|
38
|
+
update: &update
|
39
|
+
- $set: {x: "$$x", y: "$$y" }
|
40
|
+
let: &let0
|
41
|
+
name: name
|
42
|
+
x: foo
|
43
|
+
y: { $literal: "bar" }
|
44
|
+
expectResult:
|
45
|
+
matchedCount: 2
|
46
|
+
modifiedCount: 2
|
47
|
+
upsertedCount: 0
|
48
|
+
expectEvents:
|
49
|
+
- client: *client0
|
50
|
+
events:
|
51
|
+
- commandStartedEvent:
|
52
|
+
command:
|
53
|
+
update: *collection0Name
|
54
|
+
updates:
|
55
|
+
-
|
56
|
+
q: *filter
|
57
|
+
u: *update
|
58
|
+
let: *let0
|
59
|
+
outcome:
|
60
|
+
-
|
61
|
+
collectionName: *collection0Name
|
62
|
+
databaseName: *database0Name
|
63
|
+
documents:
|
64
|
+
- { _id: 1 }
|
65
|
+
- { _id: 2, name: "name", x: "foo", y: "bar" }
|
66
|
+
- { _id: 3, name: "name", x: "foo", y: "bar" }
|
67
|
+
|
68
|
+
- description: "updateMany with let option unsupported (server-side error)"
|
69
|
+
runOnRequirements:
|
70
|
+
- minServerVersion: "3.6.0"
|
71
|
+
maxServerVersion: "4.4.99"
|
72
|
+
operations:
|
73
|
+
- name: updateMany
|
74
|
+
object: *collection0
|
75
|
+
arguments:
|
76
|
+
filter: &filter1
|
77
|
+
_id: 1
|
78
|
+
update: &update1
|
79
|
+
- $set: {x: "$$x"}
|
80
|
+
let: &let1
|
81
|
+
x: foo
|
82
|
+
expectError:
|
83
|
+
errorContains: "'update.let' is an unknown field"
|
84
|
+
isClientError: false
|
85
|
+
expectEvents:
|
86
|
+
- client: *client0
|
87
|
+
events:
|
88
|
+
- commandStartedEvent:
|
89
|
+
command:
|
90
|
+
update: *collection0Name
|
91
|
+
updates:
|
92
|
+
-
|
93
|
+
q: *filter1
|
94
|
+
u: *update1
|
95
|
+
let: *let1
|
96
|
+
outcome:
|
97
|
+
-
|
98
|
+
collectionName: *collection0Name
|
99
|
+
databaseName: *database0Name
|
100
|
+
documents:
|
101
|
+
- { _id: 1 }
|
102
|
+
- { _id: 2, name: "name" }
|
103
|
+
- { _id: 3, name: "name" }
|
@@ -0,0 +1,98 @@
|
|
1
|
+
description: "updateOne-let"
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
createEntities:
|
6
|
+
- client:
|
7
|
+
id: &client0 client0
|
8
|
+
observeEvents: [ commandStartedEvent ]
|
9
|
+
- database:
|
10
|
+
id: &database0 database0
|
11
|
+
client: *client0
|
12
|
+
databaseName: &database0Name crud-tests
|
13
|
+
- collection:
|
14
|
+
id: &collection0 collection0
|
15
|
+
database: *database0
|
16
|
+
collectionName: &collection0Name coll0
|
17
|
+
|
18
|
+
initialData: &initialData
|
19
|
+
- collectionName: *collection0Name
|
20
|
+
databaseName: *database0Name
|
21
|
+
documents:
|
22
|
+
- { _id: 1 }
|
23
|
+
- { _id: 2 }
|
24
|
+
|
25
|
+
tests:
|
26
|
+
- description: "UpdateOne with let option"
|
27
|
+
runOnRequirements:
|
28
|
+
- minServerVersion: "5.0"
|
29
|
+
operations:
|
30
|
+
- name: updateOne
|
31
|
+
object: *collection0
|
32
|
+
arguments:
|
33
|
+
filter: &filter
|
34
|
+
$expr:
|
35
|
+
$eq: [ "$_id", "$$id" ]
|
36
|
+
update: &update
|
37
|
+
- $set: {x: "$$x" }
|
38
|
+
let: &let0
|
39
|
+
id: 1
|
40
|
+
x: "foo"
|
41
|
+
expectResult:
|
42
|
+
matchedCount: 1
|
43
|
+
modifiedCount: 1
|
44
|
+
upsertedCount: 0
|
45
|
+
expectEvents:
|
46
|
+
- client: *client0
|
47
|
+
events:
|
48
|
+
- commandStartedEvent:
|
49
|
+
command:
|
50
|
+
update: *collection0Name
|
51
|
+
updates:
|
52
|
+
-
|
53
|
+
q: *filter
|
54
|
+
u: *update
|
55
|
+
let: *let0
|
56
|
+
outcome:
|
57
|
+
-
|
58
|
+
collectionName: *collection0Name
|
59
|
+
databaseName: *database0Name
|
60
|
+
documents:
|
61
|
+
- { _id: 1, x: "foo" }
|
62
|
+
- { _id: 2 }
|
63
|
+
|
64
|
+
- description: "UpdateOne with let option unsupported (server-side error)"
|
65
|
+
runOnRequirements:
|
66
|
+
- minServerVersion: "3.6.0"
|
67
|
+
maxServerVersion: "4.4.99"
|
68
|
+
operations:
|
69
|
+
- name: updateOne
|
70
|
+
object: *collection0
|
71
|
+
arguments:
|
72
|
+
filter: &filter1
|
73
|
+
_id: 1
|
74
|
+
update: &update1
|
75
|
+
- $set: {x: "$$x"}
|
76
|
+
let: &let1
|
77
|
+
x: foo
|
78
|
+
expectError:
|
79
|
+
errorContains: "'update.let' is an unknown field"
|
80
|
+
isClientError: false
|
81
|
+
expectEvents:
|
82
|
+
- client: *client0
|
83
|
+
events:
|
84
|
+
- commandStartedEvent:
|
85
|
+
command:
|
86
|
+
update: *collection0Name
|
87
|
+
updates:
|
88
|
+
-
|
89
|
+
q: *filter1
|
90
|
+
u: *update1
|
91
|
+
let: *let1
|
92
|
+
outcome:
|
93
|
+
-
|
94
|
+
collectionName: *collection0Name
|
95
|
+
databaseName: *database0Name
|
96
|
+
documents:
|
97
|
+
- { _id: 1 }
|
98
|
+
- { _id: 2 }
|
@@ -0,0 +1,99 @@
|
|
1
|
+
description: monitoring events include correct fields
|
2
|
+
|
3
|
+
schemaVersion: '1.3'
|
4
|
+
|
5
|
+
runOnRequirements:
|
6
|
+
- topologies: [ load-balanced ]
|
7
|
+
|
8
|
+
createEntities:
|
9
|
+
- client:
|
10
|
+
id: &client0 client0
|
11
|
+
useMultipleMongoses: true
|
12
|
+
uriOptions:
|
13
|
+
retryReads: false
|
14
|
+
observeEvents:
|
15
|
+
- commandStartedEvent
|
16
|
+
- commandSucceededEvent
|
17
|
+
- commandFailedEvent
|
18
|
+
- poolClearedEvent
|
19
|
+
- database:
|
20
|
+
id: &database0 database0
|
21
|
+
client: *client0
|
22
|
+
databaseName: &database0Name database0
|
23
|
+
- collection:
|
24
|
+
id: &collection0 collection0
|
25
|
+
database: *database0
|
26
|
+
collectionName: &collection0Name coll0
|
27
|
+
|
28
|
+
initialData:
|
29
|
+
- databaseName: *database0Name
|
30
|
+
collectionName: *collection0Name
|
31
|
+
documents: []
|
32
|
+
|
33
|
+
tests:
|
34
|
+
- description: command started and succeeded events include serviceId
|
35
|
+
operations:
|
36
|
+
- name: insertOne
|
37
|
+
object: *collection0
|
38
|
+
arguments:
|
39
|
+
document: { x: 1 }
|
40
|
+
expectEvents:
|
41
|
+
- client: *client0
|
42
|
+
events:
|
43
|
+
- commandStartedEvent:
|
44
|
+
commandName: insert
|
45
|
+
hasServiceId: true
|
46
|
+
- commandSucceededEvent:
|
47
|
+
commandName: insert
|
48
|
+
hasServiceId: true
|
49
|
+
|
50
|
+
- description: command failed events include serviceId
|
51
|
+
operations:
|
52
|
+
- name: find
|
53
|
+
object: *collection0
|
54
|
+
arguments:
|
55
|
+
filter: { $or: true }
|
56
|
+
expectError:
|
57
|
+
isError: true
|
58
|
+
expectEvents:
|
59
|
+
- client: *client0
|
60
|
+
events:
|
61
|
+
- commandStartedEvent:
|
62
|
+
commandName: find
|
63
|
+
hasServiceId: true
|
64
|
+
- commandFailedEvent:
|
65
|
+
commandName: find
|
66
|
+
hasServiceId: true
|
67
|
+
|
68
|
+
- description: poolClearedEvent events include serviceId
|
69
|
+
operations:
|
70
|
+
- name: failPoint
|
71
|
+
object: testRunner
|
72
|
+
arguments:
|
73
|
+
client: *client0
|
74
|
+
failPoint:
|
75
|
+
configureFailPoint: failCommand
|
76
|
+
mode: { times: 1 }
|
77
|
+
data:
|
78
|
+
failCommands: [find]
|
79
|
+
closeConnection: true
|
80
|
+
- name: find
|
81
|
+
object: *collection0
|
82
|
+
arguments:
|
83
|
+
filter: {}
|
84
|
+
expectError:
|
85
|
+
isClientError: true
|
86
|
+
expectEvents:
|
87
|
+
- client: *client0
|
88
|
+
events:
|
89
|
+
- commandStartedEvent:
|
90
|
+
commandName: find
|
91
|
+
hasServiceId: true
|
92
|
+
- commandFailedEvent:
|
93
|
+
commandName: find
|
94
|
+
hasServiceId: true
|
95
|
+
- client: *client0
|
96
|
+
eventType: cmap
|
97
|
+
events:
|
98
|
+
- poolClearedEvent:
|
99
|
+
hasServiceId: true
|
@@ -0,0 +1,36 @@
|
|
1
|
+
description: connection establishment for load-balanced clusters
|
2
|
+
|
3
|
+
schemaVersion: '1.3'
|
4
|
+
|
5
|
+
runOnRequirements:
|
6
|
+
- topologies: [ load-balanced ]
|
7
|
+
|
8
|
+
createEntities:
|
9
|
+
- client:
|
10
|
+
id: &client0 client0
|
11
|
+
uriOptions:
|
12
|
+
# Explicitly set loadBalanced to false to override the option from the global URI.
|
13
|
+
loadBalanced: false
|
14
|
+
observeEvents:
|
15
|
+
- commandStartedEvent
|
16
|
+
- database:
|
17
|
+
id: &database0 database0
|
18
|
+
client: *client0
|
19
|
+
databaseName: &database0Name database0
|
20
|
+
|
21
|
+
tests:
|
22
|
+
- description: operations against load balancers fail if URI contains loadBalanced=false
|
23
|
+
skipReason: servers have not implemented LB support yet so they will not fail the connection handshake in this case
|
24
|
+
operations:
|
25
|
+
- name: runCommand
|
26
|
+
object: *database0
|
27
|
+
arguments:
|
28
|
+
commandName: ping
|
29
|
+
command: { ping: 1 }
|
30
|
+
expectError:
|
31
|
+
isClientError: false
|
32
|
+
expectEvents:
|
33
|
+
# No events should be published because the server fails the connection handshake, so the "ping" command is never
|
34
|
+
# sent.
|
35
|
+
- client: *client0
|
36
|
+
events: []
|
@@ -0,0 +1,56 @@
|
|
1
|
+
description: connection establishment if loadBalanced is specified for non-load balanced clusters
|
2
|
+
|
3
|
+
schemaVersion: '1.3'
|
4
|
+
|
5
|
+
runOnRequirements:
|
6
|
+
# Don't run on replica sets because the URI used to configure the clients will contain multiple hosts and the
|
7
|
+
# replicaSet option, which will cause an error when constructing the lbTrueClient entity.
|
8
|
+
- topologies: [ single, sharded ]
|
9
|
+
|
10
|
+
createEntities:
|
11
|
+
- client:
|
12
|
+
id: &lbTrueClient lbTrueClient
|
13
|
+
# Restrict to a single mongos to ensure there are not multiple hosts in the URI, which would conflict with
|
14
|
+
# loadBalanced=true.
|
15
|
+
useMultipleMongoses: false
|
16
|
+
uriOptions:
|
17
|
+
loadBalanced: true
|
18
|
+
- database:
|
19
|
+
id: &lbTrueDatabase lbTrueDatabase
|
20
|
+
client: *lbTrueClient
|
21
|
+
databaseName: &lbTrueDatabaseName lbTrueDb
|
22
|
+
- client:
|
23
|
+
id: &lbFalseClient lbFalseClient
|
24
|
+
uriOptions:
|
25
|
+
loadBalanced: false
|
26
|
+
- database:
|
27
|
+
id: &lbFalseDatabase lbFalseDatabase
|
28
|
+
client: *lbFalseClient
|
29
|
+
databaseName: &lbFalseDatabaseName lbFalseDb
|
30
|
+
|
31
|
+
_yamlAnchors:
|
32
|
+
runCommandArguments:
|
33
|
+
- &pingArguments
|
34
|
+
arguments:
|
35
|
+
commandName: ping
|
36
|
+
command: { ping: 1 }
|
37
|
+
|
38
|
+
tests:
|
39
|
+
# These tests assert that drivers behave correctly if loadBalanced=true/false for non-load balanced clusters. Existing
|
40
|
+
# spec tests should cover the case where loadBalanced is unset.
|
41
|
+
|
42
|
+
# If the server is not configured to be behind a load balancer and the URI contains loadBalanced=true, the driver
|
43
|
+
# should error during the connection handshake because the server's hello response does not contain a serviceId field.
|
44
|
+
- description: operations against non-load balanced clusters fail if URI contains loadBalanced=true
|
45
|
+
operations:
|
46
|
+
- name: runCommand
|
47
|
+
object: *lbTrueDatabase
|
48
|
+
<<: *pingArguments
|
49
|
+
expectError:
|
50
|
+
errorContains: Driver attempted to initialize in load balancing mode, but the server does not support this mode
|
51
|
+
|
52
|
+
- description: operations against non-load balanced clusters succeed if URI contains loadBalanced=false
|
53
|
+
operations:
|
54
|
+
- name: runCommand
|
55
|
+
object: *lbFalseDatabase
|
56
|
+
<<: *pingArguments
|