diff options
Diffstat (limited to 'jstests/sharding/count_slaveok.js')
-rw-r--r-- | jstests/sharding/count_slaveok.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/jstests/sharding/count_slaveok.js b/jstests/sharding/count_slaveok.js index 470174890c4..410e2e4a4f3 100644 --- a/jstests/sharding/count_slaveok.js +++ b/jstests/sharding/count_slaveok.js @@ -1,21 +1,22 @@ // Tests count and distinct using slaveOk. Also tests a scenario querying a set where only one // secondary is up. (function() { +'use strict'; var st = new ShardingTest({ name: "countSlaveOk", shards: 1, mongos: 1, - other: { rs : true, - rs0 : { nodes : 2 } } }); + other: { rs: true, + rs0: { nodes: 2 } } }); var rst = st._rs[0].test; // Insert data into replica set -var conn = new Mongo( st.s.host ) -conn.setLogLevel( 3 ) +var conn = new Mongo(st.s.host); +conn.setLogLevel(3); -var coll = conn.getCollection( "test.countSlaveOk" ) -coll.drop() +var coll = conn.getCollection('test.countSlaveOk'); +coll.drop(); var bulk = coll.initializeUnorderedBulkOp(); for( var i = 0; i < 300; i++ ){ @@ -36,7 +37,7 @@ var primary = rst.getPrimary() var sec = rst.getSecondary() // Data now inserted... stop the master, since only two in set, other will still be secondary -rst.stop(rst.getMaster()); +rst.stop(rst.getPrimary()); printjson( rst.status() ) // Wait for the mongos to recognize the slave |