summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiangyu Yao <xiangyu.yao@mongodb.com>2018-04-16 00:31:24 -0400
committerXiangyu Yao <xiangyu.yao@mongodb.com>2018-09-07 19:01:49 -0400
commit734fac1d52a2203d5053bb0bdd5af9edd35d61e8 (patch)
treefaf5119d1f09a076be0c8d4dcc61fd94b4e57529
parentf3acd4a1e259b1f1fcdd51d23ad2519369257dbf (diff)
downloadmongo-734fac1d52a2203d5053bb0bdd5af9edd35d61e8.tar.gz
SERVER-34384 Add passthrough test for secondary reads
(cherry picked from commit d62890ffeacd2e911ff4a36f01bdef498c101c07)
-rw-r--r--buildscripts/resmokeconfig/suites/secondary_reads_passthrough.yml134
-rw-r--r--etc/evergreen.yml24
-rw-r--r--jstests/core/apitest_dbcollection.js5
-rw-r--r--jstests/core/auth1.js2
-rw-r--r--jstests/core/auth_copydb.js7
-rw-r--r--jstests/core/connection_status.js6
-rw-r--r--jstests/core/rename7.js2
-rw-r--r--jstests/core/role_management_helpers.js6
-rw-r--r--jstests/core/user_management_helpers.js6
-rw-r--r--jstests/core/validate_user_documents.js6
10 files changed, 190 insertions, 8 deletions
diff --git a/buildscripts/resmokeconfig/suites/secondary_reads_passthrough.yml b/buildscripts/resmokeconfig/suites/secondary_reads_passthrough.yml
new file mode 100644
index 00000000000..c32a2b7a5c8
--- /dev/null
+++ b/buildscripts/resmokeconfig/suites/secondary_reads_passthrough.yml
@@ -0,0 +1,134 @@
+test_kind: js_test
+
+selector:
+ roots:
+ - jstests/core/**/*.js
+ exclude_files:
+ # Operations within a transaction do not support write concern.
+ - jstests/core/txns/**/*.js
+ # These tests are not expected to pass with replica-sets:
+ - jstests/core/dbadmin.js
+ - jstests/core/opcounters_write_cmd.js
+ - jstests/core/read_after_optime.js
+ - jstests/core/capped_update.js
+ # These tests attempt to read from the "system.profile" collection, which may be missing entries
+ # if a write was performed on the primary of the replica set instead.
+ - jstests/core/*profile*.js
+ # Two cursors can be established on different secondaries, so the count of
+ # $listLocalCursors will not always be 2.
+ - jstests/core/list_all_local_cursors.js
+
+ # Tests that fail for Causal Consistency with default injected readPreference 'secondary'
+ # "TODO SERVER-30384: These tests assume that documents are returned in the same order they are
+ # written when no sort is specified; however, the order of documents within a collection can
+ # be different across a primary and secondary."
+ - jstests/core/coveredIndex1.js
+ - jstests/core/distinct1.js
+ - jstests/core/elemMatchProjection.js
+ - jstests/core/find4.js
+ - jstests/core/find5.js
+ - jstests/core/fts1.js
+ - jstests/core/find_dedup.js
+ - jstests/core/fts_spanish.js
+ - jstests/core/geo_distinct.js
+ - jstests/core/geo_s2ordering.js
+ - jstests/core/group1.js
+ - jstests/core/group2.js
+ - jstests/core/maxscan.js
+ - jstests/core/nan.js
+ - jstests/core/null2.js
+ - jstests/core/not2.js
+ - jstests/core/sorta.js
+ - jstests/core/sortc.js
+ - jstests/core/sort3.js
+ - jstests/core/sort4.js
+ - jstests/core/ord.js
+ # Parallel shell is not causally consistent
+ - jstests/core/cursora.js
+ - jstests/core/find_and_modify_concurrent_update.js
+ - jstests/core/shellstartparallel.js
+ - jstests/core/loadserverscripts.js
+ # getMore is not causal consistent because afterClusterTime has been specified
+ # by the preceding find command which establishes the cursor. Therefore,
+ # getMore cannot be guaranteed to get executed after commands in between find
+ # and getMore.
+ - jstests/core/drop3.js
+ - jstests/core/ord.js
+ - jstests/core/tailable_cursor_invalidation.js
+ - jstests/core/tailable_skip_limit.js
+ # doTxn uses a different session so the operationTime of the default session
+ # will not be advanced by doTxn. Therefore, operations in the default
+ # session cannot be guaranteed to get executed after doTxn.
+ - jstests/core/bypass_doc_validation.js
+ - jstests/core/collation.js
+ # Tests which assume the order of writes.
+ - jstests/core/find1.js
+ - jstests/core/snapshot_queries.js
+
+ exclude_with_any_tags:
+ ##
+ # The next three 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
+ # "Cowardly refusing to override write concern of command: ..."
+ - assumes_write_concern_unchanged
+ # "Cowardly refusing to run test with overridden write concern when it uses a command that can
+ # only perform w=1 writes: ..."
+ - requires_eval_command
+ ##
+ # The next tag corresponds to the special error thrown by the set_read_preference_secondary.js
+ # override when it refuses to replace the readPreference of a particular command. Above each tag
+ # are the message(s) that cause the tag to be warranted.
+ ##
+ # "Cowardly refusing to override read preference of command: ..."
+ # "Cowardly refusing to run test with overridden read preference when it reads from a
+ # non-replicated collection: ..."
+ - assumes_read_preference_unchanged
+ ##
+ # collStats and dbStats are not causally consistent
+ - requires_collstats
+ - requires_dbstats
+
+executor:
+ archive:
+ hooks:
+ - CheckReplDBHash
+ - CheckReplOplogs
+ - ValidateCollections
+ config:
+ shell_options:
+ global_vars:
+ TestData:
+ defaultReadConcernLevel: local
+ defaultWriteConcern: {w: 1}
+ eval: >-
+ testingReplication = true;
+ load('jstests/libs/override_methods/set_read_and_write_concerns.js');
+ load('jstests/libs/override_methods/set_read_preference_secondary.js');
+ load('jstests/libs/override_methods/enable_causal_consistency.js');
+ readMode: commands
+ hooks:
+ # 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
+ - class: CleanEveryN
+ n: 20
+ fixture:
+ class: ReplicaSetFixture
+ mongod_options:
+ set_parameters:
+ enableTestCommands: 1
+ numInitialSyncAttempts: 1
+ num_nodes: 5
+ # We give each of the nodes a vote in a 5-node replica set so that the
+ # secondaries have different beliefs about the majority commit point
+ # relative to the cluster's majority commit point.
+ voting_secondaries: true
+ use_replica_set_connection_string: true
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 478d578896d..3ce6340ef7c 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -4120,6 +4120,17 @@ tasks:
run_multiple_jobs: true
- <<: *task_template
+ name: secondary_reads_passthrough
+ depends_on:
+ - name: jsCore_WT
+ commands:
+ - func: "do setup"
+ - func: "run tests"
+ vars:
+ resmoke_args: --suites=secondary_reads_passthrough --storageEngine=wiredTiger
+ run_multiple_jobs: true
+
+- <<: *task_template
name: sharding_jscore_op_query_passthrough_WT
depends_on:
- name: jsCore_WT
@@ -7501,6 +7512,9 @@ buildvariants:
- name: write_concern_majority_passthrough_WT
distros:
- rhel62-large
+ - name: secondary_reads_passthrough
+ distros:
+ - rhel62-large
- name: enterprise-rhel-62-64-bit-coverage
display_name: "~ Enterprise RHEL 6.2 DEBUG Code Coverage"
@@ -7532,6 +7546,7 @@ buildvariants:
- name: rollback_fuzzer_WT
- name: aggregation_WT
- name: aggregation_WT_ese
+ - name: secondary_reads_passthrough
- name: aggregation_auth
- name: aggregation_read_concern_majority_passthrough_WT
- name: aggregation_sharded_collections_passthrough_WT
@@ -7700,6 +7715,7 @@ buildvariants:
- name: sharded_collections_jscore_passthrough_WT
# - name: sharding TODO SERVER-32037: Replace sharding with sharding_WT.
- name: sharding_auth
+ - name: secondary_reads_passthrough
- name: rhel62
display_name: SSL RHEL 6.2
@@ -7778,6 +7794,7 @@ buildvariants:
- name: serial_run_WT
- name: sharding_jscore_passthrough_WT
- name: sharding_last_stable_mongos_and_mixed_shards
+ - name: secondary_reads_passthrough
- name: ssl
- name: sslSpecial
- name: tool_WT
@@ -7871,6 +7888,7 @@ buildvariants:
- name: serial_run_WT
- name: sharding_jscore_passthrough_WT
- name: sharding_last_stable_mongos_and_mixed_shards
+ - name: secondary_reads_passthrough
- name: ssl
- name: sslSpecial
- name: tool_WT
@@ -9048,6 +9066,7 @@ buildvariants:
- name: ssl
- name: sslSpecial
- name: tool
+ - name: secondary_reads_passthrough
- name: update_fuzzer_WT
- name: update_fuzzer_replication_WT
- name: write_concern_majority_passthrough_WT
@@ -9215,6 +9234,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough_WT
+ - name: secondary_reads_passthrough
- name: enterprise-rhel-72-s390x-inmem
display_name: Enterprise RHEL 7.2 s390x (inMemory) DEBUG
@@ -9305,6 +9325,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough_WT
+ - name: secondary_reads_passthrough
###########################################
# Experimental buildvariants #
@@ -9433,6 +9454,7 @@ buildvariants:
- name: update_fuzzer_WT
- name: update_fuzzer_replication_WT
- name: write_concern_majority_passthrough_WT
+ - name: secondary_reads_passthrough
- name: ubuntu1604-asan
display_name: ~ ASAN SSL Ubuntu 16.04
@@ -9592,6 +9614,7 @@ buildvariants:
- name: update_fuzzer_WT
- name: update_fuzzer_replication_WT
- name: write_concern_majority_passthrough_WT
+ - name: secondary_reads_passthrough
- name: ubuntu1604-debug-aubsan-lite
display_name: "! {A,UB}SAN Enterprise SSL Ubuntu 16.04 DEBUG"
@@ -9833,6 +9856,7 @@ buildvariants:
- name: sslSpecial
- name: tool_WT
- name: write_concern_majority_passthrough_WT
+ - name: secondary_reads_passthrough
- name: enterprise-ubuntu-dynamic-1604-64-bit
display_name: "* Shared Library Enterprise Ubuntu 16.04"
diff --git a/jstests/core/apitest_dbcollection.js b/jstests/core/apitest_dbcollection.js
index 5efde96f939..993a2ad1ea2 100644
--- a/jstests/core/apitest_dbcollection.js
+++ b/jstests/core/apitest_dbcollection.js
@@ -1,7 +1,10 @@
/**
* Tests for the db collection
*
- * @tags: [requires_fastcount]
+ * @tags: [
+ * requires_fastcount,
+ * requires_collstats,
+ * ]
*/
/*
diff --git a/jstests/core/auth1.js b/jstests/core/auth1.js
index d6b7bf152e6..05450d14ddc 100644
--- a/jstests/core/auth1.js
+++ b/jstests/core/auth1.js
@@ -1,4 +1,4 @@
-// @tags: [requires_non_retryable_commands]
+// @tags: [requires_non_retryable_commands, requires_auth, assumes_write_concern_unchanged]
var mydb = db.getSiblingDB('auth1_db');
mydb.dropAllUsers();
diff --git a/jstests/core/auth_copydb.js b/jstests/core/auth_copydb.js
index 17842256d80..b8a85ae1c03 100644
--- a/jstests/core/auth_copydb.js
+++ b/jstests/core/auth_copydb.js
@@ -1,4 +1,9 @@
-// @tags: [requires_non_retryable_commands, requires_fastcount]
+// @tags: [
+// requires_non_retryable_commands,
+// requires_fastcount,
+// requires_auth,
+// assumes_write_concern_unchanged
+// ]
a = db.getSisterDB("copydb2-test-a");
b = db.getSisterDB("copydb2-test-b");
diff --git a/jstests/core/connection_status.js b/jstests/core/connection_status.js
index c769aabf284..df1c59ab234 100644
--- a/jstests/core/connection_status.js
+++ b/jstests/core/connection_status.js
@@ -1,4 +1,8 @@
-// @tags: [requires_non_retryable_commands]
+// @tags: [
+// requires_non_retryable_commands,
+// requires_auth,
+// assumes_write_concern_unchanged
+// ]
// Tests the connectionStatus command
(function() {
diff --git a/jstests/core/rename7.js b/jstests/core/rename7.js
index 9b318e91c59..10a9250f3be 100644
--- a/jstests/core/rename7.js
+++ b/jstests/core/rename7.js
@@ -1,4 +1,4 @@
-// @tags: [requires_non_retryable_commands, requires_fastcount]
+// @tags: [requires_non_retryable_commands, requires_fastcount, requires_collstats]
// ***************************************************************
// rename7.js
diff --git a/jstests/core/role_management_helpers.js b/jstests/core/role_management_helpers.js
index d467e2ac099..445d85cc74e 100644
--- a/jstests/core/role_management_helpers.js
+++ b/jstests/core/role_management_helpers.js
@@ -1,4 +1,8 @@
-// @tags: [requires_non_retryable_commands]
+// @tags: [
+// requires_non_retryable_commands,
+// requires_auth,
+// assumes_write_concern_unchanged,
+// ]
// This test is a basic sanity check of the shell helpers for manipulating role objects
// It is not a comprehensive test of the functionality of the role manipulation commands
diff --git a/jstests/core/user_management_helpers.js b/jstests/core/user_management_helpers.js
index 59aba33e8c9..2b5abe9a388 100644
--- a/jstests/core/user_management_helpers.js
+++ b/jstests/core/user_management_helpers.js
@@ -1,4 +1,8 @@
-// @tags: [requires_non_retryable_commands]
+// @tags: [
+// requires_non_retryable_commands,
+// requires_auth,
+// assumes_write_concern_unchanged
+// ]
// This test is a basic sanity check of the shell helpers for manipulating user objects
// It is not a comprehensive test of the functionality of the user manipulation commands
diff --git a/jstests/core/validate_user_documents.js b/jstests/core/validate_user_documents.js
index 7a523a75183..a9b2b96d526 100644
--- a/jstests/core/validate_user_documents.js
+++ b/jstests/core/validate_user_documents.js
@@ -1,4 +1,8 @@
-// @tags: [requires_non_retryable_commands]
+// @tags: [
+// requires_non_retryable_commands,
+// requires_auth,
+// assumes_write_concern_unchanged
+// ]
// Ensure that inserts and updates of the system.users collection validate the schema of inserted
// documents.