summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authoragirbal <antoine@10gen.com>2012-04-02 22:37:27 -0700
committeragirbal <antoine@10gen.com>2012-04-05 18:00:06 -0700
commita139832baaf9a4e1e3a4658ab1ced12f0e68b41c (patch)
tree89cdaa1f896902a508ec1aced42d3d15355c249a /jstests
parent061d2e3a2adf2c9f3ba39c252ff6a140a6fd31c2 (diff)
downloadmongo-a139832baaf9a4e1e3a4658ab1ced12f0e68b41c.tar.gz
SERVER-5357: Map/Reduce operation writes output data in primary node of replica set but not in secondary nodes
Diffstat (limited to 'jstests')
-rw-r--r--jstests/sharding/bigMapReduce.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/jstests/sharding/bigMapReduce.js b/jstests/sharding/bigMapReduce.js
index 57f8dfac481..1f941413226 100644
--- a/jstests/sharding/bigMapReduce.js
+++ b/jstests/sharding/bigMapReduce.js
@@ -1,4 +1,4 @@
-s = new ShardingTest( "bigMapReduce" , 2 , 1 , 1 , { chunksize : 1 } );
+s = new ShardingTest( "bigMapReduce" , 2 , 1 , 1 , { rs: true, numReplicas: 2, chunksize : 1 } );
// reduce chunk size to split
var config = s.getDB("config");
@@ -129,5 +129,13 @@ assert.eq( 51200 , out.counts.emit , "Received wrong result" );
assert.eq( 51200 , out.counts.output , "Received wrong result" );
assert.eq( 2 , db[outcol].findOne().value , "Received wrong result" );
+// verify that data is also on secondary
+var primary = s._rs[0].test.liveNodes.master
+var secondaries = s._rs[0].test.liveNodes.slaves
+assert.eq( 51200 , primary.getDB("test")[outcol].count() , "Wrong count" );
+for (var i = 0; i < secondaries.length; ++i) {
+ assert.eq( 51200 , secondaries[i].getDB("test")[outcol].count() , "Wrong count" );
+}
+
s.stop()