[SERVER-26829] Oplog usable as output of mapreduce Created: 28/Oct/16  Updated: 05/Apr/17  Resolved: 16/Mar/17

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

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: William Schultz (Inactive)
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-28356 Disallow writes to oplog from all bui... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2017-03-27
Participants:

 Description   

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.



 Comments   
Comment by William Schultz (Inactive) [ 16/Mar/17 ]

Closing this ticket since it is really demonstrative of a broader issue; namely, how we restrict arbitrary writes to the oplog by normal users. A new ticket that describes this more general problem has been opened here: SERVER-28356.

Comment by Andy Schwerin [ 29/Oct/16 ]

Does the access control system prohibit it, properly?

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