Skip to content

Commit

Permalink
SERVER-44475 Remove Query Knob
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Evans authored and evergreen committed Dec 11, 2019
1 parent 3da6513 commit 57acc8b
Show file tree
Hide file tree
Showing 64 changed files with 492 additions and 932 deletions.
41 changes: 0 additions & 41 deletions buildscripts/resmokeconfig/suites/core_map_reduce_agg.yaml

This file was deleted.

Expand Up @@ -45,7 +45,6 @@ selector:
- jstests/sharding/migrateBig_balancer.js
- jstests/sharding/move_chunk_basic.js
- jstests/sharding/movePrimary1.js
- jstests/sharding/mrShardedOutput.js
- jstests/sharding/names.js
- jstests/sharding/prefix_shard_key.js
- jstests/sharding/presplit.js
Expand Down
32 changes: 0 additions & 32 deletions buildscripts/resmokeconfig/suites/sharding_map_reduce_agg.yaml

This file was deleted.

1 change: 0 additions & 1 deletion buildscripts/resmokeconfig/suites/sharding_misc.yml
Expand Up @@ -145,7 +145,6 @@ selector:
- jstests/sharding/features2.js
- jstests/sharding/names.js
- jstests/sharding/explain_agg_read_pref.js
- jstests/sharding/mrShardedOutput.js
- jstests/sharding/split_stale_mongos.js
- jstests/sharding/multi_write_target.js
- jstests/sharding/array_shard_key.js
Expand Down
18 changes: 0 additions & 18 deletions etc/evergreen.yml
Expand Up @@ -5964,24 +5964,6 @@ tasks:
vars:
resmoke_args: --suites=core_txns_large_txns_format --storageEngine=wiredTiger

- <<: *task_template
name: jsCore_map_reduce_agg
tags: ["jscore", "common"]
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=core_map_reduce_agg --storageEngine=wiredTiger

- <<: *task_template
name: sharding_map_reduce_agg
tags: ["sharding", "common"]
commands:
- func: "do setup"
- func: "run tests"
vars:
resmoke_args: --suites=sharding_map_reduce_agg --storageEngine=wiredTiger

