From 850ee8a42f6774261177048acc31699d11caf50c Mon Sep 17 00:00:00 2001 From: Alberto Lerner Date: Tue, 17 Aug 2010 22:41:46 -0400 Subject: [PATCH 1/2] fix compile warnings --- util/log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/log.h b/util/log.h index 3c829da0864..702e0400502 100644 --- a/util/log.h +++ b/util/log.h @@ -380,7 +380,7 @@ namespace mongo { fflush(logfile); }else{ int x = errno; - cout << "Failed to write to logfile: " << errnoWithDescription(x) << ": " << out << endl; + cout << "Failed to write to logfile: " << errnoWithDescription(x) << endl; } } else { From a4374a22eb7d13a216b87da85592f5611e38b021 Mon Sep 17 00:00:00 2001 From: Alberto Lerner Date: Tue, 17 Aug 2010 23:27:13 -0400 Subject: [PATCH 2/2] make test more robust --- jstests/sharding/shard3.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/jstests/sharding/shard3.js b/jstests/sharding/shard3.js index 9f0cef44cd5..86faedce5ff 100644 --- a/jstests/sharding/shard3.js +++ b/jstests/sharding/shard3.js @@ -139,25 +139,25 @@ assert.eq( 0 , doCounts( "after dropDatabase called" ) ) s.adminCommand( { enablesharding : "test2" } ); s.adminCommand( { shardcollection : "test2.foo" , key : { num : 1 } } ); -a = s.getDB( "test2" ).foo; -b = s2.getDB( "test2" ).foo; -a.save( { num : 1 } ); -a.save( { num : 2 } ); -a.save( { num : 3 } ); - +dba = s.getDB( "test2" ); +dbb = s2.getDB( "test2" ); +dba.foo.save( { num : 1 } ); +dba.foo.save( { num : 2 } ); +dba.foo.save( { num : 3 } ); +dba.getLastError(); assert.eq( 1 , s.onNumShards( "foo" , "test2" ) , "B on 1 shards" ); -assert.eq( 3 , a.count() , "Ba" ); -assert.eq( 3 , b.count() , "Bb" ); +assert.eq( 3 , dba.foo.count() , "Ba" ); +assert.eq( 3 , dbb.foo.count() , "Bb" ); s.adminCommand( { split : "test2.foo" , middle : { num : 2 } } ); s.adminCommand( { movechunk : "test2.foo" , find : { num : 3 } , to : s.getOther( s.getServer( "test2" ) ).name } ); assert.eq( 2 , s.onNumShards( "foo" , "test2" ) , "B on 2 shards" ); -x = a.stats() +x = dba.foo.stats() printjson( x ) -y = b.stats() +y = dbb.foo.stats() printjson( y )