[SERVER-44016] MR Agg: Replica set M/R fails on unindexed sort Created: 15/Oct/19  Updated: 30/Oct/19  Resolved: 30/Oct/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: James Wahlin Assignee: Jacob Evans
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-44013 MR Agg: Report plan stats and summary... Closed
Related
is related to SERVER-44013 MR Agg: Report plan stats and summary... Closed
Sprint: Query 2019-11-04
Participants:

 Description   

The following runs this example M/R: https://docs.mongodb.com/manual/reference/command/mapReduce/#return-the-total-price-per-customer

> db.orders.find()
{ "_id" : ObjectId("50a8240b927d5d8b5891743c"), "cust_id" : "abc123", "ord_date" : ISODate("2012-10-04T04:00:00Z"), "status" : "A", "price" : 25, "items" : [ { "sku" : "mmm", "qty" : 5, "price" : 2.5 }, { "sku" : "nnn", "qty" : 5, "price" : 2.5 } ] }
{ "_id" : ObjectId("5da5c295dc647eaad8d02f9d"), "cust_id" : "abc123", "ord_date" : ISODate("2012-10-04T04:00:00Z"), "status" : "A", "price" : 35, "items" : [ { "sku" : "mmm", "qty" : 5, "price" : 2.5 }, { "sku" : "nnn", "qty" : 5, "price" : 2.5 } ] }
{ "_id" : ObjectId("5da5c2a2dc647eaad8d02f9e"), "cust_id" : "abc123", "ord_date" : ISODate("2012-10-04T04:00:00Z"), "status" : "A", "price" : 40, "items" : [ { "sku" : "mmm", "qty" : 5, "price" : 2.5 }, { "sku" : "nnn", "qty" : 5, "price" : 2.5 } ] }
{ "_id" : ObjectId("5da5c2aedc647eaad8d02f9f"), "cust_id" : "abc123", "ord_date" : ISODate("2012-10-04T04:00:00Z"), "status" : "A", "price" : 45, "items" : [ { "sku" : "mmm", "qty" : 5, "price" : 2.5 }, { "sku" : "nnn", "qty" : 5, "price" : 2.5 } ] }
{ "_id" : ObjectId("5da5c2bbdc647eaad8d02fa0"), "cust_id" : "abc123", "ord_date" : ISODate("2012-10-04T04:00:00Z"), "status" : "A", "price" : 50, "items" : [ { "sku" : "mmm", "qty" : 5, "price" : 2.5 }, { "sku" : "nnn", "qty" : 5, "price" : 2.5 } ] }
> db.orders.mapReduce(                      mapFunction1,                      reduceFunction1,                      { out: {inline: 1},  sort: {price1: 1}, limit: 1 }                    )
2019-10-15T10:33:15.339-0400 E  QUERY    [js] uncaught exception: Error: map reduce failed:{
	"ok" : 0,
	"errmsg" : "Attempting to use external sort without setting SortOptions::tempDir",
	"code" : 17149,
	"codeName" : "Location17149"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBCollection.prototype.mapReduce@src/mongo/shell/collection.js:1047:15
@(shell):1:1
> 


Generated at Thu Feb 08 05:04:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.