From b0cc3e092880c00cdbd531d88f38cb9e0a52d881 Mon Sep 17 00:00:00 2001 From: Greg Studer Date: Sat, 14 Dec 2013 16:01:30 -0500 Subject: SERVER-11681 mongos upconverts all writes by default --- src/mongo/s/dbclient_shard_resolver.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mongo/s/dbclient_shard_resolver.cpp') diff --git a/src/mongo/s/dbclient_shard_resolver.cpp b/src/mongo/s/dbclient_shard_resolver.cpp index 9f8c45455bd..99c259ccf4b 100644 --- a/src/mongo/s/dbclient_shard_resolver.cpp +++ b/src/mongo/s/dbclient_shard_resolver.cpp @@ -54,7 +54,8 @@ namespace mongo { // Internally uses our shard cache, does no reload Shard shard = Shard::findIfExists( shardName ); if ( shard.getName() == "" ) { - return Status( ErrorCodes::ShardNotFound, "" ); + return Status( ErrorCodes::ShardNotFound, + string("unknown shard name ") + shardName ); } ConnectionString rawShardHost = ConnectionString::parse( shard.getConnString(), errMsg ); @@ -75,7 +76,8 @@ namespace mongo { ReplicaSetMonitorPtr replMonitor = ReplicaSetMonitor::get( rawShardHost.getSetName(), false ); if ( !replMonitor ) { - return Status( ErrorCodes::ReplicaSetNotFound, "" ); + return Status( ErrorCodes::ReplicaSetNotFound, + string("unknown replica set ") + rawShardHost.getSetName() ); } try { @@ -86,7 +88,9 @@ namespace mongo { return Status::OK(); } catch ( const DBException& ex ) { - return Status( ErrorCodes::HostNotFound, "" ); + return Status( ErrorCodes::HostNotFound, + string("could not contact primary for replica set ") + + replMonitor->getName() ); } // Unreachable -- cgit v1.2.1