summaryrefslogtreecommitdiff
path: root/jstests/concurrency
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2018-03-01 11:33:36 -0500
committerjannaerin <golden.janna@gmail.com>2018-03-06 15:47:13 -0500
commit5da505eb1c4f81cbaa22860fd2a9453f10e81a62 (patch)
tree32160f637fe6340b5e85b61ae7679bcea722388a /jstests/concurrency
parent1365c273c4b1aab22f70750963a910332a0db992 (diff)
downloadmongo-5da505eb1c4f81cbaa22860fd2a9453f10e81a62.tar.gz
SERVER-33516 Make _configsvrCreateCollection take the db distlock to prevent conncurrent movePrimary
Diffstat (limited to 'jstests/concurrency')
-rw-r--r--jstests/concurrency/fsm_workloads/view_catalog.js13
-rw-r--r--jstests/concurrency/fsm_workloads/view_catalog_cycle_with_drop.js13
2 files changed, 22 insertions, 4 deletions
diff --git a/jstests/concurrency/fsm_workloads/view_catalog.js b/jstests/concurrency/fsm_workloads/view_catalog.js
index 31ed0072bb3..ebb44905bf4 100644
--- a/jstests/concurrency/fsm_workloads/view_catalog.js
+++ b/jstests/concurrency/fsm_workloads/view_catalog.js
@@ -79,9 +79,18 @@ var $config = (function() {
dropCollections(db, pattern);
}
+ // This test performs createCollection concurrently from many threads, and createCollection on a
+ // sharded cluster takes a distributed lock. Since a distributed lock is acquired by repeatedly
+ // attempting to grab the lock every half second for 20 seconds (a max of 40 attempts), it's
+ // possible that some thread will be starved by the other threads and fail to grab the lock
+ // after 40 attempts. To reduce the likelihood of this, we choose threadCount and iterations so
+ // that threadCount * iterations < 40.
+ // The threadCount and iterations can be increased once PM-697 ("Remove all usages of
+ // distributed lock") is complete.
+
return {
- threadCount: 10,
- iterations: 100,
+ threadCount: 5,
+ iterations: 5,
data: data,
states: states,
transitions: transitions,
diff --git a/jstests/concurrency/fsm_workloads/view_catalog_cycle_with_drop.js b/jstests/concurrency/fsm_workloads/view_catalog_cycle_with_drop.js
index f5d82b98fb6..9768ec7dee5 100644
--- a/jstests/concurrency/fsm_workloads/view_catalog_cycle_with_drop.js
+++ b/jstests/concurrency/fsm_workloads/view_catalog_cycle_with_drop.js
@@ -97,9 +97,18 @@ var $config = (function() {
dropCollections(db, pattern);
}
+ // This test performs createCollection concurrently from many threads, and createCollection on a
+ // sharded cluster takes a distributed lock. Since a distributed lock is acquired by repeatedly
+ // attempting to grab the lock every half second for 20 seconds (a max of 40 attempts), it's
+ // possible that some thread will be starved by the other threads and fail to grab the lock
+ // after 40 attempts. To reduce the likelihood of this, we choose threadCount and iterations so
+ // that threadCount * iterations < 40.
+ // The threadCount and iterations can be increased once PM-697 ("Remove all usages of
+ // distributed lock") is complete.
+
return {
- threadCount: 10,
- iterations: 100,
+ threadCount: 5,
+ iterations: 5,
data: data,
states: states,
startState: 'readFromView',