diff options
author | Misha Tyulenev <misha.tyulenev@mongodb.com> | 2020-07-09 03:24:27 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-10 16:39:11 +0000 |
commit | 15588728dce3ec74e574887f0b7f2775e7119bf6 (patch) | |
tree | 4607ca1e8d134bb4fa1d951c78228fc178bad795 | |
parent | 0497a5fe38903ceb08c48050df476f0718b91733 (diff) | |
download | mongo-15588728dce3ec74e574887f0b7f2775e7119bf6.tar.gz |
SERVER-49089 fail with MovePrimaryInProgress in MapReduce command
-rw-r--r-- | jstests/sharding/move_primary_with_writes.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/sharding/move_primary_with_writes.js b/jstests/sharding/move_primary_with_writes.js index 9cc940ee902..b9827b7e672 100644 --- a/jstests/sharding/move_primary_with_writes.js +++ b/jstests/sharding/move_primary_with_writes.js @@ -45,6 +45,13 @@ function createCollections() { assert.commandWorked(db.adminCommand({shardCollection: dbName + '.shardedBar', key: {_id: 1}})); } +function mapFunc() { + emit(this.a, 1); +} +function reduceFunc(key, values) { + return Array.sum(values); +} + function buildCommands(collName) { const commands = [ {command: {insert: collName, documents: [{a: 10}]}, alwaysFail: false}, @@ -80,6 +87,15 @@ function buildCommands(collName) { {aggregate: collName, cursor: {}, pipeline: [{$match: {}}, {$out: "testOutColl"}]}, alwaysFail: true }, + { + command: { + mapReduce: collName, + map: mapFunc, + reduce: reduceFunc, + out: {merge: "testOutMR", db: dbName} + }, + alwaysFail: true + }, {command: {create: "testCollection"}, alwaysFail: true}, { command: {collMod: "viewOnFoo", viewOn: "unshardedFoo", pipeline: [{$match: {_id: 1}}]}, |