[SERVER-31300] applyOps command should add collection UUIDs to each of its oplog entries Created: 28/Sep/17  Updated: 30/Oct/23  Resolved: 06/Nov/17

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

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

Issue Links:
Related
related to SERVER-27992 replicate collection UUIDs Closed
is related to SERVER-31295 Rollback of applyOps fails since oplo... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

// Example of 'applyOps' command that generates oplog entries without UUIDs.
(function() {
    "use strict";
 
    let replTest = new ReplSetTest({nodes: 1});
    replTest.startSet();
    replTest.initiate();
    let primary = replTest.getPrimary();
    let testDB = primary.getDB('test');
    testDB["coll"].insert({_id: 0});
 
    let ops = [
        {"op": "i", "ns": "test.coll", "o": {_id: 1}},
    ];
    testDB.adminCommand({applyOps: ops});
    replTest.dumpOplog(primary, {}, 10);
 
})();

Sprint: Repl 2017-10-23, Repl 2017-11-13
Participants:

 Description   

The applyOps command allows users to specify an array of oplog entries to be applied to a replica set node, but it isn't strict about the format of oplog entries given. Oplog entries can be given by a user that don't include a UUID (a ui field) and so they will be inserted into the oplog as is, without UUIDs. We should change this behavior so that, before the given oplog entries are added to the oplog, the appropriate collection UUIDs are added for each entry.



 Comments   
Comment by Githook User [ 06/Nov/17 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-31300 Re-enable applyOps rollback test opWithoutUUID
Branch: master
https://github.com/mongodb/mongo/commit/c97dd9bc1f8652efcc41706b9b40a0829aed587a

Comment by Githook User [ 06/Nov/17 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-31300 applyOps() adds missing UUID to individual operations in the oplog entry
Branch: master
https://github.com/mongodb/mongo/commit/929570fc836a5940781b6809aa79ab9d6a1a1536

Comment by Githook User [ 06/Nov/17 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-31300 use constant from document_validation.h instead of hard-coded 'bypassDocumentValidation' string literal
Branch: master
https://github.com/mongodb/mongo/commit/3eb5a53f7d4ad457e21c2ba0a1497c41724bdb8b

Comment by Githook User [ 06/Nov/17 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-31300 add unit test for applyOps
Branch: master
https://github.com/mongodb/mongo/commit/e7aa63c457a3658c1a69b4c2acaffe1f445ee7f1

Comment by William Schultz (Inactive) [ 23/Oct/17 ]

As part of this ticket, we can re-enable the appropriate test case in the rollback_all_op_types.js test.

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