From 14bd9654e676f82677d5d669f1d1ac09a8c1ac54 Mon Sep 17 00:00:00 2001 From: Misha Tyulenev Date: Thu, 9 Jul 2020 03:24:27 +0000 Subject: SERVER-49089 fail with MovePrimaryInProgress in MapReduce command (cherry picked from commit 15588728dce3ec74e574887f0b7f2775e7119bf6) --- jstests/sharding/move_primary_with_writes.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'jstests') 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}}]}, -- cgit v1.2.1