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-08-13 00:17:26 +0000 |
commit | 14bd9654e676f82677d5d669f1d1ac09a8c1ac54 (patch) | |
tree | 6c6a1fb2f924061b412e05874e07f7329425acb5 | |
parent | e008f3f282f2a2fe55d6e03aecfe80e4cf452dba (diff) | |
download | mongo-14bd9654e676f82677d5d669f1d1ac09a8c1ac54.tar.gz |
SERVER-49089 fail with MovePrimaryInProgress in MapReduce command
(cherry picked from commit 15588728dce3ec74e574887f0b7f2775e7119bf6)
-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}}]}, |