SERVER-124429 SERVER-124494 Fix targeting secondary nodes in disagg suites (#52570)

GitOrigin-RevId: a0c913d3b16bfb9afe0b5f1dca3e4e98e7d756a3
This commit is contained in:
Jan 2026-04-30 19:28:33 +02:00 committed by MongoDB Bot
parent dce2797727
commit a387352880
48 changed files with 297 additions and 74 deletions

View File

@ -15,7 +15,8 @@ executor:
shell_options:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');
global_vars:
TestData:
defaultReadConcernLevel: null
@ -56,6 +57,7 @@ selector:
- assumes_write_concern_unchanged
- assumes_against_mongod_not_mongos
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -20,6 +20,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicitly_shard_accessed_collections.js');
global_vars:
TestData:
@ -65,6 +66,7 @@ selector:
- assumes_unsharded_collection
- assumes_no_implicit_collection_creation_on_get_collection
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -20,6 +20,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicitly_shard_accessed_collections.js');;
await import('jstests/libs/override_methods/implicit_change_stream_v2.js');
global_vars:
@ -66,6 +67,7 @@ selector:
- assumes_unsharded_collection
- assumes_no_implicit_collection_creation_on_get_collection
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -16,6 +16,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicit_whole_cluster_changestreams.js');
global_vars:
TestData:
@ -58,6 +59,7 @@ selector:
- do_not_run_in_whole_cluster_passthrough
- assumes_against_mongod_not_mongos
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -0,0 +1,68 @@
##########################################################
# THIS IS A GENERATED FILE -- DO NOT MODIFY.
# IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE
# AND REGENERATE THE MATRIX SUITES.
#
# matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/change_streams_whole_cluster_secondary_reads_passthrough_v2.yml
# regenerate matrix suites: buildscripts/resmoke.py generate-matrix-suites
##########################################################
executor:
archive:
hooks:
- CheckReplDBHash
- ValidateCollections
config:
shell_options:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicit_whole_cluster_changestreams.js');;
await import('jstests/libs/override_methods/implicit_change_stream_v2.js');
global_vars:
TestData:
defaultReadConcernLevel: null
setShellParameter: defaultFindReplicaSetHostTimeoutMS=120000
fixture:
class: ShardedClusterFixture
mongod_options:
bind_ip_all: ""
set_parameters:
enableTestCommands: 1
logComponentVerbosity:
command: 1
query: 1
replication: 3
verbosity: 0
mongos_options:
bind_ip_all: ""
set_parameters:
enableTestCommands: 1
logComponentVerbosity:
command: 1
network:
asio: 2
verbosity: 1
verbosity: 0
num_mongos: 3
num_rs_nodes_per_shard: 2
hooks:
- class: CheckReplDBHash
- class: ValidateCollections
- class: CleanEveryN
n: 20
matrix_suite: true
selector:
exclude_files:
- jstests/change_streams/only_wake_getmore_for_relevant_changes.js
- jstests/change_streams/create_event_from_chunk_migration.js
- jstests/change_streams/migrate_last_chunk_from_shard_event.js
exclude_with_any_tags:
- assumes_write_concern_unchanged
- do_not_run_in_whole_cluster_passthrough
- assumes_against_mongod_not_mongos
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -20,6 +20,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicitly_shard_accessed_collections.js');;
await import('jstests/libs/override_methods/implicit_whole_cluster_changestreams.js');
global_vars:
@ -67,6 +68,7 @@ selector:
- assumes_unsharded_collection
- assumes_no_implicit_collection_creation_on_get_collection
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -20,6 +20,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicitly_shard_accessed_collections.js');;
await import('jstests/libs/override_methods/implicit_whole_cluster_changestreams.js');;
await import('jstests/libs/override_methods/implicit_change_stream_v2.js');
@ -70,6 +71,7 @@ selector:
- assumes_unsharded_collection
- assumes_no_implicit_collection_creation_on_get_collection
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -0,0 +1,58 @@
##########################################################
# THIS IS A GENERATED FILE -- DO NOT MODIFY.
# IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE
# AND REGENERATE THE MATRIX SUITES.
#
# matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/change_streams_whole_cluster_sharded_collections_passthrough_v2.yml
# regenerate matrix suites: buildscripts/resmoke.py generate-matrix-suites
##########################################################
executor:
archive:
hooks:
- CheckReplDBHash
- ValidateCollections
config:
shell_options:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/implicitly_shard_accessed_collections.js');;
await import('jstests/libs/override_methods/implicit_whole_cluster_changestreams.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicit_change_stream_v2.js');
global_vars:
TestData:
defaultReadConcernLevel: null
setShellParameter: defaultFindReplicaSetHostTimeoutMS=120000
fixture:
class: ShardedClusterFixture
mongod_options:
bind_ip_all: ""
set_parameters:
enableTestCommands: 1
periodicNoopIntervalSecs: 1
writePeriodicNoops: true
mongos_options:
bind_ip_all: ""
set_parameters:
enableTestCommands: 1
num_mongos: 3
num_shards: 2
hooks:
- class: CheckReplDBHash
- class: ValidateCollections
- class: CleanEveryN
n: 20
matrix_suite: true
selector:
exclude_files:
- jstests/change_streams/create_event_from_chunk_migration.js
- jstests/change_streams/migrate_last_chunk_from_shard_event.js
exclude_with_any_tags:
- assumes_write_concern_unchanged
- do_not_run_in_whole_cluster_passthrough
- assumes_against_mongod_not_mongos
- assumes_unsharded_collection
- assumes_no_implicit_collection_creation_on_get_collection
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -16,6 +16,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicit_whole_db_changestreams.js');
global_vars:
TestData:
@ -59,6 +60,7 @@ selector:
- do_not_run_in_whole_db_passthrough
- assumes_against_mongod_not_mongos
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -16,6 +16,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicit_whole_db_changestreams.js');;
await import('jstests/libs/override_methods/implicit_change_stream_v2.js');
global_vars:
@ -62,6 +63,7 @@ selector:
- do_not_run_in_whole_db_passthrough
- assumes_against_mongod_not_mongos
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -20,6 +20,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicitly_shard_accessed_collections.js');;
await import('jstests/libs/override_methods/implicit_whole_db_changestreams.js');
global_vars:
@ -68,6 +69,7 @@ selector:
- assumes_unsharded_collection
- assumes_no_implicit_collection_creation_on_get_collection
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -20,6 +20,7 @@ executor:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/set_read_preference_secondary.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicitly_shard_accessed_collections.js');;
await import('jstests/libs/override_methods/implicit_whole_db_changestreams.js');;
await import('jstests/libs/override_methods/implicit_change_stream_v2.js');
@ -71,6 +72,7 @@ selector:
- assumes_unsharded_collection
- assumes_no_implicit_collection_creation_on_get_collection
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -0,0 +1,59 @@
##########################################################
# THIS IS A GENERATED FILE -- DO NOT MODIFY.
# IF YOU WISH TO MODIFY THIS SUITE, MODIFY THE CORRESPONDING MATRIX SUITE MAPPING FILE
# AND REGENERATE THE MATRIX SUITES.
#
# matrix suite mapping file: buildscripts/resmokeconfig/matrix_suites/mappings/change_streams_whole_db_sharded_collections_passthrough_v2.yml
# regenerate matrix suites: buildscripts/resmoke.py generate-matrix-suites
##########################################################
executor:
archive:
hooks:
- CheckReplDBHash
- ValidateCollections
config:
shell_options:
eval:
globalThis.testingReplication = true; await import('jstests/libs/override_methods/set_read_and_write_concerns.js');;
await import('jstests/libs/override_methods/implicitly_shard_accessed_collections.js');;
await import('jstests/libs/override_methods/implicit_whole_db_changestreams.js');;
await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');;
await import('jstests/libs/override_methods/implicit_change_stream_v2.js');
global_vars:
TestData:
defaultReadConcernLevel: null
setShellParameter: defaultFindReplicaSetHostTimeoutMS=120000
fixture:
class: ShardedClusterFixture
mongod_options:
bind_ip_all: ""
set_parameters:
enableTestCommands: 1
periodicNoopIntervalSecs: 1
writePeriodicNoops: true
mongos_options:
bind_ip_all: ""
set_parameters:
enableTestCommands: 1
num_mongos: 3
num_shards: 2
hooks:
- class: CheckReplDBHash
- class: ValidateCollections
- class: CleanEveryN
n: 20
matrix_suite: true
selector:
exclude_files:
- jstests/change_streams/metadata_notifications.js
- jstests/change_streams/create_event_from_chunk_migration.js
- jstests/change_streams/migrate_last_chunk_from_shard_event.js
exclude_with_any_tags:
- assumes_write_concern_unchanged
- do_not_run_in_whole_db_passthrough
- assumes_against_mongod_not_mongos
- assumes_unsharded_collection
- assumes_no_implicit_collection_creation_on_get_collection
roots:
- jstests/change_streams/**/*.js
test_kind: js_test

View File

@ -6,6 +6,7 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.secondary_reads_excludes"

View File

@ -13,9 +13,8 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.sharded_collections_passthrough_eval"
#uncomment this line if you comment out the secondary reads portion of this file
# - "change_streams.causal_consistency"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -13,10 +13,9 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.change_streams_v2_eval"
#uncomment this line if you comment out the secondary reads portion of this file
# - "change_streams.causal_consistency"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -4,7 +4,7 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -6,7 +6,7 @@ overrides:
- "multiversion.sharded_fixture_last_continuous_new_old_old_new"
eval:
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -6,7 +6,7 @@ overrides:
- "multiversion.sharded_fixture_last_lts_new_old_old_new"
eval:
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -4,6 +4,6 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.whole_cluster_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"

View File

@ -5,7 +5,7 @@ overrides:
eval:
- "change_streams.whole_cluster_eval"
- "change_streams.change_streams_v2_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"

View File

@ -6,6 +6,7 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.whole_cluster_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"

View File

@ -0,0 +1,15 @@
base_suite: change_streams_whole_cluster_passthrough
overrides:
- "change_streams.mongos_passthrough"
- "change_streams.secondary_reads"
- "change_streams.disable_write_noops"
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.whole_cluster_eval"
- "change_streams.change_streams_v2_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.secondary_reads_excludes"
- "change_streams.change_streams_v2_excludes"

View File

@ -15,10 +15,9 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.whole_cluster_eval"
#uncomment this line if you comment out the secondary reads portion of this file
# - "change_streams.causal_consistency"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -15,11 +15,10 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.whole_cluster_eval"
- "change_streams.change_streams_v2_eval"
#uncomment this line if you comment out the secondary reads portion of this file
# - "change_streams.causal_consistency"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -5,7 +5,7 @@ overrides:
eval:
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.whole_cluster_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -0,0 +1,13 @@
base_suite: change_streams_whole_cluster_passthrough
overrides:
- "change_streams.mongos_passthrough"
- "change_streams.base_eval"
eval:
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.whole_cluster_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.change_streams_v2_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"
- "change_streams.change_streams_v2_excludes"

View File

@ -4,6 +4,6 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.whole_db_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"

View File

@ -5,7 +5,7 @@ overrides:
eval:
- "change_streams.whole_db_eval"
- "change_streams.change_streams_v2_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.change_streams_v2_excludes"

View File

@ -6,6 +6,7 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.whole_db_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"

View File

@ -6,6 +6,7 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.whole_db_eval"
- "change_streams.change_streams_v2_eval"
excludes:

View File

@ -15,10 +15,9 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.whole_db_eval"
#uncomment this line if you comment out the secondary reads portion of this file
# - "change_streams.causal_consistency"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -15,11 +15,10 @@ overrides:
- "change_streams.base_eval"
eval:
- "change_streams.secondary_reads_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.whole_db_eval"
- "change_streams.change_streams_v2_eval"
#uncomment this line if you comment out the secondary reads portion of this file
# - "change_streams.causal_consistency"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -5,7 +5,7 @@ overrides:
eval:
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.whole_db_eval"
- "change_streams.causal_consistency"
- "change_streams.causal_consistency_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"

View File

@ -0,0 +1,13 @@
base_suite: change_streams_whole_db_passthrough
overrides:
- "change_streams.mongos_passthrough"
- "change_streams.base_eval"
eval:
- "change_streams.sharded_collections_passthrough_eval"
- "change_streams.whole_db_eval"
- "change_streams.causal_consistency_eval"
- "change_streams.change_streams_v2_eval"
excludes:
- "change_streams.mongos_passthrough_excludes"
- "change_streams.sharded_collections_passthrough_excludes"
- "change_streams.change_streams_v2_excludes"

View File

@ -10,7 +10,7 @@
globalThis.testingReplication = true;
await import('jstests/libs/override_methods/set_read_and_write_concerns.js');
- name: causal_consistency
- name: causal_consistency_eval
value:
eval: await import('jstests/libs/override_methods/enable_causal_consistency_without_read_pref.js');
@ -113,6 +113,7 @@
value:
exclude_with_any_tags:
- assumes_read_preference_unchanged
- does_not_support_causal_consistency
exclude_files:
- jstests/change_streams/only_wake_getmore_for_relevant_changes.js

View File

@ -6,7 +6,10 @@
* requires_getmore,
* # TODO SERVER-123932: Remove the 'assumes_against_mongod_not_mongos' tag once the metrics are available on mongos.
* assumes_against_mongod_not_mongos,
* # The test assumes that cursors are opened on the primary, which is not guaranteed when change streams
* # are opened on secondaries.
* assumes_no_implicit_cursor_exhaustion,
* assumes_read_preference_unchanged,
* requires_fcv_90
* ]
*/

