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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc3
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      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);   })();
    • Sprint:
      Repl 2017-10-23, Repl 2017-11-13

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: