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

applyOps on capped collections can violate the multi-timestamp constraint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.0.1
    • 5.0.3, 5.1.0-rc0
    • Storage
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Hide

      /**
       * Tests the applyOps command on a capped collection that needs capped deletes.
       *
       * @tags: [requires_capped, requires_replication]
       */
      (function() {
      "use strict";
       
      const rst = new ReplSetTest({nodes: 3});
      rst.startSet();
      rst.initiate();
       
      const dbName = "test";
      const collName = "apply_ops_capped_collection";
       
      const primary = rst.getPrimary();
      const db = primary.getDB(dbName);
       
      assert.commandWorked(db.runCommand({create: collName, capped: true, size: 1024 * 1024, max: 10}));
       
      function nss(dbName, collName) {
          return `${dbName}.${collName}`;
      }
       
      let ops = [];
      for (let i = 0; i < 20; i++) {
          ops.push({op: "i", ns: nss(dbName, collName), ts: Timestamp(i, 0), o: {_id: i}});
      }
       
      assert.commandWorked(db.runCommand({applyOps: ops}));
       
      rst.stopSet();
      }());
      
      

      Show
      /** * Tests the applyOps command on a capped collection that needs capped deletes. * * @tags: [requires_capped, requires_replication] */ (function() { "use strict" ;   const rst = new ReplSetTest({nodes: 3 }); rst.startSet(); rst.initiate();   const dbName = "test" ; const collName = "apply_ops_capped_collection" ;   const primary = rst.getPrimary(); const db = primary.getDB(dbName);   assert .commandWorked(db.runCommand({create: collName, capped: true , size: 1024 * 1024 , max: 10 }));   function nss(dbName, collName) { return `${dbName}.${collName}`; }   let ops = []; for (let i = 0 ; i < 20 ; i++) { ops.push({op: "i" , ns: nss(dbName, collName), ts: Timestamp(i, 0 ), o: {_id: i}}); }   assert .commandWorked(db.runCommand({applyOps: ops}));   rst.stopSet(); }());
    • Execution Team 2021-07-26

    Description

      An applyOps command on a capped collection that needs capped deletes violates the multi-timestamp constraint today.

      Attachments

        Activity

          People

            gregory.wlodarek@mongodb.com Gregory Wlodarek
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: