mongo 2.13.0 → 2.15.0.alpha
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 +1 -4
- data.tar.gz.sig +0 -0
- data/README.md +4 -1
- data/Rakefile +46 -18
- data/lib/mongo.rb +32 -0
- data/lib/mongo/address.rb +1 -1
- data/lib/mongo/address/ipv4.rb +1 -1
- data/lib/mongo/address/ipv6.rb +1 -1
- data/lib/mongo/auth/aws/conversation.rb +1 -4
- data/lib/mongo/auth/base.rb +13 -7
- data/lib/mongo/auth/conversation_base.rb +32 -0
- data/lib/mongo/auth/cr/conversation.rb +6 -29
- data/lib/mongo/auth/gssapi/conversation.rb +4 -15
- data/lib/mongo/auth/ldap/conversation.rb +3 -14
- data/lib/mongo/auth/sasl_conversation_base.rb +1 -13
- data/lib/mongo/auth/scram_conversation_base.rb +7 -34
- data/lib/mongo/auth/user/view.rb +16 -9
- data/lib/mongo/auth/x509/conversation.rb +4 -25
- data/lib/mongo/background_thread.rb +11 -0
- data/lib/mongo/bulk_write.rb +38 -18
- data/lib/mongo/caching_cursor.rb +74 -0
- data/lib/mongo/client.rb +142 -16
- data/lib/mongo/cluster.rb +22 -31
- data/lib/mongo/cluster/reapers/cursor_reaper.rb +6 -2
- data/lib/mongo/cluster/sdam_flow.rb +14 -0
- data/lib/mongo/cluster/topology/single.rb +1 -1
- data/lib/mongo/collection.rb +58 -18
- data/lib/mongo/collection/view.rb +24 -20
- data/lib/mongo/collection/view/aggregation.rb +26 -5
- data/lib/mongo/collection/view/builder/find_command.rb +38 -18
- data/lib/mongo/collection/view/change_stream.rb +1 -1
- data/lib/mongo/collection/view/explainable.rb +27 -8
- data/lib/mongo/collection/view/iterable.rb +73 -13
- data/lib/mongo/collection/view/map_reduce.rb +2 -2
- data/lib/mongo/collection/view/readable.rb +57 -21
- data/lib/mongo/collection/view/writable.rb +29 -15
- data/lib/mongo/crypt/encryption_io.rb +6 -6
- data/lib/mongo/cursor.rb +18 -5
- data/lib/mongo/database.rb +28 -5
- data/lib/mongo/database/view.rb +2 -2
- data/lib/mongo/error.rb +11 -1
- data/lib/mongo/error/bulk_write_error.rb +17 -3
- data/lib/mongo/error/internal_driver_error.rb +22 -0
- data/lib/mongo/error/invalid_read_concern.rb +28 -0
- data/lib/mongo/error/operation_failure.rb +26 -7
- data/lib/mongo/error/parser.rb +65 -12
- data/lib/mongo/error/server_api_conflict.rb +23 -0
- data/lib/mongo/error/server_api_not_supported.rb +24 -0
- data/lib/mongo/error/server_certificate_revoked.rb +22 -0
- data/lib/mongo/error/unmet_dependency.rb +21 -0
- data/lib/mongo/error/unsupported_option.rb +14 -12
- data/lib/mongo/grid/fs_bucket.rb +37 -37
- data/lib/mongo/index/view.rb +21 -11
- data/lib/mongo/lint.rb +2 -1
- data/lib/mongo/logger.rb +3 -3
- data/lib/mongo/monitoring.rb +13 -4
- data/lib/mongo/monitoring/event/server_heartbeat_failed.rb +27 -16
- data/lib/mongo/monitoring/event/server_heartbeat_succeeded.rb +26 -15
- data/lib/mongo/operation.rb +4 -2
- data/lib/mongo/operation/aggregate/result.rb +9 -8
- data/lib/mongo/operation/collections_info.rb +18 -1
- data/lib/mongo/operation/collections_info/command.rb +5 -0
- data/lib/mongo/operation/collections_info/result.rb +18 -1
- data/lib/mongo/operation/context.rb +99 -0
- data/lib/mongo/operation/delete/bulk_result.rb +2 -0
- data/lib/mongo/operation/delete/result.rb +3 -0
- data/lib/mongo/operation/explain/command.rb +4 -0
- data/lib/mongo/operation/explain/legacy.rb +4 -0
- data/lib/mongo/operation/explain/op_msg.rb +6 -0
- data/lib/mongo/operation/explain/result.rb +3 -0
- data/lib/mongo/operation/find/legacy/result.rb +2 -0
- data/lib/mongo/operation/find/result.rb +13 -0
- data/lib/mongo/operation/get_more/result.rb +3 -0
- data/lib/mongo/operation/indexes.rb +15 -1
- data/lib/mongo/operation/indexes/result.rb +5 -0
- data/lib/mongo/operation/insert/bulk_result.rb +5 -0
- data/lib/mongo/operation/insert/command.rb +2 -2
- data/lib/mongo/operation/insert/legacy.rb +2 -2
- data/lib/mongo/operation/insert/op_msg.rb +2 -2
- data/lib/mongo/operation/insert/result.rb +5 -0
- data/lib/mongo/operation/list_collections/result.rb +9 -1
- data/lib/mongo/operation/map_reduce/result.rb +10 -0
- data/lib/mongo/operation/parallel_scan/result.rb +4 -0
- data/lib/mongo/operation/result.rb +37 -6
- data/lib/mongo/operation/shared/bypass_document_validation.rb +1 -0
- data/lib/mongo/operation/shared/causal_consistency_supported.rb +1 -0
- data/lib/mongo/operation/shared/executable.rb +25 -14
- data/lib/mongo/operation/shared/executable_no_validate.rb +2 -2
- data/lib/mongo/operation/shared/idable.rb +2 -1
- data/lib/mongo/operation/shared/limited.rb +1 -0
- data/lib/mongo/operation/shared/object_id_generator.rb +1 -0
- data/lib/mongo/operation/shared/op_msg_or_command.rb +1 -7
- data/lib/mongo/operation/shared/op_msg_or_find_command.rb +1 -7
- data/lib/mongo/operation/shared/polymorphic_operation.rb +39 -0
- data/lib/mongo/operation/shared/response_handling.rb +23 -23
- data/lib/mongo/operation/shared/result/aggregatable.rb +1 -0
- data/lib/mongo/operation/shared/sessions_supported.rb +14 -2
- data/lib/mongo/operation/shared/specifiable.rb +1 -0
- data/lib/mongo/operation/shared/write.rb +9 -18
- data/lib/mongo/operation/shared/write_concern_supported.rb +1 -0
- data/lib/mongo/operation/update/legacy/result.rb +7 -0
- data/lib/mongo/operation/update/result.rb +8 -0
- data/lib/mongo/operation/users_info/result.rb +3 -0
- data/lib/mongo/protocol/compressed.rb +51 -5
- data/lib/mongo/protocol/message.rb +31 -4
- data/lib/mongo/protocol/msg.rb +37 -12
- data/lib/mongo/protocol/query.rb +36 -0
- data/lib/mongo/query_cache.rb +272 -0
- data/lib/mongo/retryable.rb +9 -2
- data/lib/mongo/server.rb +12 -16
- data/lib/mongo/server/app_metadata.rb +52 -18
- data/lib/mongo/server/connection.rb +5 -0
- data/lib/mongo/server/connection_base.rb +16 -15
- data/lib/mongo/server/connection_common.rb +2 -2
- data/lib/mongo/server/connection_pool.rb +9 -4
- data/lib/mongo/server/description.rb +12 -1
- data/lib/mongo/server/description/features.rb +9 -8
- data/lib/mongo/server/monitor.rb +21 -2
- data/lib/mongo/server/monitor/app_metadata.rb +1 -1
- data/lib/mongo/server/monitor/connection.rb +12 -13
- data/lib/mongo/server/pending_connection.rb +26 -8
- data/lib/mongo/server/push_monitor.rb +12 -2
- data/lib/mongo/server_selector/base.rb +5 -1
- data/lib/mongo/session.rb +7 -3
- data/lib/mongo/session/session_pool.rb +4 -2
- data/lib/mongo/socket.rb +35 -8
- data/lib/mongo/socket/ocsp_cache.rb +97 -0
- data/lib/mongo/socket/ocsp_verifier.rb +368 -0
- data/lib/mongo/socket/ssl.rb +53 -24
- data/lib/mongo/srv/monitor.rb +7 -24
- data/lib/mongo/srv/resolver.rb +14 -10
- data/lib/mongo/timeout.rb +2 -0
- data/lib/mongo/uri.rb +21 -390
- data/lib/mongo/uri/options_mapper.rb +620 -0
- data/lib/mongo/uri/srv_protocol.rb +3 -2
- data/lib/mongo/utils.rb +27 -1
- data/lib/mongo/version.rb +1 -1
- data/spec/NOTES.aws-auth.md +12 -7
- data/spec/README.md +87 -2
- data/spec/integration/auth_spec.rb +25 -15
- data/spec/integration/bson_symbol_spec.rb +4 -2
- data/spec/integration/bulk_write_error_message_spec.rb +41 -0
- data/spec/integration/bulk_write_spec.rb +48 -0
- data/spec/integration/change_stream_spec.rb +5 -5
- data/spec/integration/client_authentication_options_spec.rb +92 -28
- data/spec/integration/client_side_encryption/auto_encryption_bulk_writes_spec.rb +6 -2
- data/spec/integration/command_monitoring_spec.rb +2 -2
- data/spec/integration/connection_pool_populator_spec.rb +4 -2
- data/spec/integration/connection_spec.rb +2 -0
- data/spec/integration/cursor_reaping_spec.rb +54 -18
- data/spec/integration/docs_examples_spec.rb +8 -1
- data/spec/integration/fork_reconnect_spec.rb +60 -2
- data/spec/integration/ocsp_connectivity_spec.rb +26 -0
- data/spec/integration/ocsp_verifier_cache_spec.rb +188 -0
- data/spec/integration/ocsp_verifier_spec.rb +340 -0
- data/spec/integration/operation_failure_code_spec.rb +1 -1
- data/spec/integration/operation_failure_message_spec.rb +90 -0
- data/spec/integration/query_cache_spec.rb +1045 -0
- data/spec/integration/query_cache_transactions_spec.rb +190 -0
- data/spec/integration/reconnect_spec.rb +1 -1
- data/spec/integration/retryable_writes/retryable_writes_40_and_newer_spec.rb +1 -0
- data/spec/integration/retryable_writes/shared/performs_legacy_retries.rb +2 -0
- data/spec/integration/sdam_error_handling_spec.rb +86 -1
- data/spec/integration/sdam_events_spec.rb +8 -7
- data/spec/integration/server_selection_spec.rb +36 -0
- data/spec/integration/size_limit_spec.rb +20 -19
- data/spec/integration/snappy_compression_spec.rb +25 -0
- data/spec/integration/srv_monitoring_spec.rb +39 -4
- data/spec/integration/srv_spec.rb +56 -0
- data/spec/integration/transactions_examples_spec.rb +23 -7
- data/spec/integration/zlib_compression_spec.rb +1 -1
- data/spec/integration/zstd_compression_spec.rb +26 -0
- data/spec/lite_spec_helper.rb +15 -5
- data/spec/mongo/address_spec.rb +16 -12
- data/spec/mongo/auth/ldap/conversation_spec.rb +1 -1
- data/spec/mongo/auth/ldap_spec.rb +5 -1
- data/spec/mongo/auth/scram_negotiation_spec.rb +1 -1
- data/spec/mongo/auth/scram_spec.rb +1 -1
- data/spec/mongo/auth/user_spec.rb +1 -1
- data/spec/mongo/auth/x509/conversation_spec.rb +3 -3
- data/spec/mongo/bulk_write_spec.rb +2 -2
- data/spec/mongo/caching_cursor_spec.rb +70 -0
- data/spec/mongo/client_construction_spec.rb +273 -35
- data/spec/mongo/client_encryption_spec.rb +16 -10
- data/spec/mongo/client_spec.rb +64 -0
- data/spec/mongo/cluster/topology/replica_set_spec.rb +1 -1
- data/spec/mongo/cluster/topology/sharded_spec.rb +1 -1
- data/spec/mongo/cluster/topology/single_spec.rb +15 -6
- data/spec/mongo/cluster/topology/unknown_spec.rb +1 -1
- data/spec/mongo/cluster/topology_spec.rb +1 -1
- data/spec/mongo/cluster_spec.rb +6 -18
- data/spec/mongo/collection/view/change_stream_resume_spec.rb +1 -1
- data/spec/mongo/collection/view/explainable_spec.rb +87 -4
- data/spec/mongo/collection/view/map_reduce_spec.rb +2 -0
- data/spec/mongo/collection/view/readable_spec.rb +50 -0
- data/spec/mongo/collection_crud_spec.rb +4357 -0
- data/spec/mongo/collection_ddl_spec.rb +534 -0
- data/spec/mongo/collection_spec.rb +5 -4787
- data/spec/mongo/crypt/auto_decryption_context_spec.rb +1 -1
- data/spec/mongo/crypt/auto_encryption_context_spec.rb +1 -1
- data/spec/mongo/crypt/binary_spec.rb +1 -6
- data/spec/mongo/crypt/binding/binary_spec.rb +1 -6
- data/spec/mongo/crypt/binding/context_spec.rb +2 -7
- data/spec/mongo/crypt/binding/helpers_spec.rb +1 -6
- data/spec/mongo/crypt/binding/mongocrypt_spec.rb +2 -7
- data/spec/mongo/crypt/binding/status_spec.rb +1 -6
- data/spec/mongo/crypt/binding/version_spec.rb +1 -6
- data/spec/mongo/crypt/data_key_context_spec.rb +1 -1
- data/spec/mongo/crypt/explicit_decryption_context_spec.rb +1 -1
- data/spec/mongo/crypt/explicit_encryption_context_spec.rb +1 -1
- data/spec/mongo/crypt/status_spec.rb +1 -6
- data/spec/mongo/database_spec.rb +174 -4
- data/spec/mongo/error/bulk_write_error_spec.rb +3 -3
- data/spec/mongo/error/no_server_available_spec.rb +1 -1
- data/spec/mongo/error/parser_spec.rb +37 -6
- data/spec/mongo/index/view_spec.rb +8 -2
- data/spec/mongo/logger_spec.rb +13 -11
- data/spec/mongo/monitoring/event/server_closed_spec.rb +1 -1
- data/spec/mongo/monitoring/event/server_heartbeat_failed_spec.rb +1 -1
- data/spec/mongo/monitoring/event/server_heartbeat_succeeded_spec.rb +1 -1
- data/spec/mongo/monitoring/event/server_opening_spec.rb +1 -1
- data/spec/mongo/monitoring/event/topology_changed_spec.rb +1 -1
- data/spec/mongo/monitoring/event/topology_closed_spec.rb +1 -1
- data/spec/mongo/monitoring/event/topology_opening_spec.rb +1 -1
- data/spec/mongo/operation/aggregate_spec.rb +2 -1
- data/spec/mongo/operation/collections_info_spec.rb +4 -1
- data/spec/mongo/operation/command_spec.rb +6 -3
- data/spec/mongo/operation/create_index_spec.rb +6 -3
- data/spec/mongo/operation/create_user_spec.rb +6 -3
- data/spec/mongo/operation/delete/bulk_spec.rb +9 -6
- data/spec/mongo/operation/delete/op_msg_spec.rb +3 -3
- data/spec/mongo/operation/delete_spec.rb +11 -7
- data/spec/mongo/operation/drop_index_spec.rb +6 -2
- data/spec/mongo/operation/find/legacy_spec.rb +3 -1
- data/spec/mongo/operation/get_more_spec.rb +3 -1
- data/spec/mongo/operation/indexes_spec.rb +5 -1
- data/spec/mongo/operation/insert/bulk_spec.rb +10 -7
- data/spec/mongo/operation/insert/command_spec.rb +2 -2
- data/spec/mongo/operation/insert/op_msg_spec.rb +3 -3
- data/spec/mongo/operation/insert_spec.rb +15 -12
- data/spec/mongo/operation/map_reduce_spec.rb +5 -2
- data/spec/mongo/operation/read_preference_op_msg_spec.rb +1 -1
- data/spec/mongo/operation/remove_user_spec.rb +6 -3
- data/spec/mongo/operation/result_spec.rb +1 -1
- data/spec/mongo/operation/update/bulk_spec.rb +9 -6
- data/spec/mongo/operation/update/command_spec.rb +2 -2
- data/spec/mongo/operation/update/op_msg_spec.rb +3 -3
- data/spec/mongo/operation/update_spec.rb +10 -7
- data/spec/mongo/operation/update_user_spec.rb +4 -1
- data/spec/mongo/protocol/compressed_spec.rb +26 -12
- data/spec/mongo/query_cache_middleware_spec.rb +55 -0
- data/spec/mongo/query_cache_spec.rb +280 -0
- data/spec/mongo/retryable_spec.rb +3 -2
- data/spec/mongo/server/app_metadata_shared.rb +2 -2
- data/spec/mongo/server/app_metadata_spec.rb +2 -0
- data/spec/mongo/server/connection_pool/populator_spec.rb +3 -1
- data/spec/mongo/server/connection_pool_spec.rb +8 -4
- data/spec/mongo/server/connection_spec.rb +39 -25
- data/spec/mongo/server/description_spec.rb +18 -0
- data/spec/mongo/server/monitor/connection_spec.rb +17 -7
- data/spec/mongo/server/monitor_spec.rb +9 -1
- data/spec/mongo/server_selector_spec.rb +2 -2
- data/spec/mongo/server_spec.rb +15 -2
- data/spec/mongo/socket/ssl_spec.rb +44 -4
- data/spec/mongo/socket_spec.rb +2 -2
- data/spec/mongo/tls_context_hooks_spec.rb +37 -0
- data/spec/mongo/uri/srv_protocol_spec.rb +64 -33
- data/spec/mongo/uri_option_parsing_spec.rb +11 -11
- data/spec/mongo/uri_spec.rb +68 -41
- data/spec/mongo/utils_spec.rb +39 -0
- data/spec/runners/auth.rb +3 -0
- data/spec/runners/change_streams/test.rb +1 -1
- data/spec/runners/connection_string.rb +31 -124
- data/spec/runners/crud/requirement.rb +40 -3
- data/spec/runners/crud/test_base.rb +0 -19
- data/spec/runners/crud/verifier.rb +8 -0
- data/spec/runners/server_selection.rb +1 -1
- data/spec/runners/transactions/operation.rb +13 -2
- data/spec/runners/transactions/test.rb +3 -2
- data/spec/runners/unified.rb +96 -0
- data/spec/runners/unified/assertions.rb +249 -0
- data/spec/runners/unified/change_stream_operations.rb +26 -0
- data/spec/runners/unified/crud_operations.rb +199 -0
- data/spec/runners/unified/ddl_operations.rb +96 -0
- data/spec/runners/unified/entity_map.rb +39 -0
- data/spec/runners/unified/error.rb +25 -0
- data/spec/runners/unified/event_subscriber.rb +91 -0
- data/spec/runners/unified/exceptions.rb +21 -0
- data/spec/runners/unified/grid_fs_operations.rb +55 -0
- data/spec/runners/unified/support_operations.rb +250 -0
- data/spec/runners/unified/test.rb +393 -0
- data/spec/runners/unified/test_group.rb +28 -0
- data/spec/runners/unified/using_hash.rb +31 -0
- data/spec/shared/LICENSE +20 -0
- data/spec/shared/bin/get-mongodb-download-url +17 -0
- data/spec/shared/lib/mrss/child_process_helper.rb +80 -0
- data/spec/shared/lib/mrss/cluster_config.rb +218 -0
- data/spec/shared/lib/mrss/constraints.rb +346 -0
- data/spec/shared/lib/mrss/docker_runner.rb +262 -0
- data/spec/shared/lib/mrss/lite_constraints.rb +175 -0
- data/spec/shared/lib/mrss/server_version_registry.rb +112 -0
- data/spec/shared/lib/mrss/spec_organizer.rb +149 -0
- data/spec/shared/lib/mrss/utils.rb +15 -0
- data/spec/shared/share/Dockerfile.erb +231 -0
- data/spec/shared/shlib/distro.sh +73 -0
- data/spec/shared/shlib/server.sh +290 -0
- data/spec/shared/shlib/set_env.sh +128 -0
- data/spec/solo/clean_exit_spec.rb +21 -0
- data/spec/spec_helper.rb +7 -2
- data/spec/spec_tests/cmap_spec.rb +7 -3
- data/spec/spec_tests/crud_unified_spec.rb +10 -0
- data/spec/spec_tests/data/change_streams/change-streams-errors.yml +0 -1
- data/spec/spec_tests/data/change_streams/change-streams.yml +0 -2
- data/spec/spec_tests/data/cmap/pool-checkout-connection.yml +6 -2
- data/spec/spec_tests/data/cmap/pool-create-min-size.yml +3 -0
- data/spec/spec_tests/data/connection_string/valid-warnings.yml +24 -0
- data/spec/spec_tests/data/crud_unified/estimatedDocumentCount.yml +267 -0
- data/spec/spec_tests/data/retryable_reads/estimatedDocumentCount-4.9.yml +60 -0
- data/spec/spec_tests/data/retryable_reads/{estimatedDocumentCount.yml → estimatedDocumentCount-pre4.9.yml} +2 -0
- data/spec/spec_tests/data/retryable_reads/estimatedDocumentCount-serverErrors-4.9.yml +146 -0
- data/spec/spec_tests/data/retryable_reads/{estimatedDocumentCount-serverErrors.yml → estimatedDocumentCount-serverErrors-pre4.9.yml} +2 -0
- data/spec/spec_tests/data/retryable_reads/listIndexNames.yml +1 -1
- data/spec/spec_tests/data/sdam_monitoring/discovered_standalone.yml +1 -3
- data/spec/spec_tests/data/sdam_monitoring/standalone.yml +2 -2
- data/spec/spec_tests/data/sdam_monitoring/standalone_repeated.yml +2 -2
- data/spec/spec_tests/data/sdam_monitoring/standalone_suppress_equal_description_changes.yml +2 -2
- data/spec/spec_tests/data/sdam_monitoring/standalone_to_rs_with_me_mismatch.yml +2 -2
- data/spec/spec_tests/data/unified/valid-fail/operation-failure.yml +31 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-change-streams.yml +220 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-command-monitoring.yml +102 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-crud.yml +184 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-gridfs.yml +155 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-retryable-reads.yml +193 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-retryable-writes.yml +210 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-sessions.yml +215 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml +235 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-mongos-pin-auto.yml +169 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions.yml +170 -0
- data/spec/spec_tests/data/uri_options/auth-options.yml +25 -0
- data/spec/spec_tests/data/uri_options/compression-options.yml +7 -4
- data/spec/spec_tests/data/uri_options/read-preference-options.yml +24 -0
- data/spec/spec_tests/data/uri_options/ruby-connection-options.yml +1 -0
- data/spec/spec_tests/data/uri_options/tls-options.yml +160 -4
- data/spec/spec_tests/data/versioned_api/crud-api-version-1-strict.yml +416 -0
- data/spec/spec_tests/data/versioned_api/crud-api-version-1.yml +409 -0
- data/spec/spec_tests/data/versioned_api/runcommand-helper-no-api-version-declared.yml +67 -0
- data/spec/spec_tests/data/versioned_api/test-commands-deprecation-errors.yml +47 -0
- data/spec/spec_tests/data/versioned_api/test-commands-strict-mode.yml +44 -0
- data/spec/spec_tests/data/versioned_api/transaction-handling.yml +180 -0
- data/spec/spec_tests/dns_seedlist_discovery_spec.rb +9 -1
- data/spec/spec_tests/unified_spec.rb +15 -0
- data/spec/spec_tests/uri_options_spec.rb +47 -33
- data/spec/spec_tests/versioned_api_spec.rb +10 -0
- data/spec/stress/fork_reconnect_stress_spec.rb +1 -1
- data/spec/support/certificates/atlas-ocsp-ca.crt +28 -0
- data/spec/support/certificates/atlas-ocsp.crt +41 -0
- data/spec/support/client_registry_macros.rb +11 -2
- data/spec/support/common_shortcuts.rb +59 -0
- data/spec/support/constraints.rb +6 -253
- data/spec/support/matchers.rb +16 -0
- data/spec/support/ocsp +1 -0
- data/spec/support/session_registry.rb +52 -0
- data/spec/support/shared/session.rb +2 -2
- data/spec/support/spec_config.rb +68 -3
- data/spec/support/spec_setup.rb +48 -38
- data/spec/support/utils.rb +102 -4
- metadata +1087 -936
- metadata.gz.sig +0 -0
- data/lib/mongo/operation/shared/collections_info_or_list_collections.rb +0 -56
- data/lib/mongo/operation/shared/op_msg_or_list_indexes_command.rb +0 -47
- data/spec/support/child_process_helper.rb +0 -78
- data/spec/support/cluster_config.rb +0 -207
- data/spec/support/lite_constraints.rb +0 -141
- data/spec/support/spec_organizer.rb +0 -129
@@ -0,0 +1,210 @@
|
|
1
|
+
description: "poc-retryable-writes"
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
runOnRequirements:
|
6
|
+
- minServerVersion: "3.6"
|
7
|
+
topologies: [ replicaset ]
|
8
|
+
|
9
|
+
createEntities:
|
10
|
+
- client:
|
11
|
+
id: &client0 client0
|
12
|
+
useMultipleMongoses: false
|
13
|
+
observeEvents: [ commandStartedEvent ]
|
14
|
+
- client:
|
15
|
+
id: &client1 client1
|
16
|
+
uriOptions: { retryWrites: false }
|
17
|
+
useMultipleMongoses: false
|
18
|
+
observeEvents: [ commandStartedEvent ]
|
19
|
+
- database:
|
20
|
+
id: &database0 database0
|
21
|
+
client: *client0
|
22
|
+
databaseName: &databaseName retryable-writes-tests
|
23
|
+
- database:
|
24
|
+
id: &database1 database1
|
25
|
+
client: *client1
|
26
|
+
databaseName: *databaseName
|
27
|
+
- collection:
|
28
|
+
id: &collection0 collection0
|
29
|
+
database: *database0
|
30
|
+
collectionName: &collectionName coll
|
31
|
+
- collection:
|
32
|
+
id: &collection1 collection1
|
33
|
+
database: *database1
|
34
|
+
collectionName: *collectionName
|
35
|
+
|
36
|
+
initialData:
|
37
|
+
- collectionName: *collectionName
|
38
|
+
databaseName: *databaseName
|
39
|
+
documents:
|
40
|
+
- { _id: 1, x: 11 }
|
41
|
+
- { _id: 2, x: 22 }
|
42
|
+
|
43
|
+
tests:
|
44
|
+
- description: "FindOneAndUpdate is committed on first attempt"
|
45
|
+
operations:
|
46
|
+
- name: failPoint
|
47
|
+
object: testRunner
|
48
|
+
arguments:
|
49
|
+
client: *client0
|
50
|
+
failPoint:
|
51
|
+
configureFailPoint: onPrimaryTransactionalWrite
|
52
|
+
mode: { times: 1 }
|
53
|
+
- name: findOneAndUpdate
|
54
|
+
object: *collection0
|
55
|
+
arguments:
|
56
|
+
filter: { _id: 1 }
|
57
|
+
update: { $inc: { x : 1 } }
|
58
|
+
returnDocument: Before
|
59
|
+
expectResult: { _id: 1, x: 11 }
|
60
|
+
outcome:
|
61
|
+
- collectionName: *collectionName
|
62
|
+
databaseName: *databaseName
|
63
|
+
documents:
|
64
|
+
- { _id: 1, x: 12 }
|
65
|
+
- { _id: 2, x: 22 }
|
66
|
+
|
67
|
+
- description: "FindOneAndUpdate is not committed on first attempt"
|
68
|
+
operations:
|
69
|
+
- name: failPoint
|
70
|
+
object: testRunner
|
71
|
+
arguments:
|
72
|
+
client: *client0
|
73
|
+
failPoint:
|
74
|
+
configureFailPoint: onPrimaryTransactionalWrite
|
75
|
+
mode: { times: 1 }
|
76
|
+
data: { failBeforeCommitExceptionCode: 1 }
|
77
|
+
- name: findOneAndUpdate
|
78
|
+
object: *collection0
|
79
|
+
arguments:
|
80
|
+
filter: { _id: 1 }
|
81
|
+
update: { $inc: { x : 1 } }
|
82
|
+
returnDocument: Before
|
83
|
+
expectResult: { _id: 1, x: 11 }
|
84
|
+
outcome:
|
85
|
+
- collectionName: *collectionName
|
86
|
+
databaseName: *databaseName
|
87
|
+
documents:
|
88
|
+
- { _id: 1, x: 12 }
|
89
|
+
- { _id: 2, x: 22 }
|
90
|
+
|
91
|
+
- description: "FindOneAndUpdate is never committed"
|
92
|
+
operations:
|
93
|
+
- name: failPoint
|
94
|
+
object: testRunner
|
95
|
+
arguments:
|
96
|
+
client: *client0
|
97
|
+
failPoint:
|
98
|
+
configureFailPoint: onPrimaryTransactionalWrite
|
99
|
+
mode: { times: 2 }
|
100
|
+
data: { failBeforeCommitExceptionCode: 1 }
|
101
|
+
- name: findOneAndUpdate
|
102
|
+
object: *collection0
|
103
|
+
arguments:
|
104
|
+
filter: { _id: 1 }
|
105
|
+
update: { $inc: { x : 1 } }
|
106
|
+
returnDocument: Before
|
107
|
+
expectError: { isError: true }
|
108
|
+
outcome:
|
109
|
+
- collectionName: *collectionName
|
110
|
+
databaseName: *databaseName
|
111
|
+
documents:
|
112
|
+
- { _id: 1, x: 11 }
|
113
|
+
- { _id: 2, x: 22 }
|
114
|
+
|
115
|
+
- description: "InsertMany succeeds after PrimarySteppedDown"
|
116
|
+
runOnRequirements: &failCommand_requirements
|
117
|
+
- minServerVersion: "4.0"
|
118
|
+
topologies: [ replicaset ]
|
119
|
+
- minServerVersion: "4.1.7"
|
120
|
+
# Original test uses "sharded", but retryable writes requires a sharded
|
121
|
+
# cluster backed by replica sets
|
122
|
+
topologies: [ sharded-replicaset ]
|
123
|
+
operations:
|
124
|
+
- name: failPoint
|
125
|
+
object: testRunner
|
126
|
+
arguments:
|
127
|
+
client: *client0
|
128
|
+
failPoint:
|
129
|
+
configureFailPoint: failCommand
|
130
|
+
mode: { times: 1 }
|
131
|
+
data:
|
132
|
+
failCommands: [ insert ]
|
133
|
+
errorCode: 189 # PrimarySteppedDown
|
134
|
+
errorLabels: [ RetryableWriteError ]
|
135
|
+
- name: insertMany
|
136
|
+
object: *collection0
|
137
|
+
arguments:
|
138
|
+
documents:
|
139
|
+
# Documents are modified from original test for "initialData"
|
140
|
+
- { _id: 3, x: 33 }
|
141
|
+
- { _id: 4, x: 44 }
|
142
|
+
ordered: true
|
143
|
+
expectResult:
|
144
|
+
insertedCount: { $$unsetOrMatches: 2 }
|
145
|
+
insertedIds: { $$unsetOrMatches: { 0: 3, 1: 4 } }
|
146
|
+
outcome:
|
147
|
+
- collectionName: *collectionName
|
148
|
+
databaseName: *databaseName
|
149
|
+
documents:
|
150
|
+
- { _id: 1, x: 11 }
|
151
|
+
- { _id: 2, x: 22 }
|
152
|
+
- { _id: 3, x: 33 }
|
153
|
+
- { _id: 4, x: 44 }
|
154
|
+
|
155
|
+
- description: "InsertOne fails after connection failure when retryWrites option is false"
|
156
|
+
runOnRequirements: *failCommand_requirements
|
157
|
+
operations:
|
158
|
+
- name: failPoint
|
159
|
+
object: testRunner
|
160
|
+
arguments:
|
161
|
+
client: *client1
|
162
|
+
failPoint:
|
163
|
+
configureFailPoint: failCommand
|
164
|
+
mode: { times: 1 }
|
165
|
+
data:
|
166
|
+
failCommands: [ insert ]
|
167
|
+
closeConnection: true
|
168
|
+
- name: insertOne
|
169
|
+
object: *collection1
|
170
|
+
arguments:
|
171
|
+
document: { _id: 3, x: 33 }
|
172
|
+
expectError:
|
173
|
+
# If retryWrites is false, the driver should not add the
|
174
|
+
# RetryableWriteError label to the error.
|
175
|
+
errorLabelsOmit: [ RetryableWriteError ]
|
176
|
+
outcome:
|
177
|
+
- collectionName: *collectionName
|
178
|
+
databaseName: *databaseName
|
179
|
+
documents:
|
180
|
+
- { _id: 1, x: 11 }
|
181
|
+
- { _id: 2, x: 22 }
|
182
|
+
|
183
|
+
- description: "InsertOne fails after multiple retryable writeConcernErrors"
|
184
|
+
runOnRequirements: *failCommand_requirements
|
185
|
+
operations:
|
186
|
+
- name: failPoint
|
187
|
+
object: testRunner
|
188
|
+
arguments:
|
189
|
+
client: *client0
|
190
|
+
failPoint:
|
191
|
+
configureFailPoint: failCommand
|
192
|
+
mode: { times: 2 }
|
193
|
+
data:
|
194
|
+
failCommands: [ insert ]
|
195
|
+
writeConcernError:
|
196
|
+
code: 91 # ShutdownInProgress
|
197
|
+
errmsg: "Replication is being shut down"
|
198
|
+
- name: insertOne
|
199
|
+
object: *collection0
|
200
|
+
arguments:
|
201
|
+
document: { _id: 3, x: 33 }
|
202
|
+
expectError:
|
203
|
+
errorLabelsContain: [ RetryableWriteError ]
|
204
|
+
outcome:
|
205
|
+
- collectionName: *collectionName
|
206
|
+
databaseName: *databaseName
|
207
|
+
documents:
|
208
|
+
- { _id: 1, x: 11 }
|
209
|
+
- { _id: 2, x: 22 }
|
210
|
+
- { _id: 3, x: 33 } # The write was still applied
|
@@ -0,0 +1,215 @@
|
|
1
|
+
description: "poc-sessions"
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
runOnRequirements:
|
6
|
+
- minServerVersion: "3.6.0"
|
7
|
+
|
8
|
+
createEntities:
|
9
|
+
- client:
|
10
|
+
id: &client0 client0
|
11
|
+
useMultipleMongoses: false
|
12
|
+
observeEvents: [ commandStartedEvent ]
|
13
|
+
- database:
|
14
|
+
id: &database0 database0
|
15
|
+
client: *client0
|
16
|
+
databaseName: &database0Name session-tests
|
17
|
+
- collection:
|
18
|
+
id: &collection0 collection0
|
19
|
+
database: *database0
|
20
|
+
collectionName: &collection0Name test
|
21
|
+
- session:
|
22
|
+
id: &session0 session0
|
23
|
+
client: *client0
|
24
|
+
|
25
|
+
initialData:
|
26
|
+
- collectionName: *collection0Name
|
27
|
+
databaseName: *database0Name
|
28
|
+
documents:
|
29
|
+
- { _id: 1 }
|
30
|
+
|
31
|
+
tests:
|
32
|
+
- description: "Server supports explicit sessions"
|
33
|
+
operations:
|
34
|
+
- name: assertSessionNotDirty
|
35
|
+
object: testRunner
|
36
|
+
arguments:
|
37
|
+
session: *session0
|
38
|
+
- name: insertOne
|
39
|
+
object: *collection0
|
40
|
+
arguments:
|
41
|
+
session: *session0
|
42
|
+
document: { _id: 2 }
|
43
|
+
expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 2 } } }
|
44
|
+
- name: assertSessionNotDirty
|
45
|
+
object: testRunner
|
46
|
+
arguments:
|
47
|
+
session: *session0
|
48
|
+
- name: endSession
|
49
|
+
object: *session0
|
50
|
+
- &find_with_implicit_session
|
51
|
+
name: find
|
52
|
+
object: *collection0
|
53
|
+
arguments:
|
54
|
+
filter: { _id: -1 }
|
55
|
+
expectResult: []
|
56
|
+
- name: assertSameLsidOnLastTwoCommands
|
57
|
+
object: testRunner
|
58
|
+
arguments:
|
59
|
+
client: *client0
|
60
|
+
expectEvents:
|
61
|
+
- client: *client0
|
62
|
+
events:
|
63
|
+
- commandStartedEvent:
|
64
|
+
command:
|
65
|
+
insert: *collection0Name
|
66
|
+
documents: [ { _id: 2 } ]
|
67
|
+
ordered: true
|
68
|
+
lsid: { $$sessionLsid: *session0 }
|
69
|
+
commandName: insert
|
70
|
+
databaseName: *database0Name
|
71
|
+
- commandStartedEvent:
|
72
|
+
command:
|
73
|
+
find: *collection0Name
|
74
|
+
filter: { _id: -1 }
|
75
|
+
lsid: { $$sessionLsid: *session0 }
|
76
|
+
commandName: find
|
77
|
+
databaseName: *database0Name
|
78
|
+
outcome:
|
79
|
+
- collectionName: *collection0Name
|
80
|
+
databaseName: *database0Name
|
81
|
+
documents:
|
82
|
+
- { _id: 1 }
|
83
|
+
- { _id: 2 }
|
84
|
+
|
85
|
+
- description: "Server supports implicit sessions"
|
86
|
+
operations:
|
87
|
+
- name: insertOne
|
88
|
+
object: *collection0
|
89
|
+
arguments:
|
90
|
+
document: { _id: 2 }
|
91
|
+
expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 2 } } }
|
92
|
+
- *find_with_implicit_session
|
93
|
+
- name: assertSameLsidOnLastTwoCommands
|
94
|
+
object: testRunner
|
95
|
+
arguments:
|
96
|
+
client: *client0
|
97
|
+
expectEvents:
|
98
|
+
- client: *client0
|
99
|
+
events:
|
100
|
+
- commandStartedEvent:
|
101
|
+
command:
|
102
|
+
insert: *collection0Name
|
103
|
+
documents:
|
104
|
+
- { _id: 2 }
|
105
|
+
ordered: true
|
106
|
+
# Original test did not include any assertion, but we can use
|
107
|
+
# $$type to expect an arbitrary lsid document
|
108
|
+
lsid: { $$type: object }
|
109
|
+
commandName: insert
|
110
|
+
databaseName: *database0Name
|
111
|
+
- commandStartedEvent:
|
112
|
+
command:
|
113
|
+
find: *collection0Name
|
114
|
+
filter: { _id: -1 }
|
115
|
+
lsid: { $$type: object }
|
116
|
+
commandName: find
|
117
|
+
databaseName: *database0Name
|
118
|
+
outcome:
|
119
|
+
- collectionName: *collection0Name
|
120
|
+
databaseName: *database0Name
|
121
|
+
documents:
|
122
|
+
- { _id: 1 }
|
123
|
+
- { _id: 2 }
|
124
|
+
|
125
|
+
- description: "Dirty explicit session is discarded"
|
126
|
+
skipReason: RUBY-1813
|
127
|
+
# Original test specified retryWrites=true, but that is now the default.
|
128
|
+
# Retryable writes will require a sharded-replicaset, though.
|
129
|
+
runOnRequirements:
|
130
|
+
- minServerVersion: "4.0"
|
131
|
+
topologies: [ replicaset ]
|
132
|
+
- minServerVersion: "4.1.8"
|
133
|
+
topologies: [ sharded-replicaset ]
|
134
|
+
operations:
|
135
|
+
- name: failPoint
|
136
|
+
object: testRunner
|
137
|
+
arguments:
|
138
|
+
client: *client0
|
139
|
+
failPoint:
|
140
|
+
configureFailPoint: failCommand
|
141
|
+
mode: { times: 1 }
|
142
|
+
data:
|
143
|
+
failCommands: [ insert ]
|
144
|
+
closeConnection: true
|
145
|
+
- name: assertSessionNotDirty
|
146
|
+
object: testRunner
|
147
|
+
arguments:
|
148
|
+
session: *session0
|
149
|
+
- name: insertOne
|
150
|
+
object: *collection0
|
151
|
+
arguments:
|
152
|
+
session: *session0
|
153
|
+
document: { _id: 2 }
|
154
|
+
expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 2 } } }
|
155
|
+
- name: assertSessionDirty
|
156
|
+
object: testRunner
|
157
|
+
arguments:
|
158
|
+
session: *session0
|
159
|
+
- name: insertOne
|
160
|
+
object: *collection0
|
161
|
+
arguments:
|
162
|
+
session: *session0
|
163
|
+
document: { _id: 3 }
|
164
|
+
expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } }
|
165
|
+
- name: assertSessionDirty
|
166
|
+
object: testRunner
|
167
|
+
arguments:
|
168
|
+
session: *session0
|
169
|
+
- name: endSession
|
170
|
+
object: *session0
|
171
|
+
- *find_with_implicit_session
|
172
|
+
- name: assertDifferentLsidOnLastTwoCommands
|
173
|
+
object: testRunner
|
174
|
+
arguments:
|
175
|
+
client: *client0
|
176
|
+
expectEvents:
|
177
|
+
- client: *client0
|
178
|
+
events:
|
179
|
+
# ajv's YAML parser is unable to handle anchors on array elements, so
|
180
|
+
# we define an anchor on the commandStartedEvent object instead
|
181
|
+
- commandStartedEvent: &insert_attempt
|
182
|
+
command:
|
183
|
+
insert: *collection0Name
|
184
|
+
documents:
|
185
|
+
- { _id: 2 }
|
186
|
+
ordered: true
|
187
|
+
lsid: { $$sessionLsid: *session0 }
|
188
|
+
txnNumber: 1
|
189
|
+
commandName: insert
|
190
|
+
databaseName: *database0Name
|
191
|
+
- commandStartedEvent: *insert_attempt
|
192
|
+
- commandStartedEvent:
|
193
|
+
command:
|
194
|
+
insert: *collection0Name
|
195
|
+
documents:
|
196
|
+
- { _id: 3 }
|
197
|
+
ordered: true
|
198
|
+
lsid: { $$sessionLsid: *session0 }
|
199
|
+
txnNumber: 2
|
200
|
+
commandName: insert
|
201
|
+
databaseName: *database0Name
|
202
|
+
- commandStartedEvent:
|
203
|
+
command:
|
204
|
+
find: *collection0Name
|
205
|
+
filter: { _id: -1 }
|
206
|
+
lsid: { $$type: object }
|
207
|
+
commandName: find
|
208
|
+
databaseName: *database0Name
|
209
|
+
outcome:
|
210
|
+
- collectionName: *collection0Name
|
211
|
+
databaseName: *database0Name
|
212
|
+
documents:
|
213
|
+
- { _id: 1 }
|
214
|
+
- { _id: 2 }
|
215
|
+
- { _id: 3 }
|
@@ -0,0 +1,235 @@
|
|
1
|
+
description: "poc-transactions-convenient-api"
|
2
|
+
|
3
|
+
schemaVersion: "1.0"
|
4
|
+
|
5
|
+
runOnRequirements:
|
6
|
+
- minServerVersion: "4.0"
|
7
|
+
topologies: [ replicaset ]
|
8
|
+
- minServerVersion: "4.1.8"
|
9
|
+
topologies: [ sharded-replicaset ]
|
10
|
+
|
11
|
+
createEntities:
|
12
|
+
- client:
|
13
|
+
id: &client0 client0
|
14
|
+
useMultipleMongoses: true
|
15
|
+
observeEvents: [ commandStartedEvent ]
|
16
|
+
- client:
|
17
|
+
id: &client1 client1
|
18
|
+
uriOptions:
|
19
|
+
readConcernLevel: local
|
20
|
+
w: 1
|
21
|
+
useMultipleMongoses: true
|
22
|
+
observeEvents: [ commandStartedEvent ]
|
23
|
+
- database:
|
24
|
+
id: &database0 database0
|
25
|
+
client: *client0
|
26
|
+
databaseName: &databaseName transaction-tests
|
27
|
+
- database:
|
28
|
+
id: &database1 database1
|
29
|
+
client: *client1
|
30
|
+
databaseName: *databaseName
|
31
|
+
- collection:
|
32
|
+
id: &collection0 collection0
|
33
|
+
database: *database0
|
34
|
+
collectionName: &collectionName test
|
35
|
+
- collection:
|
36
|
+
id: &collection1 collection1
|
37
|
+
database: *database1
|
38
|
+
collectionName: *collectionName
|
39
|
+
- session:
|
40
|
+
id: &session0 session0
|
41
|
+
client: *client0
|
42
|
+
- session:
|
43
|
+
id: &session1 session1
|
44
|
+
client: *client1
|
45
|
+
- session:
|
46
|
+
id: &session2 session2
|
47
|
+
client: *client0
|
48
|
+
sessionOptions:
|
49
|
+
defaultTransactionOptions:
|
50
|
+
readConcern: { level: majority }
|
51
|
+
writeConcern: { w: 1 }
|
52
|
+
|
53
|
+
initialData:
|
54
|
+
- collectionName: *collectionName
|
55
|
+
databaseName: *databaseName
|
56
|
+
documents: []
|
57
|
+
|
58
|
+
tests:
|
59
|
+
- description: "withTransaction and no transaction options set"
|
60
|
+
operations:
|
61
|
+
- name: withTransaction
|
62
|
+
object: *session0
|
63
|
+
arguments:
|
64
|
+
callback:
|
65
|
+
- name: insertOne
|
66
|
+
object: *collection0
|
67
|
+
arguments:
|
68
|
+
session: *session0
|
69
|
+
document: { _id: 1 }
|
70
|
+
expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } }
|
71
|
+
expectEvents:
|
72
|
+
- client: *client0
|
73
|
+
events:
|
74
|
+
- commandStartedEvent:
|
75
|
+
command:
|
76
|
+
insert: *collectionName
|
77
|
+
documents: [ { _id: 1 } ]
|
78
|
+
ordered: true
|
79
|
+
lsid: { $$sessionLsid: *session0 }
|
80
|
+
txnNumber: 1
|
81
|
+
startTransaction: true
|
82
|
+
autocommit: false
|
83
|
+
# omitted fields
|
84
|
+
readConcern: { $$exists: false }
|
85
|
+
writeConcern: { $$exists: false }
|
86
|
+
commandName: insert
|
87
|
+
databaseName: *databaseName
|
88
|
+
- commandStartedEvent:
|
89
|
+
command:
|
90
|
+
commitTransaction: 1
|
91
|
+
lsid: { $$sessionLsid: *session0 }
|
92
|
+
txnNumber: 1
|
93
|
+
autocommit: false
|
94
|
+
# omitted fields
|
95
|
+
readConcern: { $$exists: false }
|
96
|
+
startTransaction: { $$exists: false }
|
97
|
+
writeConcern: { $$exists: false }
|
98
|
+
commandName: commitTransaction
|
99
|
+
databaseName: admin
|
100
|
+
outcome: &outcome
|
101
|
+
- collectionName: *collectionName
|
102
|
+
databaseName: *databaseName
|
103
|
+
documents:
|
104
|
+
- { _id: 1 }
|
105
|
+
|
106
|
+
- description: "withTransaction inherits transaction options from client"
|
107
|
+
operations:
|
108
|
+
- name: withTransaction
|
109
|
+
object: *session1
|
110
|
+
arguments:
|
111
|
+
callback:
|
112
|
+
- name: insertOne
|
113
|
+
object: *collection1
|
114
|
+
arguments:
|
115
|
+
session: *session1
|
116
|
+
document: { _id: 1 }
|
117
|
+
expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } }
|
118
|
+
expectEvents:
|
119
|
+
- client: *client1
|
120
|
+
events:
|
121
|
+
- commandStartedEvent:
|
122
|
+
command:
|
123
|
+
insert: *collectionName
|
124
|
+
documents: [ { _id: 1 } ]
|
125
|
+
ordered: true
|
126
|
+
lsid: { $$sessionLsid: *session1 }
|
127
|
+
txnNumber: 1
|
128
|
+
startTransaction: true
|
129
|
+
autocommit: false
|
130
|
+
readConcern: { level: local }
|
131
|
+
# omitted fields
|
132
|
+
writeConcern: { $$exists: false }
|
133
|
+
commandName: insert
|
134
|
+
databaseName: *databaseName
|
135
|
+
- commandStartedEvent:
|
136
|
+
command:
|
137
|
+
commitTransaction: 1
|
138
|
+
lsid: { $$sessionLsid: *session1 }
|
139
|
+
txnNumber: 1
|
140
|
+
autocommit: false
|
141
|
+
writeConcern: { w: 1 }
|
142
|
+
# omitted fields
|
143
|
+
readConcern: { $$exists: false }
|
144
|
+
startTransaction: { $$exists: false }
|
145
|
+
commandName: commitTransaction
|
146
|
+
databaseName: admin
|
147
|
+
outcome: *outcome
|
148
|
+
|
149
|
+
- description: "withTransaction inherits transaction options from defaultTransactionOptions"
|
150
|
+
operations:
|
151
|
+
- name: withTransaction
|
152
|
+
object: *session2
|
153
|
+
arguments:
|
154
|
+
callback:
|
155
|
+
- name: insertOne
|
156
|
+
object: *collection0
|
157
|
+
arguments:
|
158
|
+
session: *session2
|
159
|
+
document: { _id: 1 }
|
160
|
+
expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } }
|
161
|
+
expectEvents:
|
162
|
+
- client: *client0
|
163
|
+
events:
|
164
|
+
- commandStartedEvent:
|
165
|
+
command:
|
166
|
+
insert: *collectionName
|
167
|
+
documents: [ { _id: 1 } ]
|
168
|
+
ordered: true
|
169
|
+
lsid: { $$sessionLsid: *session2 }
|
170
|
+
txnNumber: 1
|
171
|
+
startTransaction: true
|
172
|
+
autocommit: false
|
173
|
+
readConcern: { level: majority }
|
174
|
+
# omitted fields
|
175
|
+
writeConcern: { $$exists: false }
|
176
|
+
commandName: insert
|
177
|
+
databaseName: *databaseName
|
178
|
+
- commandStartedEvent:
|
179
|
+
command:
|
180
|
+
commitTransaction: 1
|
181
|
+
lsid: { $$sessionLsid: *session2 }
|
182
|
+
txnNumber: 1
|
183
|
+
autocommit: false
|
184
|
+
writeConcern: { w: 1 }
|
185
|
+
# omitted fields
|
186
|
+
readConcern: { $$exists: false }
|
187
|
+
startTransaction: { $$exists: false }
|
188
|
+
commandName: commitTransaction
|
189
|
+
databaseName: admin
|
190
|
+
outcome: *outcome
|
191
|
+
|
192
|
+
- description: "withTransaction explicit transaction options"
|
193
|
+
operations:
|
194
|
+
- name: withTransaction
|
195
|
+
object: *session0
|
196
|
+
arguments:
|
197
|
+
callback:
|
198
|
+
- name: insertOne
|
199
|
+
object: *collection0
|
200
|
+
arguments:
|
201
|
+
session: *session0
|
202
|
+
document: { _id: 1 }
|
203
|
+
expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } }
|
204
|
+
readConcern: { level: majority }
|
205
|
+
writeConcern: { w: 1 }
|
206
|
+
expectEvents:
|
207
|
+
- client: *client0
|
208
|
+
events:
|
209
|
+
- commandStartedEvent:
|
210
|
+
command:
|
211
|
+
insert: *collectionName
|
212
|
+
documents: [ { _id: 1 } ]
|
213
|
+
ordered: true
|
214
|
+
lsid: { $$sessionLsid: *session0 }
|
215
|
+
txnNumber: 1
|
216
|
+
startTransaction: true
|
217
|
+
autocommit: false
|
218
|
+
readConcern: { level: majority }
|
219
|
+
# omitted fields
|
220
|
+
writeConcern: { $$exists: false }
|
221
|
+
commandName: insert
|
222
|
+
databaseName: *databaseName
|
223
|
+
- commandStartedEvent:
|
224
|
+
command:
|
225
|
+
commitTransaction: 1
|
226
|
+
lsid: { $$sessionLsid: *session0 }
|
227
|
+
txnNumber: 1
|
228
|
+
autocommit: false
|
229
|
+
writeConcern: { w: 1 }
|
230
|
+
# omitted fields
|
231
|
+
readConcern: { $$exists: false }
|
232
|
+
startTransaction: { $$exists: false }
|
233
|
+
commandName: commitTransaction
|
234
|
+
databaseName: admin
|
235
|
+
outcome: *outcome
|