diff --git a/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml index b2250a370b4..8b6001fb74e 100644 --- a/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml @@ -340,6 +340,8 @@ selector: - assumes_no_implicit_index_creation - assumes_unsharded_collection - cannot_create_unique_index_when_using_hashed_shard_key + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml index abfcdc1b421..df5469ade22 100644 --- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml @@ -370,6 +370,8 @@ selector: # Cannot retry a getMore command if a transient transaction or network error occurs during # it, since we won't know whether the cursor was advanced or not. - requires_getmore + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml index b8631bb3d20..d4e3cf62f58 100644 --- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml @@ -414,6 +414,9 @@ selector: # "Cowardly fail if unbounded dataSize is run with a mongod that had an unclean shutdown: ..." - requires_datasize + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active + executor: archive: hooks: diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml index 2fc3339b7ef..68bca7241a3 100644 --- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml @@ -423,6 +423,9 @@ selector: # "Cowardly fail if unbounded dataSize is run with a mongod that had an unclean shutdown: ..." - requires_datasize + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active + executor: archive: hooks: diff --git a/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml b/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml index bbde718e809..f950cc7360c 100644 --- a/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml +++ b/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml @@ -386,6 +386,8 @@ selector: - cannot_create_unique_index_when_using_hashed_shard_key - assumes_balancer_off - requires_fastcount + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml index ecb6490e3cc..b410d992b46 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml @@ -270,6 +270,8 @@ selector: - assumes_write_concern_unchanged # Transactions are not allowed to operate on capped collections. - requires_capped + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml index cb965534f2e..d1efa9fc8c3 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml @@ -358,6 +358,8 @@ selector: - operations_longer_than_stepdown_interval_in_txns # Transactions are not allowed to operate on capped collections. - requires_capped + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml index 1cccc9726bb..f7d0e6f0122 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml @@ -340,6 +340,8 @@ selector: - operations_longer_than_stepdown_interval_in_txns # Transactions are not allowed to operate on capped collections. - requires_capped + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml index 4d55d5db94d..fa050d52bfa 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml @@ -346,6 +346,8 @@ selector: - operations_longer_than_stepdown_interval_in_txns # Transactions are not allowed to operate on capped collections. - requires_capped + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml index d2e77b0d7f3..68fbd77c0f4 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml @@ -113,6 +113,8 @@ selector: ## 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 + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml index 4285f9ea501..1c5e2052f5c 100644 --- a/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml @@ -310,6 +310,8 @@ selector: - assumes_against_mongod_not_mongos # Transactions are not allowed to operate on capped collections. - requires_capped + # Retrying a query can change whether a plan cache entry is active. + - inspects_whether_plan_cache_entry_is_active executor: archive: diff --git a/jstests/core/plan_cache_list_plans.js b/jstests/core/plan_cache_list_plans.js index 51c200dbeeb..b0ae8497ba4 100644 --- a/jstests/core/plan_cache_list_plans.js +++ b/jstests/core/plan_cache_list_plans.js @@ -4,11 +4,12 @@ // # This test attempts to perform queries and introspect the server's plan cache entries. The // # former operation may be routed to a secondary in the replica set, whereas the latter must be // # routed to the primary. -// # If the balancer is on and chunks are moved, the plan cache can have entries with isActive: -// # false when the test assumes they are true because the query has already been run many times. // assumes_read_preference_unchanged, // does_not_support_stepdowns, +// # If the balancer is on and chunks are moved, the plan cache can have entries with isActive: +// # false when the test assumes they are true because the query has already been run many times. // assumes_balancer_off, +// inspects_whether_plan_cache_entry_is_active, // ] (function() { diff --git a/jstests/core/wildcard_index_cached_plans.js b/jstests/core/wildcard_index_cached_plans.js index 96b8cfa4055..634b7cb0368 100644 --- a/jstests/core/wildcard_index_cached_plans.js +++ b/jstests/core/wildcard_index_cached_plans.js @@ -1,11 +1,18 @@ /** * Test that cached plans which use wildcard indexes work. * - * This test attempts to perform queries and introspect the server's plan cache entries using the - * $planCacheStats aggregation source. Both operations must be routed to the primary, and the latter - * only supports 'local' readConcern. - * @tags: [assumes_read_preference_unchanged, assumes_read_concern_unchanged, - * does_not_support_stepdowns, assumes_balancer_off] + * @tags: [ + * # This test attempts to perform queries and introspect the server's plan cache entries using + * # the $planCacheStats aggregation source. Both operations must be routed to the primary, and + * # the latter only supports 'local' readConcern. + * assumes_read_preference_unchanged, + * assumes_read_concern_unchanged, + * does_not_support_stepdowns, + * # If the balancer is on and chunks are moved, the plan cache can have entries with isActive: + * # false when the test assumes they are true because the query has already been run many times. + * assumes_balancer_off, + * inspects_whether_plan_cache_entry_is_active, + * ] */ (function() { "use strict";