summaryrefslogtreecommitdiff
path: root/jstests/sharding/shard3.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-11-24 15:24:41 -0500
committerEliot Horowitz <eliot@10gen.com>2009-11-24 15:24:41 -0500
commita46dbe3daee74eda3b23acde0970b60eb301b8e9 (patch)
treed0422765befd03d0ff6ea90d8dcc362ebfa08dba /jstests/sharding/shard3.js
parent7bb0b670e68f569a16079c1c418bbe3acf567d89 (diff)
downloadmongo-a46dbe3daee74eda3b23acde0970b60eb301b8e9.tar.gz
getShardVersion in mongos - diagnostic tools
Diffstat (limited to 'jstests/sharding/shard3.js')
-rw-r--r--jstests/sharding/shard3.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/jstests/sharding/shard3.js b/jstests/sharding/shard3.js
index a956e1f3a1f..099304e9a02 100644
--- a/jstests/sharding/shard3.js
+++ b/jstests/sharding/shard3.js
@@ -49,24 +49,33 @@ secondary.save( { num : -3 } );
doCounts( "after wrong save" )
// --- move all to 1 ---
+print( "MOVE ALL TO 1" );
assert.eq( 2 , s.onNumShards( "foo" ) , "on 2 shards" );
+s.printCollectionInfo( "test.foo" );
assert( a.findOne( { num : 1 } ) )
assert( b.findOne( { num : 1 } ) )
+print( "GOING TO MOVE" );
+s.printCollectionInfo( "test.foo" );
s.adminCommand( { movechunk : "test.foo" , find : { num : 1 } , to : s.getOther( s.getServer( "test" ) ).name } );
+s.printCollectionInfo( "test.foo" );
assert.eq( 1 , s.onNumShards( "foo" ) , "on 1 shard again" );
assert( a.findOne( { num : 1 } ) )
assert( b.findOne( { num : 1 } ) )
-// ---- drop ----
+print( "*** drop" );
+s.printCollectionInfo( "test.foo" , "before drop" );
a.drop();
+s.printCollectionInfo( "test.foo" , "after drop" );
assert.eq( 0 , a.count() , "a count after drop" )
assert.eq( 0 , b.count() , "b count after drop" )
+s.printCollectionInfo( "test.foo" , "after counts" );
+
assert.eq( 0 , primary.count() , "p count after drop" )
assert.eq( 0 , secondary.count() , "s count after drop" )
@@ -76,7 +85,9 @@ secondary.save( { num : 4 } );
assert.eq( 1 , primary.count() , "p count after drop adn save" )
assert.eq( 1 , secondary.count() , "s count after drop save " )
-// this makes sure that sharding knows where things live
+
+print("*** makes sure that sharding knows where things live" );
+
assert.eq( 1 , a.count() , "a count after drop and save" )
assert.eq( 1 , b.count() , "b count after drop and save" )
assert( a.findOne( { num : 1 } ) , "a drop1" );