mongo 2.15.0 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,482 @@
|
|
1
|
+
description: snapshot-sessions
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
runOnRequirements:
|
6
|
+
- minServerVersion: "5.0"
|
7
|
+
topologies: [replicaset, sharded-replicaset]
|
8
|
+
|
9
|
+
createEntities:
|
10
|
+
- client:
|
11
|
+
id: &client0 client0
|
12
|
+
observeEvents: [ commandStartedEvent]
|
13
|
+
ignoreCommandMonitoringEvents: [ findAndModify, insert, update ]
|
14
|
+
- database:
|
15
|
+
id: &database0 database0
|
16
|
+
client: *client0
|
17
|
+
databaseName: &database0Name database0
|
18
|
+
- collection:
|
19
|
+
id: &collection0 collection0
|
20
|
+
database: *database0
|
21
|
+
collectionName: &collection0Name collection0
|
22
|
+
collectionOptions:
|
23
|
+
writeConcern: { w: majority }
|
24
|
+
- session:
|
25
|
+
id: session0
|
26
|
+
client: client0
|
27
|
+
sessionOptions:
|
28
|
+
snapshot: true
|
29
|
+
- session:
|
30
|
+
id: session1
|
31
|
+
client: client0
|
32
|
+
sessionOptions:
|
33
|
+
snapshot: true
|
34
|
+
|
35
|
+
initialData:
|
36
|
+
- collectionName: *collection0Name
|
37
|
+
databaseName: *database0Name
|
38
|
+
documents:
|
39
|
+
- { _id: 1, x: 11 }
|
40
|
+
- { _id: 2, x: 11 }
|
41
|
+
|
42
|
+
tests:
|
43
|
+
- description: Find operation with snapshot
|
44
|
+
operations:
|
45
|
+
- name: find
|
46
|
+
object: collection0
|
47
|
+
arguments:
|
48
|
+
session: session0
|
49
|
+
filter: { _id: 1 }
|
50
|
+
expectResult:
|
51
|
+
- {_id: 1, x: 11}
|
52
|
+
- name: findOneAndUpdate
|
53
|
+
object: collection0
|
54
|
+
arguments:
|
55
|
+
filter: { _id: 1 }
|
56
|
+
update: { $inc: { x: 1 } }
|
57
|
+
returnDocument: After
|
58
|
+
expectResult: { _id: 1, x: 12 }
|
59
|
+
- name: find
|
60
|
+
object: collection0
|
61
|
+
arguments:
|
62
|
+
session: session1
|
63
|
+
filter: { _id: 1 }
|
64
|
+
expectResult:
|
65
|
+
- { _id: 1, x: 12 }
|
66
|
+
- name: findOneAndUpdate
|
67
|
+
object: collection0
|
68
|
+
arguments:
|
69
|
+
filter: { _id: 1 }
|
70
|
+
update: { $inc: { x: 1 } }
|
71
|
+
returnDocument: After
|
72
|
+
expectResult: { _id: 1, x: 13 }
|
73
|
+
- name: find
|
74
|
+
object: collection0
|
75
|
+
arguments:
|
76
|
+
filter: { _id: 1 }
|
77
|
+
expectResult:
|
78
|
+
- { _id: 1, x: 13 }
|
79
|
+
- name: find
|
80
|
+
object: collection0
|
81
|
+
arguments:
|
82
|
+
session: session0
|
83
|
+
filter: { _id: 1 }
|
84
|
+
expectResult:
|
85
|
+
- {_id: 1, x: 11}
|
86
|
+
- name: find
|
87
|
+
object: collection0
|
88
|
+
arguments:
|
89
|
+
session: session1
|
90
|
+
filter: { _id: 1 }
|
91
|
+
expectResult:
|
92
|
+
- {_id: 1, x: 12}
|
93
|
+
expectEvents:
|
94
|
+
- client: client0
|
95
|
+
events:
|
96
|
+
- commandStartedEvent:
|
97
|
+
command:
|
98
|
+
find: collection0
|
99
|
+
readConcern:
|
100
|
+
level: snapshot
|
101
|
+
atClusterTime:
|
102
|
+
"$$exists": false
|
103
|
+
- commandStartedEvent:
|
104
|
+
command:
|
105
|
+
find: collection0
|
106
|
+
readConcern:
|
107
|
+
level: snapshot
|
108
|
+
atClusterTime:
|
109
|
+
"$$exists": false
|
110
|
+
- commandStartedEvent:
|
111
|
+
command:
|
112
|
+
find: collection0
|
113
|
+
readConcern:
|
114
|
+
"$$exists": false
|
115
|
+
- commandStartedEvent:
|
116
|
+
command:
|
117
|
+
find: collection0
|
118
|
+
readConcern:
|
119
|
+
level: snapshot
|
120
|
+
atClusterTime:
|
121
|
+
"$$exists": true
|
122
|
+
- commandStartedEvent:
|
123
|
+
command:
|
124
|
+
find: collection0
|
125
|
+
readConcern:
|
126
|
+
level: snapshot
|
127
|
+
atClusterTime:
|
128
|
+
"$$exists": true
|
129
|
+
|
130
|
+
- description: Distinct operation with snapshot
|
131
|
+
operations:
|
132
|
+
- name: distinct
|
133
|
+
object: collection0
|
134
|
+
arguments:
|
135
|
+
fieldName: x
|
136
|
+
filter: {}
|
137
|
+
session: session0
|
138
|
+
expectResult:
|
139
|
+
- 11
|
140
|
+
- name: findOneAndUpdate
|
141
|
+
object: collection0
|
142
|
+
arguments:
|
143
|
+
filter: { _id: 2 }
|
144
|
+
update: { $inc: { x: 1 } }
|
145
|
+
returnDocument: After
|
146
|
+
expectResult: { _id: 2, x: 12 }
|
147
|
+
- name: distinct
|
148
|
+
object: collection0
|
149
|
+
arguments:
|
150
|
+
fieldName: x
|
151
|
+
filter: {}
|
152
|
+
session: session1
|
153
|
+
expectResult: [11, 12]
|
154
|
+
- name: findOneAndUpdate
|
155
|
+
object: collection0
|
156
|
+
arguments:
|
157
|
+
filter: { _id: 2 }
|
158
|
+
update: { $inc: { x: 1 } }
|
159
|
+
returnDocument: After
|
160
|
+
expectResult: { _id: 2, x: 13 }
|
161
|
+
- name: distinct
|
162
|
+
object: collection0
|
163
|
+
arguments:
|
164
|
+
fieldName: x
|
165
|
+
filter: {}
|
166
|
+
expectResult: [ 11, 13 ]
|
167
|
+
- name: distinct
|
168
|
+
object: collection0
|
169
|
+
arguments:
|
170
|
+
fieldName: x
|
171
|
+
filter: {}
|
172
|
+
session: session0
|
173
|
+
expectResult: [ 11 ]
|
174
|
+
- name: distinct
|
175
|
+
object: collection0
|
176
|
+
arguments:
|
177
|
+
fieldName: x
|
178
|
+
filter: {}
|
179
|
+
session: session1
|
180
|
+
expectResult: [ 11, 12 ]
|
181
|
+
expectEvents:
|
182
|
+
- client: client0
|
183
|
+
events:
|
184
|
+
- commandStartedEvent:
|
185
|
+
command:
|
186
|
+
distinct: collection0
|
187
|
+
readConcern:
|
188
|
+
level: snapshot
|
189
|
+
atClusterTime:
|
190
|
+
"$$exists": false
|
191
|
+
- commandStartedEvent:
|
192
|
+
command:
|
193
|
+
distinct: collection0
|
194
|
+
readConcern:
|
195
|
+
level: snapshot
|
196
|
+
atClusterTime:
|
197
|
+
"$$exists": false
|
198
|
+
- commandStartedEvent:
|
199
|
+
command:
|
200
|
+
distinct: collection0
|
201
|
+
readConcern:
|
202
|
+
"$$exists": false
|
203
|
+
- commandStartedEvent:
|
204
|
+
command:
|
205
|
+
distinct: collection0
|
206
|
+
readConcern:
|
207
|
+
level: snapshot
|
208
|
+
atClusterTime:
|
209
|
+
"$$exists": true
|
210
|
+
- commandStartedEvent:
|
211
|
+
command:
|
212
|
+
distinct: collection0
|
213
|
+
readConcern:
|
214
|
+
level: snapshot
|
215
|
+
atClusterTime:
|
216
|
+
"$$exists": true
|
217
|
+
|
218
|
+
- description: Aggregate operation with snapshot
|
219
|
+
operations:
|
220
|
+
- name: aggregate
|
221
|
+
object: collection0
|
222
|
+
arguments:
|
223
|
+
pipeline:
|
224
|
+
- "$match": { _id: 1 }
|
225
|
+
session: session0
|
226
|
+
expectResult:
|
227
|
+
- { _id: 1, x: 11 }
|
228
|
+
- name: findOneAndUpdate
|
229
|
+
object: collection0
|
230
|
+
arguments:
|
231
|
+
filter: { _id: 1 }
|
232
|
+
update: { $inc: { x: 1 } }
|
233
|
+
returnDocument: After
|
234
|
+
expectResult: { _id: 1, x: 12 }
|
235
|
+
- name: aggregate
|
236
|
+
object: collection0
|
237
|
+
arguments:
|
238
|
+
pipeline:
|
239
|
+
- "$match":
|
240
|
+
_id: 1
|
241
|
+
session: session1
|
242
|
+
expectResult:
|
243
|
+
- {_id: 1, x: 12}
|
244
|
+
- name: findOneAndUpdate
|
245
|
+
object: collection0
|
246
|
+
arguments:
|
247
|
+
filter: { _id: 1 }
|
248
|
+
update: { $inc: { x: 1 } }
|
249
|
+
returnDocument: After
|
250
|
+
expectResult: { _id: 1, x: 13 }
|
251
|
+
- name: aggregate
|
252
|
+
object: collection0
|
253
|
+
arguments:
|
254
|
+
pipeline:
|
255
|
+
- "$match": { _id: 1 }
|
256
|
+
expectResult:
|
257
|
+
- { _id: 1, x: 13 }
|
258
|
+
- name: aggregate
|
259
|
+
object: collection0
|
260
|
+
arguments:
|
261
|
+
pipeline:
|
262
|
+
- "$match":
|
263
|
+
_id: 1
|
264
|
+
session: session0
|
265
|
+
expectResult:
|
266
|
+
- { _id: 1, x: 11 }
|
267
|
+
- name: aggregate
|
268
|
+
object: collection0
|
269
|
+
arguments:
|
270
|
+
pipeline:
|
271
|
+
- "$match": { _id: 1 }
|
272
|
+
session: session1
|
273
|
+
expectResult:
|
274
|
+
- { _id: 1, x: 12 }
|
275
|
+
expectEvents:
|
276
|
+
- client: client0
|
277
|
+
events:
|
278
|
+
- commandStartedEvent:
|
279
|
+
command:
|
280
|
+
aggregate: collection0
|
281
|
+
readConcern:
|
282
|
+
level: snapshot
|
283
|
+
atClusterTime:
|
284
|
+
"$$exists": false
|
285
|
+
- commandStartedEvent:
|
286
|
+
command:
|
287
|
+
aggregate: collection0
|
288
|
+
readConcern:
|
289
|
+
level: snapshot
|
290
|
+
atClusterTime:
|
291
|
+
"$$exists": false
|
292
|
+
- commandStartedEvent:
|
293
|
+
command:
|
294
|
+
aggregate: collection0
|
295
|
+
readConcern:
|
296
|
+
"$$exists": false
|
297
|
+
- commandStartedEvent:
|
298
|
+
command:
|
299
|
+
aggregate: collection0
|
300
|
+
readConcern:
|
301
|
+
level: snapshot
|
302
|
+
atClusterTime:
|
303
|
+
"$$exists": true
|
304
|
+
- commandStartedEvent:
|
305
|
+
command:
|
306
|
+
aggregate: collection0
|
307
|
+
readConcern:
|
308
|
+
level: snapshot
|
309
|
+
atClusterTime:
|
310
|
+
"$$exists": true
|
311
|
+
|
312
|
+
- description: countDocuments operation with snapshot
|
313
|
+
operations:
|
314
|
+
- name: countDocuments
|
315
|
+
object: collection0
|
316
|
+
arguments:
|
317
|
+
filter: {}
|
318
|
+
session: session0
|
319
|
+
expectResult: 2
|
320
|
+
- name: countDocuments
|
321
|
+
object: collection0
|
322
|
+
arguments:
|
323
|
+
filter: {}
|
324
|
+
session: session0
|
325
|
+
expectResult: 2
|
326
|
+
expectEvents:
|
327
|
+
- client: client0
|
328
|
+
events:
|
329
|
+
- commandStartedEvent:
|
330
|
+
command:
|
331
|
+
aggregate: collection0
|
332
|
+
readConcern:
|
333
|
+
level: snapshot
|
334
|
+
atClusterTime:
|
335
|
+
"$$exists": false
|
336
|
+
- commandStartedEvent:
|
337
|
+
command:
|
338
|
+
aggregate: collection0
|
339
|
+
readConcern:
|
340
|
+
level: snapshot
|
341
|
+
atClusterTime:
|
342
|
+
"$$exists": true
|
343
|
+
|
344
|
+
- description: Mixed operation with snapshot
|
345
|
+
operations:
|
346
|
+
- name: find
|
347
|
+
object: collection0
|
348
|
+
arguments:
|
349
|
+
session: session0
|
350
|
+
filter: { _id: 1 }
|
351
|
+
expectResult:
|
352
|
+
- { _id: 1, x: 11 }
|
353
|
+
- name: findOneAndUpdate
|
354
|
+
object: collection0
|
355
|
+
arguments:
|
356
|
+
filter: { _id: 1 }
|
357
|
+
update: { $inc: { x: 1 } }
|
358
|
+
returnDocument: After
|
359
|
+
expectResult: { _id: 1, x: 12 }
|
360
|
+
- name: find
|
361
|
+
object: collection0
|
362
|
+
arguments:
|
363
|
+
filter: { _id: 1 }
|
364
|
+
expectResult:
|
365
|
+
- { _id: 1, x: 12 }
|
366
|
+
- name: aggregate
|
367
|
+
object: collection0
|
368
|
+
arguments:
|
369
|
+
pipeline:
|
370
|
+
- "$match":
|
371
|
+
_id: 1
|
372
|
+
session: session0
|
373
|
+
expectResult:
|
374
|
+
- { _id: 1, x: 11 }
|
375
|
+
- name: distinct
|
376
|
+
object: collection0
|
377
|
+
arguments:
|
378
|
+
fieldName: x
|
379
|
+
filter: {}
|
380
|
+
session: session0
|
381
|
+
expectResult: [ 11 ]
|
382
|
+
expectEvents:
|
383
|
+
- client: client0
|
384
|
+
events:
|
385
|
+
- commandStartedEvent:
|
386
|
+
command:
|
387
|
+
find: collection0
|
388
|
+
readConcern:
|
389
|
+
level: snapshot
|
390
|
+
atClusterTime:
|
391
|
+
"$$exists": false
|
392
|
+
- commandStartedEvent:
|
393
|
+
command:
|
394
|
+
find: collection0
|
395
|
+
readConcern:
|
396
|
+
"$$exists": false
|
397
|
+
- commandStartedEvent:
|
398
|
+
command:
|
399
|
+
aggregate: collection0
|
400
|
+
readConcern:
|
401
|
+
level: snapshot
|
402
|
+
atClusterTime:
|
403
|
+
"$$exists": true
|
404
|
+
- commandStartedEvent:
|
405
|
+
command:
|
406
|
+
distinct: collection0
|
407
|
+
readConcern:
|
408
|
+
level: snapshot
|
409
|
+
atClusterTime:
|
410
|
+
"$$exists": true
|
411
|
+
|
412
|
+
- description: Write commands with snapshot session do not affect snapshot reads
|
413
|
+
operations:
|
414
|
+
- name: find
|
415
|
+
object: collection0
|
416
|
+
arguments:
|
417
|
+
filter: {}
|
418
|
+
session: session0
|
419
|
+
- name: insertOne
|
420
|
+
object: collection0
|
421
|
+
arguments:
|
422
|
+
document:
|
423
|
+
_id: 22
|
424
|
+
x: 33
|
425
|
+
- name: updateOne
|
426
|
+
object: collection0
|
427
|
+
arguments:
|
428
|
+
filter: { _id: 1 }
|
429
|
+
update: { $inc: { x: 1 } }
|
430
|
+
- name: find
|
431
|
+
object: collection0
|
432
|
+
arguments:
|
433
|
+
filter: { _id: 1 }
|
434
|
+
session: session0
|
435
|
+
expectResult:
|
436
|
+
- {_id: 1, x: 11}
|
437
|
+
expectEvents:
|
438
|
+
- client: client0
|
439
|
+
events:
|
440
|
+
- commandStartedEvent:
|
441
|
+
command:
|
442
|
+
find: collection0
|
443
|
+
readConcern:
|
444
|
+
level: snapshot
|
445
|
+
atClusterTime:
|
446
|
+
"$$exists": false
|
447
|
+
- commandStartedEvent:
|
448
|
+
command:
|
449
|
+
find: collection0
|
450
|
+
readConcern:
|
451
|
+
level: snapshot
|
452
|
+
atClusterTime:
|
453
|
+
"$$exists": true
|
454
|
+
|
455
|
+
- description: First snapshot read does not send atClusterTime
|
456
|
+
operations:
|
457
|
+
- name: find
|
458
|
+
object: collection0
|
459
|
+
arguments:
|
460
|
+
filter: {}
|
461
|
+
session: session0
|
462
|
+
expectEvents:
|
463
|
+
- client: client0
|
464
|
+
events:
|
465
|
+
- commandStartedEvent:
|
466
|
+
command:
|
467
|
+
find: collection0
|
468
|
+
readConcern:
|
469
|
+
level: snapshot
|
470
|
+
atClusterTime:
|
471
|
+
"$$exists": false
|
472
|
+
commandName: find
|
473
|
+
databaseName: database0
|
474
|
+
|
475
|
+
- description: StartTransaction fails in snapshot session
|
476
|
+
operations:
|
477
|
+
- name: startTransaction
|
478
|
+
object: session0
|
479
|
+
expectError:
|
480
|
+
isError: true
|
481
|
+
isClientError: true
|
482
|
+
errorContains: Transactions are not supported in snapshot sessions
|
@@ -147,3 +147,63 @@ tests:
|
|
147
147
|
hosts: ~
|
148
148
|
auth: ~
|
149
149
|
options: {}
|
150
|
+
-
|
151
|
+
description: loadBalanced=true
|
152
|
+
uri: "mongodb://example.com/?loadBalanced=true"
|
153
|
+
valid: true
|
154
|
+
warning: false
|
155
|
+
hosts: ~
|
156
|
+
auth: ~
|
157
|
+
options:
|
158
|
+
loadBalanced: true
|
159
|
+
-
|
160
|
+
description: loadBalanced=true with directConnection=false
|
161
|
+
uri: "mongodb://example.com/?loadBalanced=true&directConnection=false"
|
162
|
+
valid: true
|
163
|
+
warning: false
|
164
|
+
hosts: ~
|
165
|
+
auth: ~
|
166
|
+
options:
|
167
|
+
loadBalanced: true
|
168
|
+
directConnection: false
|
169
|
+
-
|
170
|
+
description: loadBalanced=false
|
171
|
+
uri: "mongodb://example.com/?loadBalanced=false"
|
172
|
+
valid: true
|
173
|
+
warning: false
|
174
|
+
hosts: ~
|
175
|
+
auth: ~
|
176
|
+
options:
|
177
|
+
loadBalanced: false
|
178
|
+
-
|
179
|
+
description: Invalid loadBalanced value
|
180
|
+
uri: "mongodb://example.com/?loadBalanced=1"
|
181
|
+
valid: true
|
182
|
+
warning: true
|
183
|
+
hosts: ~
|
184
|
+
auth: ~
|
185
|
+
options: {}
|
186
|
+
-
|
187
|
+
description: loadBalanced=true with multiple hosts causes an error
|
188
|
+
uri: "mongodb://example1,example2/?loadBalanced=true"
|
189
|
+
valid: false
|
190
|
+
warning: false
|
191
|
+
hosts: ~
|
192
|
+
auth: ~
|
193
|
+
options: {}
|
194
|
+
-
|
195
|
+
description: loadBalanced=true with directConnection=true causes an error
|
196
|
+
uri: "mongodb://example.com/?loadBalanced=true&directConnection=true"
|
197
|
+
valid: false
|
198
|
+
warning: false
|
199
|
+
hosts: ~
|
200
|
+
auth: ~
|
201
|
+
options: {}
|
202
|
+
-
|
203
|
+
description: loadBalanced=true with replicaSet causes an error
|
204
|
+
uri: "mongodb://example.com/?loadBalanced=true&replicaSet=replset"
|
205
|
+
valid: false
|
206
|
+
warning: false
|
207
|
+
hosts: ~
|
208
|
+
auth: ~
|
209
|
+
options: {}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
require 'spec_helper'
|
5
|
+
|
6
|
+
require 'runners/unified'
|
7
|
+
|
8
|
+
base = "#{CURRENT_PATH}/spec_tests/data/load_balancers"
|
9
|
+
LOAD_BALANCER_TESTS = Dir.glob("#{base}/**/*.yml").sort
|
10
|
+
|
11
|
+
describe 'Load balancer spec tests' do
|
12
|
+
require_topology :load_balanced
|
13
|
+
|
14
|
+
define_unified_spec_tests(base, LOAD_BALANCER_TESTS)
|
15
|
+
end
|
@@ -7,7 +7,7 @@ require 'runners/crud'
|
|
7
7
|
|
8
8
|
describe 'Retryable reads spec tests' do
|
9
9
|
require_wired_tiger
|
10
|
-
|
10
|
+
require_no_multi_mongos
|
11
11
|
|
12
12
|
define_crud_spec_tests(RETRYABLE_READS_TESTS) do |spec, req, test|
|
13
13
|
let(:client) do
|
@@ -19,7 +19,7 @@ describe 'Retryable reads spec tests' do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
describe 'Retryable reads spec tests - legacy' do
|
22
|
-
|
22
|
+
require_no_multi_mongos
|
23
23
|
|
24
24
|
define_crud_spec_tests(RETRYABLE_READS_TESTS) do |spec, req, test|
|
25
25
|
let(:client_options) do
|
@@ -7,7 +7,7 @@ require 'runners/crud'
|
|
7
7
|
|
8
8
|
describe 'Retryable writes spec tests' do
|
9
9
|
require_wired_tiger
|
10
|
-
|
10
|
+
require_no_multi_mongos
|
11
11
|
|
12
12
|
# Do not run these tests when write retries are disabled globally -
|
13
13
|
# the tests won't work in that case and testing them with retries enabled
|
@@ -9,7 +9,7 @@ require 'runners/transactions'
|
|
9
9
|
SDAM_INTEGRATION_TESTS = Dir.glob("#{CURRENT_PATH}/spec_tests/data/sdam_integration/*.yml").sort
|
10
10
|
|
11
11
|
describe 'SDAM integration tests' do
|
12
|
-
|
12
|
+
require_no_multi_mongos
|
13
13
|
require_wired_tiger
|
14
14
|
|
15
15
|
define_transactions_spec_tests(SDAM_INTEGRATION_TESTS)
|
@@ -16,7 +16,7 @@ describe 'SDAM Monitoring' do
|
|
16
16
|
context("#{spec.description} (#{file.sub(%r'.*/data/sdam_monitoring/', '')})") do
|
17
17
|
|
18
18
|
before(:all) do
|
19
|
-
@subscriber = PhasedEventSubscriber.new
|
19
|
+
@subscriber = Mrss::PhasedEventSubscriber.new
|
20
20
|
sdam_proc = lambda do |client|
|
21
21
|
client.subscribe(Mongo::Monitoring::SERVER_OPENING, @subscriber)
|
22
22
|
client.subscribe(Mongo::Monitoring::SERVER_CLOSED, @subscriber)
|
@@ -39,8 +39,13 @@ describe 'SDAM Monitoring' do
|
|
39
39
|
# Since we set monitoring_io: false, servers are not monitored
|
40
40
|
# by the cluster. Start monitoring on them manually (this publishes
|
41
41
|
# the server opening event but, again due to monitoring_io being
|
42
|
-
# false, does not do network I/O or change server status)
|
43
|
-
|
42
|
+
# false, does not do network I/O or change server status).
|
43
|
+
#
|
44
|
+
# If the server is a load balancer, it doesn't normally get monitored
|
45
|
+
# so don't start here either.
|
46
|
+
unless server.load_balancer?
|
47
|
+
server.start_monitoring
|
48
|
+
end
|
44
49
|
end
|
45
50
|
end
|
46
51
|
|
@@ -53,7 +58,7 @@ describe 'SDAM Monitoring' do
|
|
53
58
|
context("Phase: #{phase_index + 1}") do
|
54
59
|
|
55
60
|
before(:all) do
|
56
|
-
phase.responses
|
61
|
+
phase.responses&.each do |response|
|
57
62
|
# For each response in the phase, we need to change that server's description.
|
58
63
|
server = find_server(@client, response.address)
|
59
64
|
server ||= @servers_cache[response.address.to_s]
|
@@ -68,7 +73,7 @@ describe 'SDAM Monitoring' do
|
|
68
73
|
result['minWireVersion'] ||= 0
|
69
74
|
result['maxWireVersion'] ||= 0
|
70
75
|
new_description = Mongo::Server::Description.new(
|
71
|
-
server.description.address, result, 0.5)
|
76
|
+
server.description.address, result, average_round_trip_time: 0.5)
|
72
77
|
@client.cluster.run_sdam_flow(server.description, new_description)
|
73
78
|
end
|
74
79
|
@subscriber.phase_finished(phase_index)
|
@@ -98,7 +98,7 @@ describe 'Server Discovery and Monitoring' do
|
|
98
98
|
result['minWireVersion'] ||= 0
|
99
99
|
result['maxWireVersion'] ||= 0
|
100
100
|
new_description = Mongo::Server::Description.new(
|
101
|
-
server.description.address, result, 0.5)
|
101
|
+
server.description.address, result, average_round_trip_time: 0.5)
|
102
102
|
@client.cluster.run_sdam_flow(server.description, new_description)
|
103
103
|
end
|
104
104
|
|