mongo 2.5.3 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE +1 -1
- data/README.md +3 -2
- data/lib/mongo.rb +2 -2
- data/lib/mongo/address.rb +10 -2
- data/lib/mongo/address/ipv4.rb +1 -1
- data/lib/mongo/address/ipv6.rb +26 -5
- data/lib/mongo/address/unix.rb +1 -1
- data/lib/mongo/auth.rb +10 -3
- data/lib/mongo/auth/cr.rb +4 -1
- data/lib/mongo/auth/cr/conversation.rb +4 -1
- data/lib/mongo/auth/ldap.rb +1 -1
- data/lib/mongo/auth/ldap/conversation.rb +1 -1
- data/lib/mongo/auth/roles.rb +1 -1
- data/lib/mongo/auth/scram.rb +24 -7
- data/lib/mongo/auth/scram/conversation.rb +52 -19
- data/lib/mongo/auth/stringprep.rb +114 -0
- data/lib/mongo/auth/stringprep/profiles/sasl.rb +73 -0
- data/lib/mongo/auth/stringprep/tables.rb +3232 -0
- data/lib/mongo/auth/stringprep/unicode_normalize/normalize.rb +174 -0
- data/lib/mongo/auth/stringprep/unicode_normalize/tables.rb +1170 -0
- data/lib/mongo/auth/user.rb +14 -3
- data/lib/mongo/auth/user/view.rb +1 -1
- data/lib/mongo/auth/x509.rb +1 -1
- data/lib/mongo/auth/x509/conversation.rb +1 -1
- data/lib/mongo/bson.rb +1 -1
- data/lib/mongo/bulk_write.rb +8 -8
- data/lib/mongo/bulk_write/combineable.rb +1 -1
- data/lib/mongo/bulk_write/ordered_combiner.rb +1 -1
- data/lib/mongo/bulk_write/result.rb +1 -1
- data/lib/mongo/bulk_write/result_combiner.rb +4 -4
- data/lib/mongo/bulk_write/transformable.rb +1 -1
- data/lib/mongo/bulk_write/unordered_combiner.rb +1 -1
- data/lib/mongo/bulk_write/validatable.rb +1 -1
- data/lib/mongo/client.rb +115 -24
- data/lib/mongo/cluster.rb +17 -10
- data/lib/mongo/cluster/app_metadata.rb +7 -1
- data/lib/mongo/cluster/periodic_executor.rb +1 -1
- data/lib/mongo/cluster/reapers/socket_reaper.rb +1 -1
- data/lib/mongo/cluster/topology.rb +12 -2
- data/lib/mongo/cluster/topology/replica_set.rb +9 -1
- data/lib/mongo/cluster/topology/sharded.rb +1 -1
- data/lib/mongo/cluster/topology/single.rb +1 -1
- data/lib/mongo/cluster/topology/unknown.rb +1 -1
- data/lib/mongo/collection.rb +75 -19
- data/lib/mongo/collection/view.rb +1 -1
- data/lib/mongo/collection/view/aggregation.rb +1 -1
- data/lib/mongo/collection/view/builder.rb +1 -1
- data/lib/mongo/collection/view/builder/aggregation.rb +3 -3
- data/lib/mongo/collection/view/builder/find_command.rb +1 -1
- data/lib/mongo/collection/view/builder/flags.rb +1 -1
- data/lib/mongo/collection/view/builder/map_reduce.rb +1 -1
- data/lib/mongo/collection/view/builder/modifiers.rb +1 -1
- data/lib/mongo/collection/view/builder/op_query.rb +1 -1
- data/lib/mongo/collection/view/change_stream.rb +193 -17
- data/lib/mongo/collection/view/change_stream/retryable.rb +3 -20
- data/lib/mongo/collection/view/explainable.rb +1 -1
- data/lib/mongo/collection/view/immutable.rb +1 -1
- data/lib/mongo/collection/view/iterable.rb +2 -2
- data/lib/mongo/collection/view/map_reduce.rb +1 -1
- data/lib/mongo/collection/view/readable.rb +108 -29
- data/lib/mongo/collection/view/writable.rb +3 -3
- data/lib/mongo/cursor.rb +44 -4
- data/lib/mongo/cursor/builder.rb +1 -1
- data/lib/mongo/cursor/builder/get_more_command.rb +1 -1
- data/lib/mongo/cursor/builder/kill_cursors_command.rb +1 -1
- data/lib/mongo/cursor/builder/op_get_more.rb +1 -1
- data/lib/mongo/cursor/builder/op_kill_cursors.rb +1 -1
- data/lib/mongo/database.rb +46 -3
- data/lib/mongo/database/view.rb +11 -11
- data/lib/mongo/dbref.rb +1 -1
- data/lib/mongo/error.rb +57 -1
- data/lib/mongo/error/bulk_write_error.rb +2 -2
- data/lib/mongo/error/change_stream_resumable.rb +37 -0
- data/lib/mongo/error/closed_stream.rb +1 -1
- data/lib/mongo/error/extra_file_chunk.rb +1 -1
- data/lib/mongo/error/failed_stringprep_validation.rb +38 -0
- data/lib/mongo/error/file_not_found.rb +1 -1
- data/lib/mongo/error/insufficient_iteration_count.rb +38 -0
- data/lib/mongo/error/invalid_application_name.rb +1 -1
- data/lib/mongo/error/invalid_bulk_operation.rb +1 -1
- data/lib/mongo/error/invalid_bulk_operation_type.rb +1 -1
- data/lib/mongo/error/invalid_collection_name.rb +1 -1
- data/lib/mongo/error/invalid_database_name.rb +1 -1
- data/lib/mongo/error/invalid_document.rb +1 -1
- data/lib/mongo/error/invalid_file.rb +1 -1
- data/lib/mongo/error/invalid_file_revision.rb +1 -1
- data/lib/mongo/error/invalid_min_pool_size.rb +1 -1
- data/lib/mongo/error/invalid_nonce.rb +1 -1
- data/lib/mongo/error/invalid_read_option.rb +35 -0
- data/lib/mongo/error/invalid_replacement_document.rb +1 -1
- data/lib/mongo/error/invalid_server_preference.rb +1 -1
- data/lib/mongo/error/invalid_session.rb +1 -1
- data/lib/mongo/error/invalid_signature.rb +1 -1
- data/lib/mongo/error/invalid_transaction_operation.rb +82 -0
- data/lib/mongo/error/invalid_txt_record.rb +1 -1
- data/lib/mongo/error/invalid_update_document.rb +1 -1
- data/lib/mongo/error/invalid_uri.rb +1 -1
- data/lib/mongo/error/invalid_write_concern.rb +1 -1
- data/lib/mongo/error/max_bson_size.rb +1 -1
- data/lib/mongo/error/max_message_size.rb +1 -1
- data/lib/mongo/error/mismatched_domain.rb +1 -1
- data/lib/mongo/error/missing_file_chunk.rb +1 -1
- data/lib/mongo/error/missing_resume_token.rb +1 -1
- data/lib/mongo/error/multi_index_drop.rb +1 -1
- data/lib/mongo/error/need_primary_server.rb +1 -1
- data/lib/mongo/error/no_server_available.rb +1 -1
- data/lib/mongo/error/no_srv_records.rb +1 -1
- data/lib/mongo/error/operation_failure.rb +108 -14
- data/lib/mongo/error/parser.rb +50 -1
- data/lib/mongo/error/socket_error.rb +5 -2
- data/lib/mongo/error/socket_timeout_error.rb +5 -2
- data/lib/mongo/error/unchangeable_collection_option.rb +1 -1
- data/lib/mongo/error/unexpected_chunk_length.rb +1 -1
- data/lib/mongo/error/unexpected_response.rb +1 -1
- data/lib/mongo/error/unknown_payload_type.rb +1 -1
- data/lib/mongo/error/unsupported_array_filters.rb +1 -1
- data/lib/mongo/error/unsupported_collation.rb +1 -1
- data/lib/mongo/error/unsupported_features.rb +1 -1
- data/lib/mongo/error/unsupported_message_type.rb +1 -1
- data/lib/mongo/error/write_retryable.rb +27 -0
- data/lib/mongo/event.rb +10 -9
- data/lib/mongo/event/base.rb +33 -0
- data/lib/mongo/event/description_changed.rb +2 -2
- data/lib/mongo/event/listeners.rb +1 -1
- data/lib/mongo/event/member_discovered.rb +4 -2
- data/lib/mongo/event/primary_elected.rb +2 -2
- data/lib/mongo/event/publisher.rb +1 -1
- data/lib/mongo/event/standalone_discovered.rb +2 -2
- data/lib/mongo/event/subscriber.rb +1 -1
- data/lib/mongo/grid.rb +1 -1
- data/lib/mongo/grid/file.rb +1 -1
- data/lib/mongo/grid/file/chunk.rb +3 -3
- data/lib/mongo/grid/file/info.rb +26 -3
- data/lib/mongo/grid/fs_bucket.rb +1 -1
- data/lib/mongo/grid/stream.rb +1 -1
- data/lib/mongo/grid/stream/read.rb +1 -1
- data/lib/mongo/grid/stream/write.rb +1 -1
- data/lib/mongo/index.rb +1 -1
- data/lib/mongo/index/view.rb +1 -1
- data/lib/mongo/loggable.rb +1 -1
- data/lib/mongo/logger.rb +1 -1
- data/lib/mongo/monitoring.rb +99 -62
- data/lib/mongo/monitoring/command_log_subscriber.rb +2 -2
- data/lib/mongo/monitoring/event.rb +2 -1
- data/lib/mongo/monitoring/event/command_failed.rb +19 -6
- data/lib/mongo/monitoring/event/command_started.rb +14 -3
- data/lib/mongo/monitoring/event/command_succeeded.rb +5 -3
- data/lib/mongo/monitoring/event/secure.rb +1 -1
- data/lib/mongo/monitoring/event/server_closed.rb +2 -2
- data/lib/mongo/monitoring/event/server_description_changed.rb +2 -2
- data/lib/mongo/monitoring/event/server_opening.rb +11 -2
- data/lib/mongo/monitoring/event/topology_changed.rb +13 -2
- data/lib/mongo/monitoring/event/topology_closed.rb +2 -2
- data/lib/mongo/monitoring/event/topology_opening.rb +11 -2
- data/lib/mongo/monitoring/publishable.rb +10 -6
- data/lib/mongo/monitoring/sdam_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/server_closed_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/server_description_changed_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/server_opening_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/topology_changed_log_subscriber.rb +1 -1
- data/lib/mongo/monitoring/topology_opening_log_subscriber.rb +1 -1
- data/lib/mongo/operation/aggregate/op_msg.rb +3 -0
- data/lib/mongo/operation/create/op_msg.rb +9 -0
- data/lib/mongo/operation/create_index/op_msg.rb +9 -0
- data/lib/mongo/operation/create_user/command.rb +1 -1
- data/lib/mongo/operation/create_user/op_msg.rb +10 -1
- data/lib/mongo/operation/delete/op_msg.rb +3 -0
- data/lib/mongo/operation/distinct/op_msg.rb +9 -0
- data/lib/mongo/operation/drop/op_msg.rb +9 -0
- data/lib/mongo/operation/drop_database/op_msg.rb +9 -0
- data/lib/mongo/operation/drop_index/op_msg.rb +9 -0
- data/lib/mongo/operation/explain/op_msg.rb +3 -0
- data/lib/mongo/operation/find/op_msg.rb +3 -0
- data/lib/mongo/operation/get_more.rb +1 -1
- data/lib/mongo/operation/get_more/command.rb +1 -1
- data/lib/mongo/operation/get_more/legacy.rb +1 -1
- data/lib/mongo/operation/get_more/op_msg.rb +3 -0
- data/lib/mongo/operation/indexes/op_msg.rb +3 -0
- data/lib/mongo/operation/indexes/result.rb +1 -1
- data/lib/mongo/operation/insert/bulk_result.rb +32 -2
- data/lib/mongo/operation/insert/op_msg.rb +3 -0
- data/lib/mongo/operation/insert/result.rb +1 -1
- data/lib/mongo/operation/kill_cursors/op_msg.rb +9 -0
- data/lib/mongo/operation/list_collections/op_msg.rb +3 -0
- data/lib/mongo/operation/list_collections/result.rb +5 -1
- data/lib/mongo/operation/map_reduce/op_msg.rb +3 -0
- data/lib/mongo/operation/map_reduce/result.rb +1 -1
- data/lib/mongo/operation/parallel_scan/op_msg.rb +3 -0
- data/lib/mongo/operation/remove_user/op_msg.rb +9 -0
- data/lib/mongo/operation/result.rb +27 -14
- data/lib/mongo/operation/shared/executable.rb +1 -0
- data/lib/mongo/operation/shared/sessions_supported.rb +78 -7
- data/lib/mongo/operation/shared/specifiable.rb +18 -2
- data/lib/mongo/operation/shared/write_concern_supported.rb +1 -1
- data/lib/mongo/operation/update/op_msg.rb +3 -0
- data/lib/mongo/operation/update_user/command.rb +1 -1
- data/lib/mongo/operation/update_user/op_msg.rb +10 -1
- data/lib/mongo/operation/users_info/op_msg.rb +3 -0
- data/lib/mongo/options.rb +1 -1
- data/lib/mongo/options/mapper.rb +1 -1
- data/lib/mongo/options/redacted.rb +1 -1
- data/lib/mongo/protocol/bit_vector.rb +1 -1
- data/lib/mongo/protocol/compressed.rb +1 -1
- data/lib/mongo/protocol/delete.rb +1 -1
- data/lib/mongo/protocol/get_more.rb +7 -7
- data/lib/mongo/protocol/insert.rb +1 -1
- data/lib/mongo/protocol/kill_cursors.rb +1 -1
- data/lib/mongo/protocol/message.rb +5 -5
- data/lib/mongo/protocol/msg.rb +9 -7
- data/lib/mongo/protocol/query.rb +1 -1
- data/lib/mongo/protocol/registry.rb +1 -1
- data/lib/mongo/protocol/reply.rb +10 -10
- data/lib/mongo/protocol/serializers.rb +1 -1
- data/lib/mongo/protocol/update.rb +1 -1
- data/lib/mongo/retryable.rb +22 -14
- data/lib/mongo/server.rb +1 -1
- data/lib/mongo/server/connectable.rb +1 -1
- data/lib/mongo/server/connection.rb +16 -4
- data/lib/mongo/server/connection_pool.rb +1 -1
- data/lib/mongo/server/connection_pool/queue.rb +1 -1
- data/lib/mongo/server/context.rb +1 -1
- data/lib/mongo/server/description.rb +14 -2
- data/lib/mongo/server/description/features.rb +10 -9
- data/lib/mongo/server/description/inspector.rb +1 -1
- data/lib/mongo/server/description/inspector/description_changed.rb +1 -1
- data/lib/mongo/server/description/inspector/member_discovered.rb +1 -1
- data/lib/mongo/server/description/inspector/primary_elected.rb +1 -1
- data/lib/mongo/server/description/inspector/standalone_discovered.rb +1 -1
- data/lib/mongo/server/monitor.rb +15 -3
- data/lib/mongo/server/monitor/connection.rb +1 -1
- data/lib/mongo/server_selector.rb +1 -1
- data/lib/mongo/server_selector/nearest.rb +1 -1
- data/lib/mongo/server_selector/primary.rb +1 -1
- data/lib/mongo/server_selector/primary_preferred.rb +1 -1
- data/lib/mongo/server_selector/secondary.rb +1 -1
- data/lib/mongo/server_selector/secondary_preferred.rb +1 -1
- data/lib/mongo/server_selector/selectable.rb +7 -2
- data/lib/mongo/session.rb +389 -12
- data/lib/mongo/session/server_session.rb +7 -2
- data/lib/mongo/session/session_pool.rb +1 -1
- data/lib/mongo/socket.rb +1 -1
- data/lib/mongo/socket/ssl.rb +1 -1
- data/lib/mongo/socket/tcp.rb +1 -1
- data/lib/mongo/socket/unix.rb +1 -1
- data/lib/mongo/uri.rb +6 -4
- data/lib/mongo/uri/srv_protocol.rb +1 -1
- data/lib/mongo/version.rb +2 -2
- data/lib/mongo/write_concern.rb +1 -1
- data/lib/mongo/write_concern/acknowledged.rb +1 -1
- data/lib/mongo/write_concern/normalizable.rb +1 -1
- data/lib/mongo/write_concern/unacknowledged.rb +1 -1
- data/mongo.gemspec +4 -1
- data/spec/atlas/atlas_connectivity_spec.rb +54 -0
- data/spec/integration/bulk_insert_spec.rb +78 -0
- data/spec/integration/change_stream_spec.rb +365 -0
- data/spec/integration/command_monitoring_spec.rb +92 -0
- data/spec/lite_spec_helper.rb +63 -0
- data/spec/mongo/address/ipv6_spec.rb +29 -1
- data/spec/mongo/address_spec.rb +34 -0
- data/spec/mongo/auth/scram/conversation_spec.rb +326 -120
- data/spec/mongo/auth/scram/negotiation_spec.rb +574 -0
- data/spec/mongo/auth/scram_spec.rb +107 -38
- data/spec/mongo/auth/stringprep/profiles/sasl_spec.rb +113 -0
- data/spec/mongo/auth/stringprep_spec.rb +188 -0
- data/spec/mongo/auth/user/view_spec.rb +5 -2
- data/spec/mongo/auth/user_spec.rb +1 -1
- data/spec/mongo/bulk_write/result_spec.rb +120 -0
- data/spec/mongo/bulk_write_spec.rb +42 -2
- data/spec/mongo/client_spec.rb +121 -9
- data/spec/mongo/cluster/app_metadata_spec.rb +14 -1
- data/spec/mongo/cluster/topology_spec.rb +1 -23
- data/spec/mongo/collection/view/change_stream_spec.rb +62 -180
- data/spec/mongo/collection_spec.rb +45 -12
- data/spec/mongo/cursor/builder/get_more_command_spec.rb +7 -7
- data/spec/mongo/cursor_spec.rb +2 -2
- data/spec/mongo/database_spec.rb +3 -3
- data/spec/mongo/docs_examples_spec.rb +194 -0
- data/spec/mongo/error/operation_failure_spec.rb +152 -0
- data/spec/mongo/error/parser_spec.rb +127 -0
- data/spec/mongo/grid/fs_bucket_spec.rb +32 -0
- data/spec/mongo/grid/stream/write_spec.rb +40 -1
- data/spec/mongo/monitoring/event/command_failed_spec.rb +30 -0
- data/spec/mongo/monitoring/event/command_started_spec.rb +26 -4
- data/spec/mongo/monitoring/event/command_succeeded_spec.rb +29 -7
- data/spec/mongo/monitoring_spec.rb +28 -3
- data/spec/mongo/protocol/get_more_spec.rb +2 -2
- data/spec/mongo/retryable_spec.rb +252 -34
- data/spec/mongo/retryable_writes_spec.rb +468 -544
- data/spec/mongo/server/connection_spec.rb +5 -5
- data/spec/mongo/server/description_spec.rb +23 -6
- data/spec/mongo/session/server_session_spec.rb +2 -2
- data/spec/mongo/session/session_pool_spec.rb +2 -2
- data/spec/mongo/transactions_examples_spec.rb +227 -0
- data/spec/mongo/transactions_spec.rb +44 -0
- data/spec/spec_helper.rb +135 -49
- data/spec/spec_tests/change_streams_spec.rb +42 -0
- data/spec/{mongo → spec_tests}/command_monitoring_spec.rb +8 -2
- data/spec/{mongo → spec_tests}/connection_string_spec.rb +1 -1
- data/spec/{mongo → spec_tests}/crud_spec.rb +5 -7
- data/spec/{mongo → spec_tests}/dns_seedlist_discovery_spec.rb +1 -1
- data/spec/{mongo → spec_tests}/gridfs_spec.rb +0 -0
- data/spec/{mongo → spec_tests}/max_staleness_spec.rb +0 -0
- data/spec/spec_tests/retryable_writes_spec.rb +78 -0
- data/spec/{mongo → spec_tests}/sdam_monitoring_spec.rb +4 -3
- data/spec/{mongo → spec_tests}/sdam_spec.rb +7 -7
- data/spec/{mongo → spec_tests}/server_selection_rtt_spec.rb +0 -0
- data/spec/{mongo → spec_tests}/server_selection_spec.rb +0 -0
- data/spec/support/authorization.rb +18 -6
- data/spec/support/change_streams.rb +265 -0
- data/spec/support/change_streams/operation.rb +62 -0
- data/spec/support/change_streams_tests/change-streams-errors.yml +53 -0
- data/spec/support/change_streams_tests/change-streams.yml +299 -0
- data/spec/support/command_monitoring.rb +1 -1
- data/spec/support/command_monitoring/bulkWrite.yml +4 -28
- data/spec/support/command_monitoring/command.yml +19 -0
- data/spec/support/command_monitoring/find.yml +17 -19
- data/spec/support/command_monitoring/insertMany.yml +2 -8
- data/spec/support/command_monitoring/unacknowledgedBulkWrite.yml +34 -0
- data/spec/support/connection_string.rb +1 -1
- data/spec/support/constraints.rb +56 -0
- data/spec/support/crud.rb +9 -4
- data/spec/support/crud/read.rb +24 -3
- data/spec/support/crud/write.rb +7 -2
- data/spec/support/crud_tests/read/count-collation.yml +12 -2
- data/spec/support/crud_tests/read/count.yml +43 -5
- data/spec/support/gridfs.rb +1 -1
- data/spec/support/primary_socket.rb +21 -0
- data/spec/support/retryable_writes_tests/bulkWrite-serverErrors.yml +90 -0
- data/spec/support/retryable_writes_tests/bulkWrite.yml +99 -1
- data/spec/support/retryable_writes_tests/deleteOne-serverErrors.yml +50 -0
- data/spec/support/retryable_writes_tests/deleteOne.yml +10 -1
- data/spec/support/retryable_writes_tests/findOneAndDelete-serverErrors.yml +50 -0
- data/spec/support/retryable_writes_tests/findOneAndDelete.yml +39 -30
- data/spec/support/retryable_writes_tests/findOneAndReplace-serverErrors.yml +54 -0
- data/spec/support/retryable_writes_tests/findOneAndReplace.yml +9 -0
- data/spec/support/retryable_writes_tests/findOneAndUpdate-serverErrors.yml +54 -0
- data/spec/support/retryable_writes_tests/findOneAndUpdate.yml +9 -0
- data/spec/support/retryable_writes_tests/insertMany-serverErrors.yml +59 -0
- data/spec/support/retryable_writes_tests/insertMany.yml +11 -6
- data/spec/support/retryable_writes_tests/insertOne-serverErrors.yml +471 -0
- data/spec/support/retryable_writes_tests/insertOne.yml +9 -0
- data/spec/support/retryable_writes_tests/replaceOne-serverErrors.yml +58 -0
- data/spec/support/retryable_writes_tests/replaceOne.yml +9 -0
- data/spec/support/retryable_writes_tests/updateOne-serverErrors.yml +58 -0
- data/spec/support/retryable_writes_tests/updateOne.yml +71 -53
- data/spec/support/sdam/rs/normalize_case_me.yml +100 -0
- data/spec/support/sdam/sharded/compatible.yml +38 -0
- data/spec/support/sdam/sharded/mongos_disconnect.yml +9 -3
- data/spec/support/sdam/sharded/multiple_mongoses.yml +6 -2
- data/spec/support/sdam/sharded/non_mongos_removed.yml +6 -2
- data/spec/support/sdam/sharded/too_new.yml +36 -0
- data/spec/support/sdam/sharded/too_old.yml +36 -0
- data/spec/support/sdam/single/compatible.yml +26 -0
- data/spec/support/sdam/single/direct_connection_external_ip.yml +3 -1
- data/spec/support/sdam/single/direct_connection_mongos.yml +3 -1
- data/spec/support/sdam/single/direct_connection_rsarbiter.yml +3 -1
- data/spec/support/sdam/single/direct_connection_rsprimary.yml +3 -1
- data/spec/support/sdam/single/direct_connection_rssecondary.yml +3 -1
- data/spec/support/sdam/single/direct_connection_slave.yml +3 -1
- data/spec/support/sdam/single/direct_connection_standalone.yml +3 -1
- data/spec/support/sdam/single/not_ok_response.yml +6 -2
- data/spec/support/sdam/single/standalone_removed.yml +3 -1
- data/spec/support/sdam/single/too_new.yml +26 -0
- data/spec/support/sdam/single/too_old.yml +24 -0
- data/spec/support/shared/session.rb +107 -0
- data/spec/support/transactions.rb +391 -0
- data/spec/support/transactions/operation.rb +373 -0
- data/spec/support/transactions_tests/abort.yml +403 -0
- data/spec/support/transactions_tests/bulk.yml +267 -0
- data/spec/support/transactions_tests/causal-consistency.yml +173 -0
- data/spec/support/transactions_tests/commit.yml +593 -0
- data/spec/support/transactions_tests/delete.yml +184 -0
- data/spec/support/transactions_tests/error-labels.yml +948 -0
- data/spec/support/transactions_tests/errors.yml +125 -0
- data/spec/support/transactions_tests/findOneAndDelete.yml +126 -0
- data/spec/support/transactions_tests/findOneAndReplace.yml +140 -0
- data/spec/support/transactions_tests/findOneAndUpdate.yml +228 -0
- data/spec/support/transactions_tests/insert.yml +264 -0
- data/spec/support/transactions_tests/isolation.yml +125 -0
- data/spec/support/transactions_tests/read-pref.yml +340 -0
- data/spec/support/transactions_tests/reads.yml +298 -0
- data/spec/support/transactions_tests/retryable-abort.yml +1292 -0
- data/spec/support/transactions_tests/retryable-commit.yml +1332 -0
- data/spec/support/transactions_tests/retryable-writes.yml +208 -0
- data/spec/support/transactions_tests/run-command.yml +189 -0
- data/spec/support/transactions_tests/transaction-options.yml +877 -0
- data/spec/support/transactions_tests/update.yml +246 -0
- data/spec/support/transactions_tests/write-concern.yml +236 -0
- metadata +494 -359
- metadata.gz.sig +0 -0
- data/lib/csasl/csasl.bundle +0 -0
@@ -0,0 +1,184 @@
|
|
1
|
+
database_name: &database_name "ruby-driver"
|
2
|
+
collection_name: &collection_name "transactions-tests"
|
3
|
+
|
4
|
+
data:
|
5
|
+
- _id: 1
|
6
|
+
- _id: 2
|
7
|
+
- _id: 3
|
8
|
+
- _id: 4
|
9
|
+
- _id: 5
|
10
|
+
|
11
|
+
tests:
|
12
|
+
- description: delete
|
13
|
+
|
14
|
+
operations:
|
15
|
+
- name: startTransaction
|
16
|
+
object: session0
|
17
|
+
- name: deleteOne
|
18
|
+
object: collection
|
19
|
+
arguments:
|
20
|
+
session: session0
|
21
|
+
filter:
|
22
|
+
_id: 1
|
23
|
+
result:
|
24
|
+
deletedCount: 1
|
25
|
+
- name: deleteMany
|
26
|
+
object: collection
|
27
|
+
arguments:
|
28
|
+
session: session0
|
29
|
+
filter:
|
30
|
+
_id: {$lte: 3}
|
31
|
+
result:
|
32
|
+
deletedCount: 2
|
33
|
+
- name: deleteOne
|
34
|
+
object: collection
|
35
|
+
arguments:
|
36
|
+
session: session0
|
37
|
+
filter:
|
38
|
+
_id: 4
|
39
|
+
result:
|
40
|
+
deletedCount: 1
|
41
|
+
- name: commitTransaction
|
42
|
+
object: session0
|
43
|
+
|
44
|
+
expectations:
|
45
|
+
- command_started_event:
|
46
|
+
command:
|
47
|
+
delete: *collection_name
|
48
|
+
deletes:
|
49
|
+
- q: {_id: 1}
|
50
|
+
limit: 1
|
51
|
+
ordered: true
|
52
|
+
readConcern:
|
53
|
+
lsid: session0
|
54
|
+
txnNumber:
|
55
|
+
$numberLong: "1"
|
56
|
+
startTransaction: true
|
57
|
+
autocommit: false
|
58
|
+
writeConcern:
|
59
|
+
command_name: delete
|
60
|
+
database_name: *database_name
|
61
|
+
- command_started_event:
|
62
|
+
command:
|
63
|
+
delete: *collection_name
|
64
|
+
deletes:
|
65
|
+
- q: {_id: {$lte: 3}}
|
66
|
+
limit: 0
|
67
|
+
ordered: true
|
68
|
+
lsid: session0
|
69
|
+
txnNumber:
|
70
|
+
$numberLong: "1"
|
71
|
+
startTransaction:
|
72
|
+
autocommit: false
|
73
|
+
writeConcern:
|
74
|
+
command_name: delete
|
75
|
+
database_name: *database_name
|
76
|
+
- command_started_event:
|
77
|
+
command:
|
78
|
+
delete: *collection_name
|
79
|
+
deletes:
|
80
|
+
- q: {_id: 4}
|
81
|
+
limit: 1
|
82
|
+
ordered: true
|
83
|
+
lsid: session0
|
84
|
+
txnNumber:
|
85
|
+
$numberLong: "1"
|
86
|
+
startTransaction:
|
87
|
+
autocommit: false
|
88
|
+
writeConcern:
|
89
|
+
command_name: delete
|
90
|
+
database_name: *database_name
|
91
|
+
- command_started_event:
|
92
|
+
command:
|
93
|
+
commitTransaction: 1
|
94
|
+
lsid: session0
|
95
|
+
txnNumber:
|
96
|
+
$numberLong: "1"
|
97
|
+
startTransaction:
|
98
|
+
autocommit: false
|
99
|
+
writeConcern:
|
100
|
+
command_name: commitTransaction
|
101
|
+
database_name: admin
|
102
|
+
|
103
|
+
outcome:
|
104
|
+
collection:
|
105
|
+
data:
|
106
|
+
- _id: 5
|
107
|
+
|
108
|
+
- description: collection writeConcern ignored for delete
|
109
|
+
operations:
|
110
|
+
- name: startTransaction
|
111
|
+
object: session0
|
112
|
+
arguments:
|
113
|
+
options:
|
114
|
+
writeConcern:
|
115
|
+
w: majority
|
116
|
+
- name: deleteOne
|
117
|
+
object: collection
|
118
|
+
collectionOptions:
|
119
|
+
writeConcern:
|
120
|
+
w: majority
|
121
|
+
arguments:
|
122
|
+
session: session0
|
123
|
+
filter:
|
124
|
+
_id: 1
|
125
|
+
result:
|
126
|
+
deletedCount: 1
|
127
|
+
- name: deleteMany
|
128
|
+
object: collection
|
129
|
+
collectionOptions:
|
130
|
+
writeConcern:
|
131
|
+
w: majority
|
132
|
+
arguments:
|
133
|
+
session: session0
|
134
|
+
filter:
|
135
|
+
_id: {$lte: 3}
|
136
|
+
result:
|
137
|
+
deletedCount: 2
|
138
|
+
- name: commitTransaction
|
139
|
+
object: session0
|
140
|
+
|
141
|
+
expectations:
|
142
|
+
- command_started_event:
|
143
|
+
command:
|
144
|
+
delete: *collection_name
|
145
|
+
deletes:
|
146
|
+
- q: {_id: 1}
|
147
|
+
limit: 1
|
148
|
+
ordered: true
|
149
|
+
readConcern:
|
150
|
+
lsid: session0
|
151
|
+
txnNumber:
|
152
|
+
$numberLong: "1"
|
153
|
+
startTransaction: true
|
154
|
+
autocommit: false
|
155
|
+
writeConcern:
|
156
|
+
command_name: delete
|
157
|
+
database_name: *database_name
|
158
|
+
- command_started_event:
|
159
|
+
command:
|
160
|
+
delete: *collection_name
|
161
|
+
deletes:
|
162
|
+
- q: {_id: {$lte: 3}}
|
163
|
+
limit: 0
|
164
|
+
ordered: true
|
165
|
+
lsid: session0
|
166
|
+
txnNumber:
|
167
|
+
$numberLong: "1"
|
168
|
+
startTransaction:
|
169
|
+
autocommit: false
|
170
|
+
writeConcern:
|
171
|
+
command_name: delete
|
172
|
+
database_name: *database_name
|
173
|
+
- command_started_event:
|
174
|
+
command:
|
175
|
+
commitTransaction: 1
|
176
|
+
lsid: session0
|
177
|
+
txnNumber:
|
178
|
+
$numberLong: "1"
|
179
|
+
startTransaction:
|
180
|
+
autocommit: false
|
181
|
+
writeConcern:
|
182
|
+
w: majority
|
183
|
+
command_name: commitTransaction
|
184
|
+
database_name: admin
|
@@ -0,0 +1,948 @@
|
|
1
|
+
database_name: &database_name "ruby-driver"
|
2
|
+
collection_name: &collection_name "transactions-tests"
|
3
|
+
|
4
|
+
data: []
|
5
|
+
|
6
|
+
tests:
|
7
|
+
- description: DuplicateKey errors do not contain transient label
|
8
|
+
|
9
|
+
operations:
|
10
|
+
- name: startTransaction
|
11
|
+
object: session0
|
12
|
+
- name: insertMany
|
13
|
+
object: collection
|
14
|
+
arguments:
|
15
|
+
session: session0
|
16
|
+
documents:
|
17
|
+
- _id: 1
|
18
|
+
- _id: 1
|
19
|
+
result:
|
20
|
+
errorCodeName: DuplicateKey
|
21
|
+
errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"]
|
22
|
+
- name: abortTransaction
|
23
|
+
object: session0
|
24
|
+
|
25
|
+
expectations:
|
26
|
+
- command_started_event:
|
27
|
+
command:
|
28
|
+
insert: *collection_name
|
29
|
+
documents:
|
30
|
+
- _id: 1
|
31
|
+
- _id: 1
|
32
|
+
ordered: true
|
33
|
+
readConcern:
|
34
|
+
lsid: session0
|
35
|
+
txnNumber:
|
36
|
+
$numberLong: "1"
|
37
|
+
startTransaction: true
|
38
|
+
autocommit: false
|
39
|
+
writeConcern:
|
40
|
+
command_name: insert
|
41
|
+
database_name: *database_name
|
42
|
+
- command_started_event:
|
43
|
+
command:
|
44
|
+
abortTransaction: 1
|
45
|
+
lsid: session0
|
46
|
+
txnNumber:
|
47
|
+
$numberLong: "1"
|
48
|
+
startTransaction:
|
49
|
+
autocommit: false
|
50
|
+
writeConcern:
|
51
|
+
command_name: abortTransaction
|
52
|
+
database_name: admin
|
53
|
+
|
54
|
+
outcome:
|
55
|
+
collection:
|
56
|
+
data: []
|
57
|
+
|
58
|
+
- description: NotMaster errors contain transient label
|
59
|
+
|
60
|
+
failPoint:
|
61
|
+
configureFailPoint: failCommand
|
62
|
+
mode: { times: 1 }
|
63
|
+
data:
|
64
|
+
failCommands: ["insert"]
|
65
|
+
errorCode: 10107 # NotMaster
|
66
|
+
|
67
|
+
operations:
|
68
|
+
- name: startTransaction
|
69
|
+
object: session0
|
70
|
+
- name: insertOne
|
71
|
+
object: collection
|
72
|
+
arguments:
|
73
|
+
session: session0
|
74
|
+
document:
|
75
|
+
_id: 1
|
76
|
+
result:
|
77
|
+
# Note, the server will return the errorLabel in this case.
|
78
|
+
errorLabelsContain: ["TransientTransactionError"]
|
79
|
+
errorLabelsOmit: ["UnknownTransactionCommitResult"]
|
80
|
+
- name: abortTransaction
|
81
|
+
object: session0
|
82
|
+
|
83
|
+
expectations:
|
84
|
+
- command_started_event:
|
85
|
+
command:
|
86
|
+
insert: *collection_name
|
87
|
+
documents:
|
88
|
+
- _id: 1
|
89
|
+
ordered: true
|
90
|
+
readConcern:
|
91
|
+
lsid: session0
|
92
|
+
txnNumber:
|
93
|
+
$numberLong: "1"
|
94
|
+
startTransaction: true
|
95
|
+
autocommit: false
|
96
|
+
writeConcern:
|
97
|
+
command_name: insert
|
98
|
+
database_name: *database_name
|
99
|
+
- command_started_event:
|
100
|
+
command:
|
101
|
+
abortTransaction: 1
|
102
|
+
lsid: session0
|
103
|
+
txnNumber:
|
104
|
+
$numberLong: "1"
|
105
|
+
startTransaction:
|
106
|
+
autocommit: false
|
107
|
+
writeConcern:
|
108
|
+
command_name: abortTransaction
|
109
|
+
database_name: admin
|
110
|
+
|
111
|
+
outcome:
|
112
|
+
collection:
|
113
|
+
data: []
|
114
|
+
|
115
|
+
- description: WriteConflict errors contain transient label
|
116
|
+
|
117
|
+
failPoint:
|
118
|
+
configureFailPoint: failCommand
|
119
|
+
mode: { times: 1 }
|
120
|
+
data:
|
121
|
+
failCommands: ["insert"]
|
122
|
+
errorCode: 112 # WriteConflict
|
123
|
+
|
124
|
+
operations:
|
125
|
+
- name: startTransaction
|
126
|
+
object: session0
|
127
|
+
- name: insertOne
|
128
|
+
object: collection
|
129
|
+
arguments:
|
130
|
+
session: session0
|
131
|
+
document:
|
132
|
+
_id: 1
|
133
|
+
result:
|
134
|
+
# Note, the server will return the errorLabel in this case.
|
135
|
+
errorLabelsContain: ["TransientTransactionError"]
|
136
|
+
errorLabelsOmit: ["UnknownTransactionCommitResult"]
|
137
|
+
- name: abortTransaction
|
138
|
+
object: session0
|
139
|
+
|
140
|
+
expectations:
|
141
|
+
- command_started_event:
|
142
|
+
command:
|
143
|
+
insert: *collection_name
|
144
|
+
documents:
|
145
|
+
- _id: 1
|
146
|
+
ordered: true
|
147
|
+
readConcern:
|
148
|
+
lsid: session0
|
149
|
+
txnNumber:
|
150
|
+
$numberLong: "1"
|
151
|
+
startTransaction: true
|
152
|
+
autocommit: false
|
153
|
+
writeConcern:
|
154
|
+
command_name: insert
|
155
|
+
database_name: *database_name
|
156
|
+
- command_started_event:
|
157
|
+
command:
|
158
|
+
abortTransaction: 1
|
159
|
+
lsid: session0
|
160
|
+
txnNumber:
|
161
|
+
$numberLong: "1"
|
162
|
+
startTransaction:
|
163
|
+
autocommit: false
|
164
|
+
writeConcern:
|
165
|
+
command_name: abortTransaction
|
166
|
+
database_name: admin
|
167
|
+
|
168
|
+
outcome:
|
169
|
+
collection:
|
170
|
+
data: []
|
171
|
+
|
172
|
+
- description: NoSuchTransaction errors contain transient label
|
173
|
+
|
174
|
+
failPoint:
|
175
|
+
configureFailPoint: failCommand
|
176
|
+
mode: { times: 1 }
|
177
|
+
data:
|
178
|
+
failCommands: ["insert"]
|
179
|
+
errorCode: 251 # NoSuchTransaction
|
180
|
+
|
181
|
+
operations:
|
182
|
+
- name: startTransaction
|
183
|
+
object: session0
|
184
|
+
- name: insertOne
|
185
|
+
object: collection
|
186
|
+
arguments:
|
187
|
+
session: session0
|
188
|
+
document:
|
189
|
+
_id: 1
|
190
|
+
result:
|
191
|
+
# Note, the server will return the errorLabel in this case.
|
192
|
+
errorLabelsContain: ["TransientTransactionError"]
|
193
|
+
errorLabelsOmit: ["UnknownTransactionCommitResult"]
|
194
|
+
- name: abortTransaction
|
195
|
+
object: session0
|
196
|
+
|
197
|
+
expectations:
|
198
|
+
- command_started_event:
|
199
|
+
command:
|
200
|
+
insert: *collection_name
|
201
|
+
documents:
|
202
|
+
- _id: 1
|
203
|
+
ordered: true
|
204
|
+
readConcern:
|
205
|
+
lsid: session0
|
206
|
+
txnNumber:
|
207
|
+
$numberLong: "1"
|
208
|
+
startTransaction: true
|
209
|
+
autocommit: false
|
210
|
+
writeConcern:
|
211
|
+
command_name: insert
|
212
|
+
database_name: *database_name
|
213
|
+
- command_started_event:
|
214
|
+
command:
|
215
|
+
abortTransaction: 1
|
216
|
+
lsid: session0
|
217
|
+
txnNumber:
|
218
|
+
$numberLong: "1"
|
219
|
+
startTransaction:
|
220
|
+
autocommit: false
|
221
|
+
writeConcern:
|
222
|
+
command_name: abortTransaction
|
223
|
+
database_name: admin
|
224
|
+
|
225
|
+
outcome:
|
226
|
+
collection:
|
227
|
+
data: []
|
228
|
+
|
229
|
+
- description: NoSuchTransaction errors on commit contain transient label
|
230
|
+
|
231
|
+
failPoint:
|
232
|
+
configureFailPoint: failCommand
|
233
|
+
mode: { times: 1 }
|
234
|
+
data:
|
235
|
+
failCommands: ["commitTransaction"]
|
236
|
+
errorCode: 251 # NoSuchTransaction
|
237
|
+
|
238
|
+
operations:
|
239
|
+
- name: startTransaction
|
240
|
+
object: session0
|
241
|
+
- name: insertOne
|
242
|
+
object: collection
|
243
|
+
arguments:
|
244
|
+
session: session0
|
245
|
+
document:
|
246
|
+
_id: 1
|
247
|
+
result:
|
248
|
+
insertedId: 1
|
249
|
+
- name: commitTransaction
|
250
|
+
object: session0
|
251
|
+
result:
|
252
|
+
# Note, the server will return the errorLabel in this case.
|
253
|
+
errorLabelsContain: ["TransientTransactionError"]
|
254
|
+
errorLabelsOmit: ["UnknownTransactionCommitResult"]
|
255
|
+
|
256
|
+
expectations:
|
257
|
+
- command_started_event:
|
258
|
+
command:
|
259
|
+
insert: *collection_name
|
260
|
+
documents:
|
261
|
+
- _id: 1
|
262
|
+
ordered: true
|
263
|
+
readConcern:
|
264
|
+
lsid: session0
|
265
|
+
txnNumber:
|
266
|
+
$numberLong: "1"
|
267
|
+
startTransaction: true
|
268
|
+
autocommit: false
|
269
|
+
writeConcern:
|
270
|
+
command_name: insert
|
271
|
+
database_name: *database_name
|
272
|
+
- command_started_event:
|
273
|
+
command:
|
274
|
+
commitTransaction: 1
|
275
|
+
lsid: session0
|
276
|
+
txnNumber:
|
277
|
+
$numberLong: "1"
|
278
|
+
startTransaction:
|
279
|
+
autocommit: false
|
280
|
+
writeConcern:
|
281
|
+
command_name: commitTransaction
|
282
|
+
database_name: admin
|
283
|
+
|
284
|
+
outcome:
|
285
|
+
collection:
|
286
|
+
data: []
|
287
|
+
|
288
|
+
- description: add transient label to connection errors
|
289
|
+
|
290
|
+
failPoint:
|
291
|
+
configureFailPoint: failCommand
|
292
|
+
mode: { times: 4 }
|
293
|
+
data:
|
294
|
+
failCommands: ["insert", "find", "aggregate", "distinct"]
|
295
|
+
closeConnection: true
|
296
|
+
|
297
|
+
operations:
|
298
|
+
- name: startTransaction
|
299
|
+
object: session0
|
300
|
+
- name: insertOne
|
301
|
+
object: collection
|
302
|
+
arguments:
|
303
|
+
session: session0
|
304
|
+
document:
|
305
|
+
_id: 1
|
306
|
+
result: &transient_label_only
|
307
|
+
errorLabelsContain: ["TransientTransactionError"]
|
308
|
+
errorLabelsOmit: ["UnknownTransactionCommitResult"]
|
309
|
+
- name: find
|
310
|
+
object: collection
|
311
|
+
arguments:
|
312
|
+
session: session0
|
313
|
+
result: *transient_label_only
|
314
|
+
- name: aggregate
|
315
|
+
object: collection
|
316
|
+
arguments:
|
317
|
+
pipeline:
|
318
|
+
- $project:
|
319
|
+
_id: 1
|
320
|
+
session: session0
|
321
|
+
result: *transient_label_only
|
322
|
+
- name: distinct
|
323
|
+
object: collection
|
324
|
+
arguments:
|
325
|
+
fieldName: _id
|
326
|
+
session: session0
|
327
|
+
result: *transient_label_only
|
328
|
+
- name: abortTransaction
|
329
|
+
object: session0
|
330
|
+
|
331
|
+
expectations:
|
332
|
+
- command_started_event:
|
333
|
+
command:
|
334
|
+
insert: *collection_name
|
335
|
+
documents:
|
336
|
+
- _id: 1
|
337
|
+
ordered: true
|
338
|
+
readConcern:
|
339
|
+
lsid: session0
|
340
|
+
txnNumber:
|
341
|
+
$numberLong: "1"
|
342
|
+
startTransaction: true
|
343
|
+
autocommit: false
|
344
|
+
writeConcern:
|
345
|
+
command_name: insert
|
346
|
+
database_name: *database_name
|
347
|
+
- command_started_event:
|
348
|
+
command:
|
349
|
+
find: *collection_name
|
350
|
+
readConcern:
|
351
|
+
lsid: session0
|
352
|
+
txnNumber:
|
353
|
+
$numberLong: "1"
|
354
|
+
startTransaction:
|
355
|
+
autocommit: false
|
356
|
+
command_name: find
|
357
|
+
database_name: *database_name
|
358
|
+
- command_started_event:
|
359
|
+
command:
|
360
|
+
aggregate: *collection_name
|
361
|
+
pipeline:
|
362
|
+
- $project:
|
363
|
+
_id: 1
|
364
|
+
readConcern:
|
365
|
+
lsid: session0
|
366
|
+
txnNumber:
|
367
|
+
$numberLong: "1"
|
368
|
+
startTransaction:
|
369
|
+
autocommit: false
|
370
|
+
command_name: aggregate
|
371
|
+
database_name: *database_name
|
372
|
+
- command_started_event:
|
373
|
+
command:
|
374
|
+
distinct: *collection_name
|
375
|
+
key: _id
|
376
|
+
lsid: session0
|
377
|
+
readConcern:
|
378
|
+
txnNumber:
|
379
|
+
$numberLong: "1"
|
380
|
+
startTransaction:
|
381
|
+
autocommit: false
|
382
|
+
command_name: distinct
|
383
|
+
database_name: *database_name
|
384
|
+
- command_started_event:
|
385
|
+
command:
|
386
|
+
abortTransaction: 1
|
387
|
+
lsid: session0
|
388
|
+
txnNumber:
|
389
|
+
$numberLong: "1"
|
390
|
+
startTransaction:
|
391
|
+
autocommit: false
|
392
|
+
writeConcern:
|
393
|
+
command_name: abortTransaction
|
394
|
+
database_name: admin
|
395
|
+
|
396
|
+
outcome:
|
397
|
+
collection:
|
398
|
+
data: []
|
399
|
+
|
400
|
+
- description: add unknown commit label to connection errors
|
401
|
+
|
402
|
+
failPoint:
|
403
|
+
configureFailPoint: failCommand
|
404
|
+
mode: { times: 2 }
|
405
|
+
data:
|
406
|
+
failCommands: ["commitTransaction"]
|
407
|
+
closeConnection: true
|
408
|
+
|
409
|
+
operations:
|
410
|
+
- name: startTransaction
|
411
|
+
object: session0
|
412
|
+
- name: insertOne
|
413
|
+
object: collection
|
414
|
+
arguments:
|
415
|
+
session: session0
|
416
|
+
document:
|
417
|
+
_id: 1
|
418
|
+
result:
|
419
|
+
insertedId: 1
|
420
|
+
- name: commitTransaction
|
421
|
+
object: session0
|
422
|
+
result:
|
423
|
+
errorLabelsContain: ["UnknownTransactionCommitResult"]
|
424
|
+
errorLabelsOmit: ["TransientTransactionError"]
|
425
|
+
- name: commitTransaction
|
426
|
+
object: session0
|
427
|
+
|
428
|
+
expectations:
|
429
|
+
- command_started_event:
|
430
|
+
command:
|
431
|
+
insert: *collection_name
|
432
|
+
documents:
|
433
|
+
- _id: 1
|
434
|
+
ordered: true
|
435
|
+
readConcern:
|
436
|
+
lsid: session0
|
437
|
+
txnNumber:
|
438
|
+
$numberLong: "1"
|
439
|
+
startTransaction: true
|
440
|
+
autocommit: false
|
441
|
+
writeConcern:
|
442
|
+
command_name: insert
|
443
|
+
database_name: *database_name
|
444
|
+
- command_started_event:
|
445
|
+
command:
|
446
|
+
commitTransaction: 1
|
447
|
+
lsid: session0
|
448
|
+
txnNumber:
|
449
|
+
$numberLong: "1"
|
450
|
+
startTransaction:
|
451
|
+
autocommit: false
|
452
|
+
writeConcern:
|
453
|
+
command_name: commitTransaction
|
454
|
+
database_name: admin
|
455
|
+
- command_started_event:
|
456
|
+
command:
|
457
|
+
commitTransaction: 1
|
458
|
+
lsid: session0
|
459
|
+
txnNumber:
|
460
|
+
$numberLong: "1"
|
461
|
+
startTransaction:
|
462
|
+
autocommit: false
|
463
|
+
writeConcern:
|
464
|
+
command_name: commitTransaction
|
465
|
+
database_name: admin
|
466
|
+
- command_started_event:
|
467
|
+
command:
|
468
|
+
commitTransaction: 1
|
469
|
+
lsid: session0
|
470
|
+
txnNumber:
|
471
|
+
$numberLong: "1"
|
472
|
+
startTransaction:
|
473
|
+
autocommit: false
|
474
|
+
writeConcern:
|
475
|
+
command_name: commitTransaction
|
476
|
+
database_name: admin
|
477
|
+
|
478
|
+
outcome:
|
479
|
+
collection:
|
480
|
+
data:
|
481
|
+
- _id: 1
|
482
|
+
|
483
|
+
- description: add unknown commit label to retryable commit errors
|
484
|
+
|
485
|
+
failPoint:
|
486
|
+
configureFailPoint: failCommand
|
487
|
+
mode: { times: 2 }
|
488
|
+
data:
|
489
|
+
failCommands: ["commitTransaction"]
|
490
|
+
errorCode: 11602 # InterruptedDueToReplStateChange
|
491
|
+
|
492
|
+
operations:
|
493
|
+
- name: startTransaction
|
494
|
+
object: session0
|
495
|
+
- name: insertOne
|
496
|
+
object: collection
|
497
|
+
arguments:
|
498
|
+
session: session0
|
499
|
+
document:
|
500
|
+
_id: 1
|
501
|
+
result:
|
502
|
+
insertedId: 1
|
503
|
+
- name: commitTransaction
|
504
|
+
object: session0
|
505
|
+
result:
|
506
|
+
errorLabelsContain: ["UnknownTransactionCommitResult"]
|
507
|
+
errorLabelsOmit: ["TransientTransactionError"]
|
508
|
+
- name: commitTransaction
|
509
|
+
object: session0
|
510
|
+
|
511
|
+
expectations:
|
512
|
+
- command_started_event:
|
513
|
+
command:
|
514
|
+
insert: *collection_name
|
515
|
+
documents:
|
516
|
+
- _id: 1
|
517
|
+
ordered: true
|
518
|
+
readConcern:
|
519
|
+
lsid: session0
|
520
|
+
txnNumber:
|
521
|
+
$numberLong: "1"
|
522
|
+
startTransaction: true
|
523
|
+
autocommit: false
|
524
|
+
writeConcern:
|
525
|
+
command_name: insert
|
526
|
+
database_name: *database_name
|
527
|
+
- command_started_event:
|
528
|
+
command:
|
529
|
+
commitTransaction: 1
|
530
|
+
lsid: session0
|
531
|
+
txnNumber:
|
532
|
+
$numberLong: "1"
|
533
|
+
startTransaction:
|
534
|
+
autocommit: false
|
535
|
+
writeConcern:
|
536
|
+
command_name: commitTransaction
|
537
|
+
database_name: admin
|
538
|
+
- command_started_event:
|
539
|
+
command:
|
540
|
+
commitTransaction: 1
|
541
|
+
lsid: session0
|
542
|
+
txnNumber:
|
543
|
+
$numberLong: "1"
|
544
|
+
startTransaction:
|
545
|
+
autocommit: false
|
546
|
+
writeConcern:
|
547
|
+
command_name: commitTransaction
|
548
|
+
database_name: admin
|
549
|
+
- command_started_event:
|
550
|
+
command:
|
551
|
+
commitTransaction: 1
|
552
|
+
lsid: session0
|
553
|
+
txnNumber:
|
554
|
+
$numberLong: "1"
|
555
|
+
startTransaction:
|
556
|
+
autocommit: false
|
557
|
+
writeConcern:
|
558
|
+
command_name: commitTransaction
|
559
|
+
database_name: admin
|
560
|
+
|
561
|
+
outcome:
|
562
|
+
collection:
|
563
|
+
data:
|
564
|
+
- _id: 1
|
565
|
+
|
566
|
+
- description: add unknown commit label to writeConcernError ShutdownInProgress
|
567
|
+
|
568
|
+
failPoint:
|
569
|
+
configureFailPoint: failCommand
|
570
|
+
mode: { times: 2 }
|
571
|
+
data:
|
572
|
+
failCommands: ["commitTransaction"]
|
573
|
+
writeConcernError:
|
574
|
+
code: 91
|
575
|
+
errmsg: Replication is being shut down
|
576
|
+
|
577
|
+
operations:
|
578
|
+
- name: startTransaction
|
579
|
+
object: session0
|
580
|
+
arguments:
|
581
|
+
options:
|
582
|
+
writeConcern:
|
583
|
+
w: majority
|
584
|
+
- name: insertOne
|
585
|
+
object: collection
|
586
|
+
arguments:
|
587
|
+
session: session0
|
588
|
+
document:
|
589
|
+
_id: 1
|
590
|
+
result:
|
591
|
+
insertedId: 1
|
592
|
+
- name: commitTransaction
|
593
|
+
object: session0
|
594
|
+
result:
|
595
|
+
errorLabelsContain: ["UnknownTransactionCommitResult"]
|
596
|
+
errorLabelsOmit: ["TransientTransactionError"]
|
597
|
+
- name: commitTransaction
|
598
|
+
object: session0
|
599
|
+
|
600
|
+
expectations:
|
601
|
+
- command_started_event:
|
602
|
+
command:
|
603
|
+
insert: *collection_name
|
604
|
+
documents:
|
605
|
+
- _id: 1
|
606
|
+
ordered: true
|
607
|
+
readConcern:
|
608
|
+
lsid: session0
|
609
|
+
txnNumber:
|
610
|
+
$numberLong: "1"
|
611
|
+
startTransaction: true
|
612
|
+
autocommit: false
|
613
|
+
writeConcern:
|
614
|
+
command_name: insert
|
615
|
+
database_name: *database_name
|
616
|
+
- command_started_event:
|
617
|
+
command:
|
618
|
+
commitTransaction: 1
|
619
|
+
lsid: session0
|
620
|
+
txnNumber:
|
621
|
+
$numberLong: "1"
|
622
|
+
startTransaction:
|
623
|
+
autocommit: false
|
624
|
+
writeConcern:
|
625
|
+
w: majority
|
626
|
+
command_name: commitTransaction
|
627
|
+
database_name: admin
|
628
|
+
- command_started_event:
|
629
|
+
command:
|
630
|
+
commitTransaction: 1
|
631
|
+
lsid: session0
|
632
|
+
txnNumber:
|
633
|
+
$numberLong: "1"
|
634
|
+
startTransaction:
|
635
|
+
autocommit: false
|
636
|
+
writeConcern:
|
637
|
+
w: majority
|
638
|
+
command_name: commitTransaction
|
639
|
+
database_name: admin
|
640
|
+
- command_started_event:
|
641
|
+
command:
|
642
|
+
commitTransaction: 1
|
643
|
+
lsid: session0
|
644
|
+
txnNumber:
|
645
|
+
$numberLong: "1"
|
646
|
+
startTransaction:
|
647
|
+
autocommit: false
|
648
|
+
writeConcern:
|
649
|
+
w: majority
|
650
|
+
command_name: commitTransaction
|
651
|
+
database_name: admin
|
652
|
+
|
653
|
+
outcome:
|
654
|
+
collection:
|
655
|
+
data:
|
656
|
+
- _id: 1
|
657
|
+
|
658
|
+
- description: add unknown commit label to writeConcernError WriteConcernFailed
|
659
|
+
|
660
|
+
failPoint:
|
661
|
+
configureFailPoint: failCommand
|
662
|
+
mode: { times: 1 }
|
663
|
+
data:
|
664
|
+
failCommands: ["commitTransaction"]
|
665
|
+
writeConcernError:
|
666
|
+
code: 64 # WriteConcernFailed without wtimeout
|
667
|
+
errmsg: multiple errors reported
|
668
|
+
|
669
|
+
operations:
|
670
|
+
- name: startTransaction
|
671
|
+
object: session0
|
672
|
+
arguments:
|
673
|
+
options:
|
674
|
+
writeConcern:
|
675
|
+
w: majority
|
676
|
+
- name: insertOne
|
677
|
+
object: collection
|
678
|
+
arguments:
|
679
|
+
session: session0
|
680
|
+
document:
|
681
|
+
_id: 1
|
682
|
+
result:
|
683
|
+
insertedId: 1
|
684
|
+
- name: commitTransaction
|
685
|
+
object: session0
|
686
|
+
result:
|
687
|
+
errorLabelsContain: ["UnknownTransactionCommitResult"]
|
688
|
+
errorLabelsOmit: ["TransientTransactionError"]
|
689
|
+
- name: commitTransaction
|
690
|
+
object: session0
|
691
|
+
|
692
|
+
expectations:
|
693
|
+
- command_started_event:
|
694
|
+
command:
|
695
|
+
insert: *collection_name
|
696
|
+
documents:
|
697
|
+
- _id: 1
|
698
|
+
ordered: true
|
699
|
+
readConcern:
|
700
|
+
lsid: session0
|
701
|
+
txnNumber:
|
702
|
+
$numberLong: "1"
|
703
|
+
startTransaction: true
|
704
|
+
autocommit: false
|
705
|
+
writeConcern:
|
706
|
+
command_name: insert
|
707
|
+
database_name: *database_name
|
708
|
+
- command_started_event:
|
709
|
+
command:
|
710
|
+
commitTransaction: 1
|
711
|
+
lsid: session0
|
712
|
+
txnNumber:
|
713
|
+
$numberLong: "1"
|
714
|
+
startTransaction:
|
715
|
+
autocommit: false
|
716
|
+
writeConcern:
|
717
|
+
w: majority
|
718
|
+
command_name: commitTransaction
|
719
|
+
database_name: admin
|
720
|
+
- command_started_event:
|
721
|
+
command:
|
722
|
+
commitTransaction: 1
|
723
|
+
lsid: session0
|
724
|
+
txnNumber:
|
725
|
+
$numberLong: "1"
|
726
|
+
startTransaction:
|
727
|
+
autocommit: false
|
728
|
+
writeConcern:
|
729
|
+
w: majority
|
730
|
+
command_name: commitTransaction
|
731
|
+
database_name: admin
|
732
|
+
|
733
|
+
outcome:
|
734
|
+
collection:
|
735
|
+
data:
|
736
|
+
- _id: 1
|
737
|
+
|
738
|
+
- description: add unknown commit label to writeConcernError WriteConcernFailed with wtimeout
|
739
|
+
|
740
|
+
failPoint:
|
741
|
+
configureFailPoint: failCommand
|
742
|
+
mode: { times: 1 }
|
743
|
+
data:
|
744
|
+
failCommands: ["commitTransaction"]
|
745
|
+
writeConcernError:
|
746
|
+
code: 64
|
747
|
+
codeName: WriteConcernFailed
|
748
|
+
errmsg: waiting for replication timed out
|
749
|
+
errInfo: {wtimeout: True}
|
750
|
+
|
751
|
+
operations:
|
752
|
+
- name: startTransaction
|
753
|
+
object: session0
|
754
|
+
arguments:
|
755
|
+
options:
|
756
|
+
writeConcern:
|
757
|
+
w: majority
|
758
|
+
- name: insertOne
|
759
|
+
object: collection
|
760
|
+
arguments:
|
761
|
+
session: session0
|
762
|
+
document:
|
763
|
+
_id: 1
|
764
|
+
result:
|
765
|
+
insertedId: 1
|
766
|
+
- name: commitTransaction
|
767
|
+
object: session0
|
768
|
+
result:
|
769
|
+
errorLabelsContain: ["UnknownTransactionCommitResult"]
|
770
|
+
errorLabelsOmit: ["TransientTransactionError"]
|
771
|
+
- name: commitTransaction
|
772
|
+
object: session0
|
773
|
+
|
774
|
+
expectations:
|
775
|
+
- command_started_event:
|
776
|
+
command:
|
777
|
+
insert: *collection_name
|
778
|
+
documents:
|
779
|
+
- _id: 1
|
780
|
+
ordered: true
|
781
|
+
readConcern:
|
782
|
+
lsid: session0
|
783
|
+
txnNumber:
|
784
|
+
$numberLong: "1"
|
785
|
+
startTransaction: true
|
786
|
+
autocommit: false
|
787
|
+
writeConcern:
|
788
|
+
command_name: insert
|
789
|
+
database_name: *database_name
|
790
|
+
- command_started_event:
|
791
|
+
command:
|
792
|
+
commitTransaction: 1
|
793
|
+
lsid: session0
|
794
|
+
txnNumber:
|
795
|
+
$numberLong: "1"
|
796
|
+
startTransaction:
|
797
|
+
autocommit: false
|
798
|
+
writeConcern:
|
799
|
+
w: majority
|
800
|
+
command_name: commitTransaction
|
801
|
+
database_name: admin
|
802
|
+
- command_started_event:
|
803
|
+
command:
|
804
|
+
commitTransaction: 1
|
805
|
+
lsid: session0
|
806
|
+
txnNumber:
|
807
|
+
$numberLong: "1"
|
808
|
+
startTransaction:
|
809
|
+
autocommit: false
|
810
|
+
writeConcern:
|
811
|
+
w: majority
|
812
|
+
command_name: commitTransaction
|
813
|
+
database_name: admin
|
814
|
+
|
815
|
+
outcome:
|
816
|
+
collection:
|
817
|
+
data:
|
818
|
+
- _id: 1
|
819
|
+
|
820
|
+
- description: omit unknown commit label to writeConcernError UnsatisfiableWriteConcern
|
821
|
+
|
822
|
+
failPoint:
|
823
|
+
configureFailPoint: failCommand
|
824
|
+
mode: { times: 1 }
|
825
|
+
data:
|
826
|
+
failCommands: ["commitTransaction"]
|
827
|
+
writeConcernError:
|
828
|
+
code: 100 # UnsatisfiableWriteConcern/CannotSatisfyWriteConcern
|
829
|
+
errmsg: Not enough data-bearing nodes
|
830
|
+
|
831
|
+
operations:
|
832
|
+
- name: startTransaction
|
833
|
+
object: session0
|
834
|
+
arguments:
|
835
|
+
options:
|
836
|
+
writeConcern:
|
837
|
+
w: majority
|
838
|
+
- name: insertOne
|
839
|
+
object: collection
|
840
|
+
arguments:
|
841
|
+
session: session0
|
842
|
+
document:
|
843
|
+
_id: 1
|
844
|
+
result:
|
845
|
+
insertedId: 1
|
846
|
+
- name: commitTransaction
|
847
|
+
object: session0
|
848
|
+
result:
|
849
|
+
errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"]
|
850
|
+
|
851
|
+
expectations:
|
852
|
+
- command_started_event:
|
853
|
+
command:
|
854
|
+
insert: *collection_name
|
855
|
+
documents:
|
856
|
+
- _id: 1
|
857
|
+
ordered: true
|
858
|
+
readConcern:
|
859
|
+
lsid: session0
|
860
|
+
txnNumber:
|
861
|
+
$numberLong: "1"
|
862
|
+
startTransaction: true
|
863
|
+
autocommit: false
|
864
|
+
writeConcern:
|
865
|
+
command_name: insert
|
866
|
+
database_name: *database_name
|
867
|
+
- command_started_event:
|
868
|
+
command:
|
869
|
+
commitTransaction: 1
|
870
|
+
lsid: session0
|
871
|
+
txnNumber:
|
872
|
+
$numberLong: "1"
|
873
|
+
startTransaction:
|
874
|
+
autocommit: false
|
875
|
+
writeConcern:
|
876
|
+
w: majority
|
877
|
+
command_name: commitTransaction
|
878
|
+
database_name: admin
|
879
|
+
|
880
|
+
outcome:
|
881
|
+
collection:
|
882
|
+
data:
|
883
|
+
- _id: 1
|
884
|
+
|
885
|
+
- description: omit unknown commit label to writeConcernError UnknownReplWriteConcern
|
886
|
+
|
887
|
+
failPoint:
|
888
|
+
configureFailPoint: failCommand
|
889
|
+
mode: { times: 1 }
|
890
|
+
data:
|
891
|
+
failCommands: ["commitTransaction"]
|
892
|
+
writeConcernError:
|
893
|
+
code: 79 # UnknownReplWriteConcern
|
894
|
+
errmsg: No write concern mode named 'blah' found in replica set configuration
|
895
|
+
|
896
|
+
operations:
|
897
|
+
- name: startTransaction
|
898
|
+
object: session0
|
899
|
+
arguments:
|
900
|
+
options:
|
901
|
+
writeConcern:
|
902
|
+
w: majority
|
903
|
+
- name: insertOne
|
904
|
+
object: collection
|
905
|
+
arguments:
|
906
|
+
session: session0
|
907
|
+
document:
|
908
|
+
_id: 1
|
909
|
+
result:
|
910
|
+
insertedId: 1
|
911
|
+
- name: commitTransaction
|
912
|
+
object: session0
|
913
|
+
result:
|
914
|
+
errorLabelsOmit: ["TransientTransactionError", "UnknownTransactionCommitResult"]
|
915
|
+
|
916
|
+
expectations:
|
917
|
+
- command_started_event:
|
918
|
+
command:
|
919
|
+
insert: *collection_name
|
920
|
+
documents:
|
921
|
+
- _id: 1
|
922
|
+
ordered: true
|
923
|
+
readConcern:
|
924
|
+
lsid: session0
|
925
|
+
txnNumber:
|
926
|
+
$numberLong: "1"
|
927
|
+
startTransaction: true
|
928
|
+
autocommit: false
|
929
|
+
writeConcern:
|
930
|
+
command_name: insert
|
931
|
+
database_name: *database_name
|
932
|
+
- command_started_event:
|
933
|
+
command:
|
934
|
+
commitTransaction: 1
|
935
|
+
lsid: session0
|
936
|
+
txnNumber:
|
937
|
+
$numberLong: "1"
|
938
|
+
startTransaction:
|
939
|
+
autocommit: false
|
940
|
+
writeConcern:
|
941
|
+
w: majority
|
942
|
+
command_name: commitTransaction
|
943
|
+
database_name: admin
|
944
|
+
|
945
|
+
outcome:
|
946
|
+
collection:
|
947
|
+
data:
|
948
|
+
- _id: 1
|