Permalink
Browse files

SERVER-3529: Sharded map reduce using merge stalls recreating indexes…

… on the output collection
  • Loading branch information...
1 parent bc8b2ef commit f3bd113e0df642703fda8cc9fe7f6cdf6503e5e8 @agirbal agirbal committed Aug 30, 2011
Showing with 5 additions and 1 deletion.
  1. +1 −1 db/commands/mr.cpp
  2. +4 −0 jstests/sharding/bigMapReduce.js
View
@@ -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 );
@@ -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" )

0 comments on commit f3bd113

Please sign in to comment.