summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordwight <dwight@dwights-MacBook-Pro.local>2011-04-25 19:17:45 -0400
committerdwight <dwight@dwights-MacBook-Pro.local>2011-04-25 19:17:45 -0400
commit87ab46c3a49ea857dba6dad8c60f51e974139cdf (patch)
treea32924a258719c9c64b9ca2a682732415dd3423e
parentffb3f37978dec9125438f88935ca41b77664463c (diff)
downloadmongo-87ab46c3a49ea857dba6dad8c60f51e974139cdf.tar.gz
detect if we misconfigure and try to connect to a mongos as if it were a config server.
this wasn't being caught on the single cofnig server case. now detected but message is rather cryptic: caught exception in mongos main: 13106 nextSafe(): { $err: "unrecognized command: dbhash", code: 13390 }
-rw-r--r--s/config.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/s/config.cpp b/s/config.cpp
index c1410c9e33f..86b169afe40 100644
--- a/s/config.cpp
+++ b/s/config.cpp
@@ -456,9 +456,6 @@ namespace mongo {
}
bool ConfigServer::checkConfigServersConsistent( string& errmsg , int tries ) const {
- if ( _config.size() == 1 )
- return true;
-
if ( tries <= 0 )
return false;
@@ -485,6 +482,9 @@ namespace mongo {
res.push_back(x);
}
+ if ( _config.size() == 1 )
+ return true;
+
if ( up == 0 ) {
errmsg = "no config servers reachable";
return false;