summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorgregs <greg@10gen.com>2012-06-09 15:08:43 -0400
committergregs <greg@10gen.com>2012-06-09 15:08:43 -0400
commitf1852efa8e4e5d702c472c35fb45d0a29a90d7d3 (patch)
tree60062d36b769c8d99c34848bace12be66b9f720a /src/mongo/s
parent20fae4312bf08b06508c0897d71daf173266238e (diff)
downloadmongo-f1852efa8e4e5d702c472c35fb45d0a29a90d7d3.tar.gz
Revert "SERVER-4262 sharded indexing depends on the db sharding status"
This reverts commit 13aa0a0276eb239454da00d65f8f15aa1a97bb10.
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/strategy_shard.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/s/strategy_shard.cpp b/src/mongo/s/strategy_shard.cpp
index bacd38925ce..30157566277 100644
--- a/src/mongo/s/strategy_shard.cpp
+++ b/src/mongo/s/strategy_shard.cpp
@@ -888,14 +888,19 @@ namespace mongo {
// TODO: This block goes away, system.indexes needs to handle better
if( isIndexWrite ){
- if ( r.getConfig()->isShardingEnabled() ){
+ ShardPtr primary;
+ ChunkManagerPtr manager;
+
+ r.getConfig()->getChunkManagerOrPrimary( ns, manager, primary );
+
+ if ( manager ){
LOG(1) << "sharded index write for " << ns << endl;
handleIndexWrite( op , r );
return;
}
LOG(3) << "single index write for " << ns << endl;
- SINGLE->doWrite( op , r , Shard( r.getConfig()->getPrimary() ) );
+ SINGLE->doWrite( op , r , *primary );
r.gotInsert(); // Won't handle mulit-insert correctly. Not worth parsing the request.
return;