summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorIan Boros <ian.boros@10gen.com>2018-02-28 11:39:17 -0500
committerIan Boros <ian.boros@10gen.com>2018-03-01 17:51:08 -0500
commit3891613c64a74f058cd23c530c208142287281bc (patch)
treec947c96207e5b0dcdcbc1e51ded6e2b21e538467 /jstests
parent59a1addc1ef68b4d7776301caca971763ca611e3 (diff)
downloadmongo-3891613c64a74f058cd23c530c208142287281bc.tar.gz
SERVER-33277 Adapt invalidated_cursors.js and kill_multicollection_aggregation.js to run under sharded clusters
Diffstat (limited to 'jstests')
-rw-r--r--jstests/concurrency/fsm_all_sharded_replication.js7
-rw-r--r--jstests/concurrency/fsm_workloads/invalidated_cursors.js16
2 files changed, 16 insertions, 7 deletions
diff --git a/jstests/concurrency/fsm_all_sharded_replication.js b/jstests/concurrency/fsm_all_sharded_replication.js
index 66de8c45ff1..0e63bba26d5 100644
--- a/jstests/concurrency/fsm_all_sharded_replication.js
+++ b/jstests/concurrency/fsm_all_sharded_replication.js
@@ -62,13 +62,6 @@ var blacklist = [
'indexed_insert_eval.js', // eval doesn't work with sharded collections
'indexed_insert_eval_nolock.js', // eval doesn't work with sharded collections
- // These workloads sometimes triggers an 'unable to target write op for collection ... caused by
- // ... database not found' error. Further investigation still needs to be done, but these
- // failures may be due to SERVER-17397 'drops in a sharded cluster may not fully succeed'
- // because it drops and reuses the same namespaces.
- 'kill_multicollection_aggregation.js',
- 'invalidated_cursors.js',
-
'plan_cache_drop_database.js', // cannot ensureIndex after dropDatabase without sharding first
'remove_single_document.js', // our .remove(query, {justOne: true}) calls lack shard keys
'remove_single_document_eval.js', // eval doesn't work with sharded collections
diff --git a/jstests/concurrency/fsm_workloads/invalidated_cursors.js b/jstests/concurrency/fsm_workloads/invalidated_cursors.js
index 6a40a8086ad..d8c9b3308d4 100644
--- a/jstests/concurrency/fsm_workloads/invalidated_cursors.js
+++ b/jstests/concurrency/fsm_workloads/invalidated_cursors.js
@@ -7,6 +7,9 @@
* cursor manager. Threads perform find, getMore and explain commands while the database,
* collection, or an index is dropped.
*/
+
+load('jstests/concurrency/fsm_workload_helpers/server_types.js'); // for isMongos
+
var $config = (function() {
let data = {
@@ -118,6 +121,13 @@ var $config = (function() {
* 'this.involvedCollections' by repopulating them with data and indexes.
*/
dropDatabase: function dropDatabase(db, collName) {
+ if (isMongos(db)) {
+ // SERVER-17397: Drops in a sharded cluster may not fully succeed. It is not safe
+ // to drop and then recreate a collection with the same name, so we skip dropping
+ // and recreating the database.
+ return;
+ }
+
let myDB = db.getSiblingDB(this.uniqueDBName);
myDB.dropDatabase();
@@ -132,6 +142,12 @@ var $config = (function() {
* collection is then re-created with data and indexes.
*/
dropCollection: function dropCollection(db, collName) {
+ if (isMongos(db)) {
+ // SERVER-17397: Drops in a sharded cluster may not fully succeed. It is not safe
+ // to drop and then recreate a collection with the same name, so we skip it.
+ return;
+ }
+
let myDB = db.getSiblingDB(this.uniqueDBName);
let targetColl = this.chooseRandomlyFrom(this.involvedCollections);