summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoragirbal <antoine@10gen.com>2011-08-29 23:02:47 -0700
committeragirbal <antoine@10gen.com>2011-08-29 23:14:23 -0700
commitf3bd113e0df642703fda8cc9fe7f6cdf6503e5e8 (patch)
treee70214227ba21c4996e409dee09c3ee6d7f1f244
parentbc8b2ef3cc55a18274920ededbba6e18e99626e4 (diff)
downloadmongo-f3bd113e0df642703fda8cc9fe7f6cdf6503e5e8.tar.gz
SERVER-3529: Sharded map reduce using merge stalls recreating indexes on the output collection
-rw-r--r--db/commands/mr.cpp2
-rw-r--r--jstests/sharding/bigMapReduce.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/db/commands/mr.cpp b/db/commands/mr.cpp
index b9f5b59821c..17ff84a9431 100644
--- a/db/commands/mr.cpp
+++ b/db/commands/mr.cpp
@@ -508,7 +508,7 @@ namespace mongo {
_scope->injectNative( "emit" , fast_emit );
- if ( _onDisk ) {
+ if ( _onDisk && _config.incLong != _config.tempLong ) {
// clear temp collections
_db.dropCollection( _config.tempLong );
_db.dropCollection( _config.incLong );
diff --git a/jstests/sharding/bigMapReduce.js b/jstests/sharding/bigMapReduce.js
index 3cc1d66405a..b4a293b1d58 100644
--- a/jstests/sharding/bigMapReduce.js
+++ b/jstests/sharding/bigMapReduce.js
@@ -67,6 +67,10 @@ for (iter = 0; iter < 5; iter++) {
print("checking result field");
assert.eq(res.result.collection, outCollStr, "Wrong collection " + res.result.collection);
assert.eq(res.result.db, outDbStr, "Wrong db " + res.result.db);
+
+ // make sure final collection has index on _id
+ assert(outDb.system.indexes.count({ns: outDbStr + "." + outCollStr, key: {_id: 1}}) > 0, "No index on _id")
+ assert( gotAGoodOne , "no good for out db" )
}
assert( gotAGoodOne , "no good for out db" )