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

Oplog usable as output of mapreduce

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Repl 2017-03-27

      one:PRIMARY> use local
      switched to db local
      one:PRIMARY> db.foo.insert({_id:'filler'})
      WriteResult({ "nInserted" : 1 })
      one:PRIMARY> x = db.foo.mapReduce(function() {emit(this._id, ":(")}, (key, values)=> values[0], {out: {merge:'oplog.rs'}})
      {
      	"result" : "oplog.rs",
      	"timeMillis" : 12,
      	"counts" : {
      		"input" : 1,
      		"emit" : 1,
      		"reduce" : 0,
      		"output" : 17
      	},
      	"ok" : 1
      }
      one:PRIMARY> db.oplog.rs.find({_id: 'filler'})
      { "_id" : "filler", "value" : ":(" }
      

      This only happens on mmapv1 because wiredtiger rejects oplog entries without a ts field and there is no way to get one out of mapreduce.

            Assignee:
            william.schultz@mongodb.com Will Schultz
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: