0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

when using rs as a shard, only name matters

This commit is contained in:
Eliot Horowitz 2010-10-10 20:00:09 -04:00
parent 61ab457c34
commit f6141d9bac
2 changed files with 7 additions and 2 deletions

View File

@ -64,7 +64,7 @@ namespace mongo {
void enable( const string& server );
void gotShardName( const string& name );
void gotShardHost( const string& host );
void gotShardHost( string host );
bool hasVersion( const string& ns );
bool hasVersion( const string& ns , ConfigVersion& version );

View File

@ -76,7 +76,12 @@ namespace mongo {
uasserted( 13298 , ss.str() );
}
void ShardingState::gotShardHost( const string& host ){
void ShardingState::gotShardHost( string host ){
size_t slash = host.find( '/' );
if ( slash != string::npos )
host = host.substr( 0 , slash );
if ( _shardHost.size() == 0 ){
_shardHost = host;
return;