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

applyOps command should add collection UUIDs to each of its oplog entries

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc3
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide
      // 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);
      
      })();
      
      Show
      // 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); })();
    • Repl 2017-10-23, Repl 2017-11-13

      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.

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            william.schultz@mongodb.com William Schultz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: