diff options
author | gregs <greg@10gen.com> | 2011-06-30 14:13:48 -0400 |
---|---|---|
committer | gregs <greg@10gen.com> | 2011-06-30 14:13:48 -0400 |
commit | c40ec7638318696be5eaa07f83a859af2b76ff66 (patch) | |
tree | 6e57cf18c5bfbd0583c447a39e10b925003d14cf /s | |
parent | 930611d96e57061155f15ebb757ddd9acdaee710 (diff) | |
download | mongo-c40ec7638318696be5eaa07f83a859af2b76ff66.tar.gz |
don't hide first connection warning for shards
Diffstat (limited to 's')
-rw-r--r-- | s/shardconnection.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/s/shardconnection.cpp b/s/shardconnection.cpp index c1b4b8406fa..7aec50188df 100644 --- a/s/shardconnection.cpp +++ b/s/shardconnection.cpp @@ -41,6 +41,9 @@ namespace mongo { boost::function4<bool, DBClientBase&, const string&, bool, int> checkShardVersionCB = defaultCheckShardVersion; boost::function1<void, DBClientBase*> resetShardVersionCB = defaultResetShardVersion; + // Only print the non-top-level-shard-conn warning once if not verbose + volatile bool printedShardConnWarning = false; + /** * holds all the actual db connections for a client to various servers * 1 pre thread, so don't have to worry about thread safety @@ -81,7 +84,7 @@ namespace mongo { // Determine if non-shard conn is RS member for warning // All shards added to _hosts if not present in _check() - if( logLevel >= 1 && _hosts.find( addr ) == _hosts.end() ){ + if( ( logLevel >= 1 || ! printedShardConnWarning ) && _hosts.find( addr ) == _hosts.end() ){ vector<Shard> all; Shard::getAllShards( all ); @@ -98,6 +101,7 @@ namespace mongo { } if( isRSMember ){ + printedShardConnWarning = true; warning() << "adding shard sub-connection " << addr << " (parent " << parentShard << ") as sharded, this is safe but unexpected" << endl; printStackTrace(); } |