Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-44016

MR Agg: Replica set M/R fails on unindexed sort

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query 2019-11-04

      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
      > 
      
      

            Assignee:
            jacob.evans@mongodb.com Jacob Evans
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: