[SERVER-33035] The doTxn command doesn't error when inserting a document that already exists Created: 31/Jan/18  Updated: 06/Dec/22  Resolved: 13/Feb/18

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

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Backlog - Replication Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Replication
Operating System: ALL
Steps To Reproduce:

(function() {
    const coll = db.mycoll;
    coll.drop();
 
    assert.commandWorked(db.runCommand({create: coll.getName()}));
    assert.commandFailedWithCode(db.adminCommand({
        applyOps: [
            {op: "i", ns: coll.getFullName(), o: {_id: 1}},
            {op: "i", ns: coll.getFullName(), o: {_id: 1}},
        ]
    }),
                                 ErrorCodes.DuplicateKey);
 
})();

Participants:

 Description   

This means operations of type op='i' aren't equivalent to an insert command of the same document. I suspect this is just because the "doTxn" has implicitly inherited some of the idempotency behaviors by leveraging the applyOperation_inlock() machinery.



 Comments   
Comment by Spencer Brody (Inactive) [ 13/Feb/18 ]

We're not investing in doTxn right now as there are no current plans to release it publicly.

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