summaryrefslogtreecommitdiff
path: root/jstests/sharding/presplit.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/presplit.js')
-rw-r--r--jstests/sharding/presplit.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/jstests/sharding/presplit.js b/jstests/sharding/presplit.js
index 6820a5fb332..894ea473a79 100644
--- a/jstests/sharding/presplit.js
+++ b/jstests/sharding/presplit.js
@@ -3,6 +3,9 @@
// Starts a new sharding environment limiting the chunksize to 1MB.
s = new ShardingTest( "presplit" , 2 , 2 , 1 , { chunksize : 1 } );
+s.adminCommand( { enablesharding : "test" } );
+s.ensurePrimaryShard('test', 'shard0001');
+
// Insert enough data in 'test.foo' to fill several chunks, if it was sharded.
bigString = "";
while ( bigString.length < 10000 ){
@@ -25,8 +28,6 @@ primary = s.getServer( "test" ).getDB( "test" );
assert.eq( 0 , s.config.chunks.count() , "single chunk assertion" );
assert.eq( num , primary.foo.count() );
-// Turn on sharding on the 'test.foo' collection
-s.adminCommand( { enablesharding : "test" } );
s.adminCommand( { shardcollection : "test.foo" , key : { _id : 1 } } );
// Make sure the collection's original chunk got split