diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2020-07-08 23:25:22 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-16 14:06:54 +0000 |
commit | 21b083c7352704fc8c3d8a4f33c54040259ff766 (patch) | |
tree | 333f80cff7fb94bf382d01be4c1a46f1e9d6b70a /jstests/concurrency | |
parent | 4bfdc5ddfc4ad5569cf995e734c4b2efe77f769a (diff) | |
download | mongo-21b083c7352704fc8c3d8a4f33c54040259ff766.tar.gz |
SERVER-48641 SERVER-48689 Yield session in migration destination driver when waiting on replication and session migration
Diffstat (limited to 'jstests/concurrency')
-rw-r--r-- | jstests/concurrency/fsm_workload_helpers/chunks.js | 9 | ||||
-rw-r--r-- | jstests/concurrency/fsm_workloads/random_moveChunk_base.js | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/jstests/concurrency/fsm_workload_helpers/chunks.js b/jstests/concurrency/fsm_workload_helpers/chunks.js index 91e94047bad..d0e5d4d744b 100644 --- a/jstests/concurrency/fsm_workload_helpers/chunks.js +++ b/jstests/concurrency/fsm_workload_helpers/chunks.js @@ -60,7 +60,7 @@ var ChunkHelper = (function() { return runCommandWithRetries(db, cmd, res => res.code === ErrorCodes.LockBusy); } - function moveChunk(db, collName, bounds, toShard, waitForDelete) { + function moveChunk(db, collName, bounds, toShard, waitForDelete, secondaryThrottle) { var cmd = { moveChunk: db[collName].getFullName(), bounds: bounds, @@ -68,6 +68,13 @@ var ChunkHelper = (function() { _waitForDelete: waitForDelete }; + // Using _secondaryThrottle adds coverage for additional waits for write concern on the + // recipient during cloning. + if (secondaryThrottle) { + cmd._secondaryThrottle = true; + cmd.writeConcern = {w: "majority"}; // _secondaryThrottle requires a write concern. + } + const runningWithStepdowns = TestData.runningWithConfigStepdowns || TestData.runningWithShardStepdowns; diff --git a/jstests/concurrency/fsm_workloads/random_moveChunk_base.js b/jstests/concurrency/fsm_workloads/random_moveChunk_base.js index a35c1ce5c5a..2b0c736cb4e 100644 --- a/jstests/concurrency/fsm_workloads/random_moveChunk_base.js +++ b/jstests/concurrency/fsm_workloads/random_moveChunk_base.js @@ -93,8 +93,9 @@ var $config = extendWorkload($config, function($config, $super) { // limited number of retries with exponential backoff. const bounds = this.calculateChunkBoundsForShardKey(collName, chunk); const waitForDelete = Random.rand() < 0.5; + const secondaryThrottle = Random.rand() < 0.5; try { - ChunkHelper.moveChunk(db, collName, bounds, toShard, waitForDelete); + ChunkHelper.moveChunk(db, collName, bounds, toShard, waitForDelete, secondaryThrottle); } catch (e) { // Failed moveChunks are thrown by the moveChunk helper with the response included as a // JSON string in the error's message. |