-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.2.18, 3.4.10, 3.6.0
-
Component/s: Internal Code, Replication, Write Ops
-
None
-
Fully Compatible
-
ALL
-
v3.6, v3.4, v3.2
-
Repl 2018-01-15, Repl 2018-01-29, Repl 2018-02-12
An applyOps inside of another applyOps always succeeds even where there's an error applying an operation:
var oplog = {op:"i", ns: "test.test", o: {_id: 1}} db.dropDatabase() var res = db.adminCommand({applyOps: [oplog]}) print('Invalid applyOps:' + tojson(res)) // Command fails: // Invalid applyOps:{ // "applied" : 1, // "code" : 26, // "errmsg" : "Failed to apply insert due to missing collection: { op: \"i\", ns: \"test.test\", o: { _id: 1.0 } }", // "results" : [ // false // ], // "ok" : 0 // } res = db.adminCommand({applyOps: [{op: "c", ns: "admin.$cmd", o: {applyOps: [oplog]}}]}) print('Nested invalid applyOps:' + tojson(res)) // Command succeeds: // Nested invalid applyOps:{ // "applied" : 1, // "results" : [ // true // ], // "ok" : 1 // }