View File

@ -2,6 +2,8 @@
* Tests that change streams correctly handle rewrites of null, existence and equality checks, for
* both existent and non-existent fields and subfields.
* @tags: [
* # The test runs a lot of queries and is massively slower when running against a secondary.
* assumes_read_preference_unchanged,
* requires_pipeline_optimization,
* uses_change_streams,
* # This test runs too long to be included in code coverage:

View File

@ -2,6 +2,8 @@
* Tests that change streams correctly handle rewrites of null, existence and equality checks, for
* both existent and non-existent fields and subfields.
* @tags: [
* # The test runs a lot of queries and is massively slower when running against a secondary.
* assumes_read_preference_unchanged,
* requires_pipeline_optimization,
* uses_change_streams,
* # This test runs too long to be included in code coverage:

View File

@ -2,6 +2,8 @@
* Tests that change streams correctly handle rewrites of null, existence and equality checks, for
* both existent and non-existent fields and subfields.
* @tags: [
* # The test runs a lot of queries and is massively slower when running against a secondary.
* assumes_read_preference_unchanged,
* requires_pipeline_optimization,
* uses_change_streams,
* # This test runs too long to be included in code coverage:

View File

@ -1,12 +1,14 @@
//
// Basic $changeStream tests for operations that perform queryable encryption.
//
// @tags: [
// change_stream_does_not_expect_txns,
// assumes_unsharded_collection,
// requires_fcv_71
// ]
//
/**
* Basic $changeStream tests for operations that perform queryable encryption.
*
* @tags: [
* # The test is not compatible with opening change streams on secondaries.
* assumes_read_preference_unchanged,
* change_stream_does_not_expect_txns,
* assumes_unsharded_collection,
* requires_fcv_71
* ]
*/
import {EncryptedClient, isEnterpriseShell} from "jstests/fle2/libs/encrypted_client_util.js";
import {canonicalizeEventForTesting, ChangeStreamTest} from "jstests/libs/query/change_stream_util.js";

View File

@ -3,6 +3,9 @@
* command output.
*
* @tags: [
* # The test assumes that serverStatus metrics are retrieved from the same instance that the
* # change streams are opened on, which is not guaranteed when change streams are opened on secondaries.
* assumes_read_preference_unchanged,
* change_stream_does_not_expect_txns,
* # Can be removed once last-lts and last-continuous are >= 9.0.
* requires_fcv_90,

View File

@ -2,7 +2,6 @@
* Use prototype overrides to set read preference to "secondary" when running tests.
*/
import {OverrideHelpers} from "jstests/libs/override_methods/override_helpers.js";
import {extractUUIDFromObject} from "jstests/libs/uuid_util.js";
const kReadPreferenceSecondary = {
mode: "secondary",
@ -37,20 +36,6 @@ const CursorTracker = (function () {
};
})();
/**
* Returns a random integer between the given range (inclusive).
*/
function getRandInteger(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
/**
* Returns a random element in the given array.
*/
function getRandomElement(arr) {
return arr[getRandInteger(0, arr.length - 1)];
}
function runCommandWithReadPreferenceSecondary(conn, dbName, commandName, commandObj, func, makeFuncArgs) {
if (typeof commandObj !== "object" || commandObj === null) {
return func.apply(conn, makeFuncArgs(commandObj));
@ -64,7 +49,7 @@ function runCommandWithReadPreferenceSecondary(conn, dbName, commandName, comman
);
}
if (conn.isReplicaSetConnection() || TestData.connectDirectlyToRandomSubsetOfSecondaries) {
if (conn.isReplicaSetConnection()) {
// When a "getMore" or "killCursors" command is issued on a replica set connection, we
// attempt to automatically route the command to the server the cursor(s) were
// originally established on. This makes it possible to use the
@ -132,6 +117,10 @@ function runCommandWithReadPreferenceSecondary(conn, dbName, commandName, comman
// only accepts 'local' read concern. While valid, these options would not ensure causal
// consistency.
shouldForceReadPreference = false;
} else if (OverrideHelpers.isAggregationWithOutOrMergeStage(commandName, commandObj)) {
// Can't set a secondary read preference on aggregation pipelines containing $out or
// $merge, because the pipeline needs to write to the collection.
shouldForceReadPreference = false;
}
}
@ -160,7 +149,7 @@ function runCommandWithReadPreferenceSecondary(conn, dbName, commandName, comman
const serverResponse = func.apply(conn, makeFuncArgs(commandObj));
if (
(conn.isReplicaSetConnection() || TestData.connectDirectlyToRandomSubsetOfSecondaries) &&
conn.isReplicaSetConnection() &&
kCursorGeneratingCommands.has(commandName) &&
serverResponse.ok === 1 &&
serverResponse.hasOwnProperty("cursor")

View File

@ -147,11 +147,6 @@ void ensureChangeStreamReadPreferenceCanBeSatisfied(OperationContext* opCtx,
return;
}
const auto& provider = rss::ReplicatedStorageService::get(opCtx).getPersistenceProvider();
if (!provider.enforcesChangeStreamReadPreferenceOnGetMore()) {
return;
}
const auto readPref = cursorPin->getReadPreferenceSetting().pref;
// Flexible preferences are always satisfiable regardless of node role.

View File

@ -238,8 +238,4 @@ bool AttachedPersistenceProvider::supportsColdCollections() const {
return false;
}
bool AttachedPersistenceProvider::enforcesChangeStreamReadPreferenceOnGetMore() const {
return true;
}
} // namespace mongo::rss

View File

@ -238,11 +238,6 @@ public:
* Attached storage does not support cold collections.
*/
bool supportsColdCollections() const override;
/**
* Attached storage supports read preference enforcement for change streams.
*/
bool enforcesChangeStreamReadPreferenceOnGetMore() const override;
};
} // namespace mongo::rss

View File

@ -285,11 +285,6 @@ public:
* If true, the provider supports cold collections.
*/
virtual bool supportsColdCollections() const = 0;
/**
* If true, the provider enforces read preference on getMore commands for change stream cursors.
*/
virtual bool enforcesChangeStreamReadPreferenceOnGetMore() const = 0;
};
} // namespace rss

View File

@ -270,12 +270,6 @@ public:
uasserted(mongo::ErrorCodes::NotImplemented,
"StubPersistenceProvider::supportsColdCollections() method not implemented");
}
bool enforcesChangeStreamReadPreferenceOnGetMore() const override {
uasserted(mongo::ErrorCodes::NotImplemented,
"StubPersistenceProvider::enforcesChangeStreamReadPreferenceOnGetMore() method "
"not implemented");
}
};
} // namespace mongo::rss