summaryrefslogtreecommitdiff
path: root/jstests/aggregation/sources
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2018-12-07 10:39:51 -0500
committerCharlie Swanson <charlie.swanson@mongodb.com>2018-12-07 16:07:37 -0500
commit67e98183b1d80bd12c6fd815fffe4e51619e0156 (patch)
tree843de13edeb5268a6a725bc7ae002ac81e11aace /jstests/aggregation/sources
parent99ee8dc30a59c674738d8c36274cccfb540917f8 (diff)
downloadmongo-67e98183b1d80bd12c6fd815fffe4e51619e0156.tar.gz
SERVER-38349 Disallow exchange passed to mongos
Diffstat (limited to 'jstests/aggregation/sources')
-rw-r--r--jstests/aggregation/sources/out/exchange_explain.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/jstests/aggregation/sources/out/exchange_explain.js b/jstests/aggregation/sources/out/exchange_explain.js
index 7ccf35124cf..5a6b7a33ef7 100644
--- a/jstests/aggregation/sources/out/exchange_explain.js
+++ b/jstests/aggregation/sources/out/exchange_explain.js
@@ -128,5 +128,34 @@ load('jstests/aggregation/extras/utils.js');
}],
50905);
+ // SERVER-38349 Make sure mongos rejects specifying exchange directly.
+ assert.commandFailedWithCode(mongosDB.runCommand({
+ aggregate: inColl.getName(),
+ pipeline: [],
+ cursor: {},
+ exchange: {
+ policy: "keyRange",
+ bufferSize: NumberInt(1024),
+ boundaries: [{_id: 0}],
+ consumers: NumberInt(2),
+ consumerIds: [NumberInt(0), NumberInt(1)]
+ }
+ }),
+ 51028);
+
+ assert.commandFailedWithCode(mongosDB.runCommand({
+ aggregate: inColl.getName(),
+ pipeline: [{$out: {to: outCollRange.getName(), mode: "replaceDocuments"}}],
+ cursor: {},
+ exchange: {
+ policy: "keyRange",
+ bufferSize: NumberInt(1024),
+ boundaries: [{_id: 0}],
+ consumers: NumberInt(2),
+ consumerIds: [NumberInt(0), NumberInt(1)]
+ }
+ }),
+ 51028);
+
st.stop();
}());