summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2020-08-28 13:27:59 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-14 12:58:51 +0000
commitf815b3e1a078b4d803614afb6b8603ea561505ce (patch)
treee6a20eb60db87d85192ce69190a4746aa0577342
parent5a68185f00cd8fafe967c273c4eba4d7123f62f8 (diff)
downloadmongo-f815b3e1a078b4d803614afb6b8603ea561505ce.tar.gz
SERVER-50326 Restrict sharding in agg_out.js workload to a single thread
(cherry picked from commit 98d95e18f39540b33c491052901579b71ec430fc) (cherry picked from commit ea20b8a22518250acaac184f07957bdf6cde2b35)
-rw-r--r--jstests/concurrency/fsm_workloads/agg_out.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/concurrency/fsm_workloads/agg_out.js b/jstests/concurrency/fsm_workloads/agg_out.js
index d5c0a7ec7cb..b66384589ed 100644
--- a/jstests/concurrency/fsm_workloads/agg_out.js
+++ b/jstests/concurrency/fsm_workloads/agg_out.js
@@ -132,10 +132,12 @@ var $config = extendWorkload($config, function($config, $super) {
/**
* If being run against a mongos, shards '$config.data.outputCollName'. This is never undone,
- * and all subsequent $out's to this collection should fail.
+ * and all subsequent $out's to this collection should fail. Collection sharding is restricted
+ * to a single thread as multiple concurrent invocations can result in command timeout /
+ * failure.
*/
$config.states.shardCollection = function shardCollection(db, unusedCollName) {
- if (isMongos(db)) {
+ if (isMongos(db) && this.tid === 0) {
assertWhenOwnDB.commandWorked(db.adminCommand({enableSharding: db.getName()}));
assertWhenOwnDB.commandWorked(db.adminCommand(
{shardCollection: db[this.outputCollName].getFullName(), key: {_id: 'hashed'}}));