- <<: *task_template
name: sharded_jscore_txns
tags: ["sharding", "jscore", "txns"]
Expand Down
8 changes: 1 addition & 7 deletions jstests/concurrency/fsm_workloads/map_reduce_inline.js
Expand Up @@ -10,10 +10,7 @@
* Used as the base workload for the other map-reduce workloads.
* @tags: [
* # mapReduce does not support afterClusterTime.
* does_not_support_causal_consistency,
* # TODO SERVER-42511: Remove this requires_fcv tag once the internalQueryUseAggMapReduce knob
* # is removed from the fsm workloads.
* requires_fcv_44
* does_not_support_causal_consistency
* ]
*/
var $config = (function() {
Expand Down Expand Up @@ -78,9 +75,6 @@ var $config = (function() {
var res = bulk.execute();
assertAlways.commandWorked(res);
assertAlways.eq(this.numDocs, res.nInserted);

assert.commandWorked(
db.adminCommand({setParameter: 1, internalQueryUseAggMapReduce: true}));
}

return {
Expand Down
5 changes: 1 addition & 4 deletions jstests/concurrency/fsm_workloads/map_reduce_interrupt.js
Expand Up @@ -10,10 +10,7 @@
* @tags: [
* # mapReduce does not support afterClusterTime.
* does_not_support_causal_consistency,
* uses_curop_agg_stage,
* # TODO SERVER-42511: Remove this requires_fcv tag once the internalQueryUseAggMapReduce knob
* # is removed in the fsm workloads.
* requires_fcv_44
* uses_curop_agg_stage
* ]
*/
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
Expand Down
5 changes: 1 addition & 4 deletions jstests/concurrency/fsm_workloads/map_reduce_merge.js
Expand Up @@ -14,10 +14,7 @@
* Writes the results of each thread to the same collection.
* @tags: [
* # mapReduce does not support afterClusterTime.
* does_not_support_causal_consistency,
* # TODO SERVER-42511: Remove this requires_fcv tag once the internalQueryUseAggMapReduce knob
* # is removed in the fsm workloads.
* requires_fcv_44
* does_not_support_causal_consistency
* ]
*/
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
Expand Down
3 changes: 0 additions & 3 deletions jstests/concurrency/fsm_workloads/map_reduce_reduce.js
Expand Up @@ -13,9 +13,6 @@
* @tags: [
* # mapReduce does not support afterClusterTime.
* does_not_support_causal_consistency,
* # TODO SERVER-42511: Remove this requires_fcv tag once the internalQueryUseAggMapReduce knob
* # is removed in the fsm workloads.
* requires_fcv_44,
* ]
*/
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
Expand Down
5 changes: 1 addition & 4 deletions jstests/concurrency/fsm_workloads/map_reduce_replace.js
Expand Up @@ -12,10 +12,7 @@
* collection.
* @tags: [
* # mapReduce does not support afterClusterTime.
* does_not_support_causal_consistency,
* # TODO SERVER-42511: Remove this requires_fcv tag once the internalQueryUseAggMapReduce knob
* # is removed in the fsm workloads.
* requires_fcv_44,
* does_not_support_causal_consistency
* ]
*/
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
Expand Down
Expand Up @@ -11,10 +11,7 @@
* output collection.
* @tags: [
* # mapReduce does not support afterClusterTime.
* does_not_support_causal_consistency,
* # TODO SERVER-42511: Remove this requires_fcv tag once the internalQueryUseAggMapReduce knob
* # is removed in the fsm workloads.
* requires_fcv_44,
* does_not_support_causal_consistency
* ]
*/
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
Expand Down
Expand Up @@ -12,10 +12,7 @@
* This workload was designed to reproduce SERVER-15539.
* @tags: [
* # mapReduce does not support afterClusterTime.
* does_not_support_causal_consistency,
* # TODO SERVER-42511: Remove this requires_fcv tag once the internalQueryUseAggMapReduce knob
* # is removed in the fsm workloads.
* requires_fcv_44,
* does_not_support_causal_consistency
* ]
*/
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
Expand Down
Expand Up @@ -98,9 +98,6 @@ var $config = extendWorkload($config, function($config, $super) {
cluster.shardCollection(db[this.collWithMigrations], this.shardKey, false);
$super.setup.apply(this, [db, this.collWithMigrations, cluster]);
}

assert.commandWorked(
db.adminCommand({setParameter: 1, internalQueryUseAggMapReduce: true}));
};

return $config;
Expand Down
14 changes: 0 additions & 14 deletions jstests/core/collation.js
Expand Up @@ -957,20 +957,6 @@ assert.eq(null,
// Collation tests for mapReduce.
//

// mapReduce should return "collection doesn't exist" error when collation specified and
// collection does not exist.
coll.drop();
assert.throws(function() {
coll.mapReduce(
function() {
emit(this.str, 1);
},
function(key, values) {
return Array.sum(values);
},
{out: {inline: 1}, collation: {locale: "fr"}});
});

// mapReduce should return correct results when collation specified and no indexes exist.
coll.drop();
assert.commandWorked(coll.insert({_id: 1, str: "foo"}));
Expand Down
26 changes: 17 additions & 9 deletions jstests/core/constructors.js
Expand Up @@ -8,6 +8,9 @@

// Takes a list of constructors and returns a new list with an extra entry for each constructor with
// "new" prepended
(function() {
"use strict";
const out = db.map_reduce_constructors_out;
function addConstructorsWithNew(constructorList) {
function prependNew(constructor) {
return "new " + constructor;
Expand Down Expand Up @@ -39,7 +42,7 @@ function clientEvalConstructorTest(constructorList) {

function mapReduceConstructorTest(constructorList) {
constructorList = addConstructorsWithNew(constructorList);
t = db.mr_constructors;
const t = db.mr_constructors;
t.drop();

t.save({"partner": 1, "visits": 9});
Expand All @@ -49,34 +52,38 @@ function mapReduceConstructorTest(constructorList) {
t.save({"partner": 2, "visits": 41});
t.save({"partner": 2, "visits": 41});

let dummy;
constructorList.valid.forEach(function(constructor) {
try {
m = eval("dummy = function(){ emit( \"test\" , " + constructor + " ) }");
const m = eval("dummy = function(){ emit( \"test\" , " + constructor + " ) }");

r = eval("dummy = function( k , v ){ return { test : " + constructor + " } }");
const r = eval("dummy = function( k , v ){ return { test : " + constructor + " } }");

res = t.mapReduce(m, r, {out: "mr_constructors_out", scope: {xx: 1}});
out.drop();
assert.commandWorked(
t.mapReduce(m, r, {out: {merge: "map_reduce_constructors_out"}, scope: {xx: 1}}));
} catch (e) {
throw ("valid constructor: " + constructor + " failed in mapReduce context: " + e);
}
});
constructorList.invalid.forEach(function(constructor) {
m = eval("dummy = function(){ emit( \"test\" , " + constructor + " ) }");
const m = eval("dummy = function(){ emit( \"test\" , " + constructor + " ) }");

r = eval("dummy = function( k , v ){ return { test : " + constructor + " } }");
const r = eval("dummy = function( k , v ){ return { test : " + constructor + " } }");

assert.throws(function() {
res = t.mapReduce(m, r, {out: "mr_constructors_out", scope: {xx: 1}});
out.drop();
t.mapReduce(m, r, {out: {merge: "map_reduce_constructors_out"}, scope: {xx: 1}});
}, [], "invalid constructor did not throw error in mapReduce context: " + constructor);
});

db.mr_constructors_out.drop();
out.drop();
t.drop();
}

function whereConstructorTest(constructorList) {
constructorList = addConstructorsWithNew(constructorList);
t = db.where_constructors;
const t = db.where_constructors;
t.drop();
assert.commandWorked(t.insert({x: 1}));

Expand Down Expand Up @@ -291,3 +298,4 @@ whereConstructorTest(uuidConstructors);
whereConstructorTest(md5Constructors);
whereConstructorTest(hexdataConstructors);
whereConstructorTest(dateConstructors);
})();
18 changes: 11 additions & 7 deletions jstests/core/find_and_modify2.js
Expand Up @@ -3,19 +3,23 @@
// key.
// @tags: [assumes_unsharded_collection]

t = db.find_and_modify2;
t.drop();
(function() {
"use strict";

t.insert({_id: 1, i: 0, j: 0});
const coll = db.find_and_modify2;
coll.drop();

out = t.findAndModify({update: {$inc: {i: 1}}, 'new': true, fields: {i: 1}});
coll.insert({_id: 1, i: 0, j: 0});

let out = coll.findAndModify({update: {$inc: {i: 1}}, 'new': true, fields: {i: 1}});
assert.eq(out, {_id: 1, i: 1});

out = t.findAndModify({update: {$inc: {i: 1}}, fields: {i: 0}});
out = coll.findAndModify({update: {$inc: {i: 1}}, fields: {i: 0}});
assert.eq(out, {_id: 1, j: 0});

out = t.findAndModify({update: {$inc: {i: 1}}, fields: {_id: 0, j: 1}});
out = coll.findAndModify({update: {$inc: {i: 1}}, fields: {_id: 0, j: 1}});
assert.eq(out, {j: 0});

out = t.findAndModify({update: {$inc: {i: 1}}, fields: {_id: 0, j: 1}, 'new': true});
out = coll.findAndModify({update: {$inc: {i: 1}}, fields: {_id: 0, j: 1}, 'new': true});
assert.eq(out, {j: 0});
})();
11 changes: 8 additions & 3 deletions jstests/core/function_string_representations.js
Expand Up @@ -12,7 +12,8 @@
(function() {
"use strict";

var col = db.function_string_representations;
const col = db.function_string_representations;
const out = db.map_reduce_example;
col.drop();
assert.commandWorked(col.insert({
_id: "abc123",
Expand All @@ -24,12 +25,16 @@ assert.commandWorked(col.insert({

var mapFunction = "function() {emit(this._id, this.price);}";
var reduceFunction = "function(keyCustId, valuesPrices) {return Array.sum(valuesPrices);}";
assert.commandWorked(col.mapReduce(mapFunction, reduceFunction, {out: "map_reduce_example"}));
out.drop();
assert.commandWorked(
col.mapReduce(mapFunction, reduceFunction, {out: {merge: "map_reduce_example"}}));

// Provided strings may end with semicolons and/or whitespace
mapFunction += " ; ";
reduceFunction += " ; ";
assert.commandWorked(col.mapReduce(mapFunction, reduceFunction, {out: "map_reduce_example"}));
out.drop();
assert.commandWorked(
col.mapReduce(mapFunction, reduceFunction, {out: {merge: "map_reduce_example"}}));

// $where exhibits the same behavior
var whereFunction = "function() {return this.price === 25;}";
Expand Down
2 changes: 1 addition & 1 deletion jstests/core/index_stats.js
Expand Up @@ -158,7 +158,7 @@ res = db.runCommand({
return val;
},
query: {b: 2},
out: {inline: true}
out: {inline: 1}
});
assert.commandWorked(res);
countB++;
Expand Down

0 comments on commit 57acc8b

Please sign in to comment.