From ed4a804c027562e1bf6a0f45dae7326198c29f8e Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Fri, 10 Dec 2010 13:05:34 +0100 Subject: Imported Upstream version 1.6.5 --- jstests/slowNightly/sharding_migrate_cursor1.js | 65 +++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 jstests/slowNightly/sharding_migrate_cursor1.js (limited to 'jstests/slowNightly/sharding_migrate_cursor1.js') diff --git a/jstests/slowNightly/sharding_migrate_cursor1.js b/jstests/slowNightly/sharding_migrate_cursor1.js new file mode 100644 index 0000000..7198102 --- /dev/null +++ b/jstests/slowNightly/sharding_migrate_cursor1.js @@ -0,0 +1,65 @@ + +chunksize = 25 + +s = new ShardingTest( "migrate_cursor1" , 2 , 1 , 1 , { chunksize : chunksize } ); + +s.config.settings.update( { _id: "balancer" }, { $set : { stopped: true } } , true ); + +s.adminCommand( { enablesharding : "test" } ); +db = s.getDB( "test" ) +t = db.foo + +bigString = "" +stringSize = 1024; + +while ( bigString.length < stringSize ) + bigString += "asdasdas"; + +stringSize = bigString.length +docsPerChunk = Math.ceil( ( chunksize * 1024 * 1024 ) / ( stringSize - 12 ) ) +numChunks = 5 +numDocs = 20 * docsPerChunk + +print( "stringSize: " + stringSize + " docsPerChunk: " + docsPerChunk + " numDocs: " + numDocs ) + +for ( i=0; i 0; } , "XXX" , 30000 , 1 ) + + +print( "itcount: " + x.itcount() ) +x = null; +for ( i=0; i<5; i++ ) gc() + +print( "cursor should be gone" ) + +join(); + +//assert.soon( function(){ return numDocs == t.count(); } , "at end 1" ) +sleep( 5000 ) +assert.eq( numDocs , t.count() , "at end 2" ) +assert.eq( numDocs , primary.count() + secondary.count() , "at end 3" ) + +s.stop() -- cgit v1.2.3