3
{ } // just use default params
6
var st = new ShardingTest({ shards: shardOpts, other: { nopreallocj: 1 }});
9
st.shardColl('bar', { x: 1 });
11
var testDB = mongos.getDB('test');
12
var coll = testDB.bar;
14
coll.insert({ x: 1 });
16
var map = function() {
20
var reduce = function(key, values) {
24
var mrResult = testDB.runCommand({ mapreduce: 'bar', map: map, reduce: reduce,
27
assert.eq(0, mrResult.ok, 'mr result: ' + tojson(mrResult));
29
// Confirm that mongos did not crash
30
assert(testDB.adminCommand({ serverStatus: 1 }).ok);
32
// Confirm that the rest of the shards did not crash
33
mongos.getDB('config').shards.find().forEach(function (shardDoc){
34
var shardConn = new Mongo(shardDoc.host);
35
var adminDB = shardConn.getDB('admin');
36
var cmdResult = adminDB.runCommand({ serverStatus: 1 });
38
assert(cmdResult.ok, 'serverStatus on ' + shardDoc.host +
39
' failed, result: ' + tojson(cmdResult));