summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-01-23 18:42:14 -0500
committerEliot Horowitz <eliot@10gen.com>2011-01-23 18:42:14 -0500
commite2b9ab610d06030a7ecce42c10643f57fc07e4c7 (patch)
treee96f280d2d0bda3e93e5a2f1c5704a0542208630
parentfea817552a5624875a1fe31909a8e178f5b506c8 (diff)
downloadmongo-e2b9ab610d06030a7ecce42c10643f57fc07e4c7.tar.gz
fix m/r when a sharded connection for a non-sharded collection
-rw-r--r--db/commands/mr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/db/commands/mr.cpp b/db/commands/mr.cpp
index 1e4cc3b553f..834d6f64cf0 100644
--- a/db/commands/mr.cpp
+++ b/db/commands/mr.cpp
@@ -725,8 +725,11 @@ namespace mongo {
Client::Context ctx( config.ns );
ShardChunkManager::Snapshot chunkSnapshot;
- if ( shardingState.needShardChunkManager( config.ns ) )
- chunkSnapshot = shardingState.getShardChunkManager( config.ns )->snapshot();
+ if ( shardingState.needShardChunkManager( config.ns ) ) {
+ ShardChunkManagerPtr p = shardingState.getShardChunkManager( config.ns );
+ if ( p )
+ chunkSnapshot = p->snapshot();
+ }
shared_ptr<Cursor> temp = bestGuessCursor( config.ns.c_str(), config.filter, config.sort );
auto_ptr<ClientCursor> cursor( new ClientCursor( QueryOption_NoCursorTimeout , temp , config.ns.c_str() ) );