# TODO: Move over to matrix suites. test_kind: multi_stmt_txn_passthrough selector: roots: - jstests/core/**/*.js exclude_files: # These tests run in the jscore_txn passthrough suites. - jstests/core/txns/**/*.js # The following tests fail because a certain command or functionality is not supported by # mongos. This command or functionality is placed in a comment next to the failing test. - jstests/core/**/apitest_db.js # serverStatus output doesn't have storageEngine. - jstests/core/**/awaitdata_getmore_cmd.js # capped collections. - jstests/core/**/bypass_doc_validation.js # sharded $out output not permitted - jstests/core/**/check_shard_index.js # checkShardingIndex. - jstests/core/**/collection_truncate.js # emptycapped. - jstests/core/**/compact_keeps_indexes.js # compact. - jstests/core/**/currentop.js # uses fsync. - jstests/core/**/dbhash.js # dbhash. - jstests/core/**/dbhash2.js # dbhash. - jstests/core/**/fsync.js # uses fsync. - jstests/core/**/geo_s2cursorlimitskip.js # profiling. - jstests/core/**/geo_update_btree2.js # notablescan. - jstests/core/**/index9.js # "local" database. - jstests/core/**/queryoptimizera.js # "local" database. - jstests/core/**/stages*.js # stageDebug. - jstests/core/**/startup_log.js # "local" database. - jstests/core/**/tailable_cursor_invalidation.js # capped collections. - jstests/core/**/tailable_getmore_batch_size.js # capped collections. - jstests/core/**/tailable_skip_limit.js # capped collections. - jstests/core/**/top.js # top. # The following tests fail because mongos behaves differently from mongod when testing certain # functionality. The differences are in a comment next to the failing test. - jstests/core/**/explain_missing_database.js # Behavior with no db different on mongos, SERVER-18047. - jstests/core/**/geo_2d_explain.js # executionSuccess in different spot in explain(). - jstests/core/**/geo_s2explain.js # inputStage in different spot in explain(). - jstests/core/**/geo_s2sparse.js # keysPerIndex in different spot in validate(). - jstests/core/**/operation_latency_histogram.js # Stats are counted differently on mongos, SERVER-24880. # The following tests fail because they count indexes. These counts do not take into account the # additional hashed shard key indexes that are automatically added by this passthrough. - jstests/core/**/apitest_dbcollection.js - jstests/core/**/bad_index_plugin.js - jstests/core/**/create_indexes.js - jstests/core/**/list_indexes_non_existent_ns.js - jstests/core/**/mr_preserve_indexes.js # The following tests fail because they expect no databases to be created. However a DB is created # automatically when we shard a collection. - jstests/core/**/dbcase.js - jstests/core/**/dbcase2.js - jstests/core/**/no_db_created.js - jstests/core/**/killop_drop_collection.js # Uses fsyncLock. # These tests fail because sharded clusters do not clean up correctly after failed index builds. # See SERVER-33207 as an example. - jstests/core/**/geo_borders.js # TODO: Remove after fixing SERVER-29449. executionStats.nReturned is incorrect for sharded # queries with a limit or for distinct commands. - jstests/core/**/distinct_index1.js - jstests/core/**/explain1.js - jstests/core/**/explain4.js - jstests/core/**/sortk.js # TODO: Remove after fixing SERVER-32563. The implementation of explain for the count command is # incorrect on sharded collections. - jstests/core/**/explain_count.js - jstests/core/**/explain_server_params.js # TODO SERVER-32311: These tests use plan stage helpers which can't handle sharded explain output. - jstests/core/**/expr_index_use.js - jstests/core/**/index_multikey.js - jstests/core/**/optimized_match_explain.js - jstests/core/**/sort_array.js ## ## Limitations with the way the runner file injects transactions. ## # These tests expects some statements to error, which will cause txns to abort entirely. - jstests/core/**/bulk_api_ordered.js - jstests/core/**/bulk_api_unordered.js - jstests/core/**/commands_with_uuid.js - jstests/core/**/dbcase.js - jstests/core/**/dbcase2.js - jstests/core/**/explain_execution_error.js - jstests/core/**/expr.js - jstests/core/**/find9.js - jstests/core/**/find_getmore_bsonsize.js - jstests/core/**/find_getmore_cmd.js - jstests/core/**/geo_allowedcomparisons.js - jstests/core/**/geo_big_polygon2.js - jstests/core/**/geonear_key.js - jstests/core/**/in.js - jstests/core/**/index8.js # No explicit check for failed command. - jstests/core/**/index_decimal.js - jstests/core/**/index_large_and_small_dates.js - jstests/core/**/index_multiple_compatibility.js - jstests/core/**/index_partial_write_ops.js - jstests/core/**/indexa.js # No explicit check for failed command. - jstests/core/**/indexes_multiple_commands.js - jstests/core/**/js2.js - jstests/core/json_schema/json_schema.js - jstests/core/**/mr_bigobject.js - jstests/core/**/not2.js - jstests/core/**/null_query_semantics.js - jstests/core/**/or1.js - jstests/core/**/or2.js - jstests/core/**/or3.js - jstests/core/**/orj.js - jstests/core/**/ref.js - jstests/core/**/ref4.js - jstests/core/**/regex_limit.js - jstests/core/**/remove_undefined.js - jstests/core/**/set7.js - jstests/core/**/sortb.js - jstests/core/**/sortf.js - jstests/core/**/sortg.js - jstests/core/**/sortj.js - jstests/core/**/sort_with_meta_operator.js - jstests/core/**/tailable_skip_limit.js - jstests/core/**/type_array.js - jstests/core/**/uniqueness.js - jstests/core/**/unset2.js - jstests/core/**/update_addToSet.js - jstests/core/**/update_arrayFilters.js - jstests/core/**/update_find_and_modify_id.js - jstests/core/**/update_modifier_pop.js - jstests/core/**/updateh.js - jstests/core/**/updatej.js # TODO: SERVER-38207 Cannot insert document with MaxKey shard key. - jstests/core/**/type8.js ## ## Some aggregation stages don't support snapshot readconcern. ## # explain (requires read concern local) - jstests/core/**/agg_hint.js - jstests/core/**/and.js - jstests/core/**/collation.js - jstests/core/**/explain_shell_helpers.js - jstests/core/**/index_partial_read_ops.js - jstests/core/**/optimized_match_explain.js - jstests/core/**/sort_array.js - jstests/core/views/views_collation.js - jstests/core/**/wildcard_index_count.js - jstests/core/**/explain_server_params.js # $listSessions - jstests/core/**/list_all_local_sessions.js - jstests/core/**/list_all_sessions.js - jstests/core/**/list_sessions.js # $collStats - jstests/core/**/operation_latency_histogram.js - jstests/core/views/views_coll_stats.js - jstests/core/views/views_stats.js # Errors expected to happen in tests, which can cause transactions to get aborted. # So when the test tries to inspect the documents it can be out of sync (relative # to test run without multi statement transactions). - jstests/core/**/bulk_api_ordered.js - jstests/core/**/bulk_api_unordered.js - jstests/core/**/doc_validation.js - jstests/core/**/doc_validation_options.js - jstests/core/**/field_name_validation.js - jstests/core/**/insert_illegal_doc.js - jstests/core/**/push_sort.js - jstests/core/**/update_arrayFilters.js - jstests/core/**/update_dbref.js - jstests/core/**/updatel.js - jstests/core/**/write_result.js - jstests/core/**/positional_projection.js # Trick for bypassing mongo shell validation in the test doesn't work because txn_override # retry logic will hit the shell validation. - jstests/core/**/invalid_db_name.js # Multiple writes in a txn, some of which fail because the collection doesn't exist. # We create the collection and retry the last write, but previous writes would have # still failed. - jstests/core/**/dbref1.js - jstests/core/**/dbref2.js - jstests/core/**/ref3.js - jstests/core/**/update3.js ## ## Misc. reasons. ## # SERVER-34868 Cannot run a legacy query on a session. - jstests/core/**/exhaust.js # SERVER-34772 Tailable Cursors are not allowed with snapshot readconcern. - jstests/core/**/awaitdata_getmore_cmd.js - jstests/core/**/getmore_cmd_maxtimems.js - jstests/core/**/tailable_cursor_invalidation.js - jstests/core/**/tailable_getmore_batch_size.js # Wrong count for top info (WriteLock) - jstests/core/**/top.js # Expects collection to not have been created - jstests/core/**/insert_id_undefined.js # Creates sessions explicitly, resulting in txns being run through different sessions # using a single txnNumber. - jstests/core/json_schema/misc_validation.js - jstests/core/views/views_all_commands.js # dropDatabase is not resilient to stepdowns on sharded cluster - jstests/core/**/dropdb.js # Committing a transaction when the server is fsync locked fails. - jstests/core/**/fsync.js # Expects legacy errors ($err). - jstests/core/**/constructors.js # txn interrupted by command outside of txn before getMore runs. - jstests/core/**/commands_namespace_parsing.js - jstests/core/**/drop3.js - jstests/core/**/geo_s2cursorlimitskip.js - jstests/core/**/getmore_invalidated_cursors.js - jstests/core/**/getmore_invalidated_documents.js - jstests/core/**/kill_cursors.js - jstests/core/**/list_indexes.js - jstests/core/**/oro.js - jstests/core/**/sort_with_update_between_getmores.js # Parallel Shell - we do not signal the override to end a txn when a parallel shell closes. - jstests/core/**/awaitdata_getmore_cmd.js - jstests/core/**/compact_keeps_indexes.js - jstests/core/**/count10.js - jstests/core/**/count_plan_summary.js - jstests/core/**/coveredIndex3.js - jstests/core/**/currentop.js - jstests/core/**/distinct3.js - jstests/core/**/find_and_modify_concurrent_update.js - jstests/core/**/fsync.js - jstests/core/**/geo_update_btree.js - jstests/core/**/killop_drop_collection.js - jstests/core/**/loadserverscripts.js - jstests/core/**/mr_killop.js - jstests/core/**/removeb.js - jstests/core/**/removec.js - jstests/core/**/shellstartparallel.js - jstests/core/**/updatef.js # Command expects to see result from parallel operation. # E.g. Suppose the following sequence of events: op1, join() op2 in parallel shell, op3. # op3 will still be using the snapshot from op1, and not see op2 at all. - jstests/core/**/bench_test1.js - jstests/core/**/benchrun_pipeline_updates.js - jstests/core/**/cursora.js # auto_retry_on_network_error.js will timeout with assert.soon and give a different error from # what test expects. Excluding from suite since it doesn't really do any database operations, so # it doesn't provide value here. - jstests/core/**/connection_string_validation.js # Does not support tojson of command objects. - jstests/core/**/SERVER-23626.js # Examines _id of upserted document. - jstests/core/**/find_and_modify_server7660.js - jstests/core/**/upsert_shell.js # This file is testing resmoke's multiversion framework, not Server behavior - jstests/core/**/mixed_version_replica_set.js exclude_with_any_tags: ## # The next four tags correspond to the special errors thrown by the auto_retry_on_network_error.js # override when it refuses to run a certain command. Above each tag are the message(s) that cause # the tag to be warranted. ## # "Refusing to run a test that issues a getMore command since if a network error occurs during # it then we won't know whether the cursor was advanced or not" - requires_getmore # "Refusing to run a test that issues non-retryable write operations since the test likely makes # assertions on the write results and can lead to spurious failures if a network error occurs" - requires_non_retryable_writes # "Refusing to run a test that issues commands that are not blindly retryable" # "Refusing to run a test that issues an aggregation command with $out because it is not # retryable" - requires_non_retryable_commands # "Refusing to run a test that issues commands that may return different values after a failover" # "Refusing to run a test that issues an aggregation command with explain because it may return # incomplete results" # "Refusing to run a test that issues an aggregation command with $listLocalCursors or # $listLocalSessions because they rely on in-memory state that may not survive failovers" # "Refusing to run a test that issues a mapReduce command, because it calls std::terminate() if # interrupted by a stepdown" - does_not_support_stepdowns ## # The next tags correspond to the special errors thrown by the # set_read_and_write_concerns.js override when it refuses to replace the readConcern or # writeConcern of a particular command. Above each tag are the message(s) that cause the tag to be # warranted. ## # "Cowardly refusing to override read concern of command: ..." - assumes_read_concern_unchanged # "writeConcern is not allowed within a multi-statement transaction" - assumes_write_concern_unchanged # The next tag corresponds to long running-operations, as they may exhaust their number # of retries and result in a network error being thrown. - operations_longer_than_stepdown_interval # This tag corresponds to operations which are run long enough to exceed the stepdown interval # when grouped into transactions - operations_longer_than_stepdown_interval_in_txns - assumes_against_mongod_not_mongos - assumes_standalone_mongod # Tests tagged with the following will fail because they assume collections are not sharded. - assumes_no_implicit_collection_creation_after_drop - assumes_no_implicit_index_creation - assumes_unsharded_collection - cannot_create_unique_index_when_using_hashed_shard_key # The next tags correspond to the special errors thrown by the # fail_unclean_shutdown_incompatible_commands.js override when it refuses to run commands that are # inaccurate after an unclean shutdown. Above each tag is the message that causes the tag to be # warranted. ## # "Cowardly fail if fastcount is run with a mongod that had an unclean shutdown: ..." - requires_fastcount # "Cowardly fail if dbStats is run with a mongod that had an unclean shutdown: ..." - requires_dbstats # "Cowardly fail if collStats is run with a mongod that had an unclean shutdown: ..." - requires_collstats # "Cowardly fail if startParallelShell is run with a mongod that had an unclean shutdown: ..." - uses_parallel_shell # system.profile collection doesn't exist on mongos. Also, transactions are not allowed to operate # on capped collections. - requires_profiling # Snapshot reads in transactions are banned on capped collections. - requires_capped # Retrying a query can change whether a plan cache entry is active. - inspects_whether_plan_cache_entry_is_active - does_not_support_transactions # Transaction-continuing commands must use the same API parameters as the first command, so tests # that use API parameters cannot be run with transactions. - uses_api_parameters # Used for tests which can run in multiversion configurations but cannot run while a replica set # or shard is being actively upgraded or downgraded. - cannot_run_during_upgrade_downgrade - requires_timeseries # Transactions not supported executor: archive: hooks: - CheckReplDBHash - CheckReplOplogs - ValidateCollections config: shell_options: # Note: fail_unclean_shutdown_incompatible_commands.js not included because it conflicts with # implicitly_shard_accessed_collections.js use of collstats (usage is safe with unclean # shutdown). Workaround by relying on the requires_fastcount/dbstats/collstats/datasize and # uses_parallel_shell tags to denylist tests that uses them unsafely. eval: >- var testingReplication = true; load('jstests/libs/override_methods/network_error_and_txn_override.js'); db = connect(TestData.connectionString); load("jstests/libs/override_methods/enable_sessions.js"); load("jstests/libs/override_methods/fail_unclean_shutdown_start_parallel_shell.js"); load('jstests/libs/override_methods/txn_passthrough_cmd_massage.js'); load('jstests/libs/override_methods/implicitly_shard_accessed_collections.js'); global_vars: TestData: logRetryAttempts: true networkErrorAndTxnOverrideConfig: retryOnNetworkErrors: true wrapCRUDinTransactions: true overrideRetryAttempts: 3 sessionOptions: # Read your own writes is not guaranteed without causal consistency if all nodes are # electable. causalConsistency: true retryWrites: true # We specify nodb so the shell used by each test will attempt to connect after loading the # retry logic in auto_retry_on_network_error.js. nodb: "" hooks: # We use a stepdown interval of 15 seconds because we will retry all commands in a transaction # so we need to allow time for at most 10 operations to be re-run and then re-committed. If # too many network errors occur when re-running a transaction we will run out of retries. - class: ContinuousStepdown config_stepdown: false should_downgrade: true stepdown_interval_ms: 15000 - class: RunChangeStreamsInBackground # The CheckReplDBHash hook waits until all operations have replicated to and have been applied # on the secondaries, so we run the ValidateCollections hook after it to ensure we're # validating the entire contents of the collection. - class: CheckReplOplogs - class: CheckReplDBHash - class: ValidateCollections shell_options: global_vars: TestData: checkCollectionCounts: true fixture: class: ShardedClusterFixture mongos_options: set_parameters: enableTestCommands: 1 mongod_options: syncdelay: 5 oplogSize: 1024 set_parameters: # TODO: add log verbosity to _builder.py instead so multiversion works. enableTestCommands: 1 enableElectionHandoff: 0 numInitialSyncAttempts: 1 num_shards: 2 num_rs_nodes_per_shard: 2 configsvr_options: mongod_options: set_parameters: enableTestCommands: 1 shard_options: all_nodes_electable: true replset_config_options: settings: catchUpTimeoutMillis: 0