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-04-25 20:39:55 -0400
commitd62890ffeacd2e911ff4a36f01bdef498c101c07 (patch)
treecd77eead0e0454cf35dc64332bda07dc08df9f86
parent1f5410fdad8ee3c4c1d8b88d8a852d8bd1b43b7b (diff)
downloadmongo-d62890ffeacd2e911ff4a36f01bdef498c101c07.tar.gz
SERVER-34384 Add passthrough test for secondary reads
-rw-r--r--buildscripts/resmokeconfig/suites/secondary_reads_passthrough.yml131
-rw-r--r--etc/evergreen.yml25
-rw-r--r--jstests/core/apitest_dbcollection.js1
-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.js1
-rw-r--r--jstests/core/user_management_helpers.js6
-rw-r--r--jstests/core/validate_user_documents.js6
10 files changed, 181 insertions, 6 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..613d047ff2b
--- /dev/null
+++ b/buildscripts/resmokeconfig/suites/secondary_reads_passthrough.yml
@@ -0,0 +1,131 @@
+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
+
+ 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 46c4a466850..bc58df9288e 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -4240,6 +4240,17 @@ tasks:
run_multiple_jobs: true
- <<: *task_template
+ name: secondary_reads_passthrough
+ depends_on:
+ - name: jsCore
+ commands:
+ - func: "do setup"
+ - func: "run tests"
+ vars:
+ resmoke_args: --suites=secondary_reads_passthrough --storageEngine=wiredTiger
+ run_multiple_jobs: true
+
+- <<: *task_template
name: replica_sets
commands:
- func: "do setup"
@@ -9588,6 +9599,9 @@ buildvariants:
- name: write_concern_majority_passthrough
distros:
- rhel62-large
+ - name: secondary_reads_passthrough
+ distros:
+ - rhel62-large
- name: package
distros:
- ubuntu1604-packer
@@ -9717,6 +9731,7 @@ buildvariants:
- name: update_fuzzer
- name: update_fuzzer_replication
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: enterprise-rhel-70-64-bit
display_name: "* Enterprise RHEL 7.0"
@@ -10089,6 +10104,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: push
distros:
- rhel70-small
@@ -10195,6 +10211,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: push
distros:
- rhel70-small
@@ -10292,6 +10309,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: push
distros:
- rhel62-large
@@ -10621,6 +10639,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: push
distros:
- suse12-test
@@ -11273,6 +11292,7 @@ buildvariants:
- name: update_fuzzer
- name: update_fuzzer_replication
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: enterprise-rhel-62-64-bit-mobile
display_name: Enterprise RHEL 6.2 (mobile)
@@ -11653,6 +11673,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: enterprise-rhel-72-s390x-inmem
display_name: Enterprise RHEL 7.2 s390x (inMemory) DEBUG
@@ -11739,6 +11760,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: ubuntu1404-rocksdb
display_name: Ubuntu 14.04 (RocksDB)
@@ -11897,6 +11919,7 @@ buildvariants:
- name: update_fuzzer
- name: update_fuzzer_replication
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: ubuntu1604-asan
display_name: ~ ASAN SSL Ubuntu 16.04
@@ -12067,6 +12090,7 @@ buildvariants:
- name: update_fuzzer
- name: update_fuzzer_replication
- name: write_concern_majority_passthrough
+ - name: secondary_reads_passthrough
- name: ubuntu1604-debug-aubsan-lite
display_name: "! {A,UB}SAN Enterprise SSL Ubuntu 16.04 DEBUG"
@@ -12195,6 +12219,7 @@ buildvariants:
- name: sslSpecial
- name: tool
- name: write_concern_majority_passthrough
+ - 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 9377f24e9ab..384d4795f37 100644
--- a/jstests/core/apitest_dbcollection.js
+++ b/jstests/core/apitest_dbcollection.js
@@ -3,6 +3,7 @@
*
* @tags: [
* requires_fastcount,
+ * requires_collstats,
*
* # indexDetails result is not correct with mobile storage engine.
* # TODO SERVER-34579
diff --git a/jstests/core/auth1.js b/jstests/core/auth1.js
index 754ffae1c74..05450d14ddc 100644
--- a/jstests/core/auth1.js
+++ b/jstests/core/auth1.js
@@ -1,4 +1,4 @@
-// @tags: [requires_non_retryable_commands, requires_auth]
+// @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 daa2f65e012..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, requires_auth]
+// @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 392c6cd654e..df1c59ab234 100644
--- a/jstests/core/connection_status.js
+++ b/jstests/core/connection_status.js
@@ -1,4 +1,8 @@
-// @tags: [requires_non_retryable_commands, requires_auth]
+// @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 3643278e9c8..445d85cc74e 100644
--- a/jstests/core/role_management_helpers.js
+++ b/jstests/core/role_management_helpers.js
@@ -1,6 +1,7 @@
// @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
diff --git a/jstests/core/user_management_helpers.js b/jstests/core/user_management_helpers.js
index 91a4cdfae69..6e3ee9187c0 100644
--- a/jstests/core/user_management_helpers.js
+++ b/jstests/core/user_management_helpers.js
@@ -1,4 +1,8 @@
-// @tags: [requires_non_retryable_commands, requires_auth]
+// @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 45d250b3c52..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, requires_auth]
+// @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.