summaryrefslogtreecommitdiff
path: root/s/request.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-09-01 16:30:20 -0400
committerEliot Horowitz <eliot@10gen.com>2009-09-01 16:30:20 -0400
commitcff5abd2f140e73455c469d7242a55882650785b (patch)
tree26491fe2bda9d0a9e1a4bcb9fc646415435149b7 /s/request.cpp
parent7c11076e7334c6420d33f9d442f7eb3ddba4f4d4 (diff)
downloadmongo-cff5abd2f140e73455c469d7242a55882650785b.tar.gz
sharding indexing fix part1
- inserts to system.indexes need to go to all shards - can't create unique index on sharded collection SHARDING-24
Diffstat (limited to 's/request.cpp')
-rw-r--r--s/request.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/s/request.cpp b/s/request.cpp
index ade683abb63..83a42b3f990 100644
--- a/s/request.cpp
+++ b/s/request.cpp
@@ -42,11 +42,11 @@ namespace mongo {
_config = grid.getDBConfig( getns() );
if ( _config->isSharded( getns() ) ){
- _shardInfo = _config->getChunkManager( getns() , reload );
- uassert( (string)"no shard info for: " + getns() , _shardInfo );
+ _chunkManager = _config->getChunkManager( getns() , reload );
+ uassert( (string)"no shard info for: " + getns() , _chunkManager );
}
else {
- _shardInfo = 0;
+ _chunkManager = 0;
}
_m.data->id = _id;
@@ -54,10 +54,10 @@ namespace mongo {
}
string Request::singleServerName(){
- if ( _shardInfo ){
- if ( _shardInfo->numChunks() > 1 )
+ if ( _chunkManager ){
+ if ( _chunkManager->numChunks() > 1 )
throw UserException( "can't call singleServerName on a sharded collection" );
- return _shardInfo->findChunk( _shardInfo->getShardKey().globalMin() ).getShard();
+ return _chunkManager->findChunk( _chunkManager->getShardKey().globalMin() ).getShard();
}
string s = _config->getShard( getns() );
uassert( "can't call singleServerName on a sharded collection!" , s.size() > 0 );
@@ -98,9 +98,8 @@ namespace mongo {
_d.markReset();
}
- if ( _shardInfo ){
- //if ( _shardInfo->numShards() > 1 )
- s = SHARDED;
+ if ( _chunkManager ){
+ s = SHARDED;
}
if ( op == dbQuery ) {