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

MoveCollection fails for capped collections

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc5
    • Affects Version/s: 8.0.0-rc0
    • Component/s: None
    • None
    • Cluster Scalability
    • Fully Compatible
    • ALL
    • v8.0
    • Hide
      const dbName = 'test';
      const collName = 'foo';
      
      const st = new ShardingTest({mongos: 1, shards: 2});
      const db = st.s.getDB(dbName);
      const coll = db[collName]
      
      assert.commandWorked(
          st.s.adminCommand({enableSharding: dbName, primaryShard: st.shard0.shardName}));
      
      // Create a capped collection.
      assert.commandWorked(db.createCollection(collName, {capped: true, size: 1000}));
      
      // Insert more than one document to it.
      assert.commandWorked(coll.insertMany([{x: 0}, {x: 1}]));
      
      // Move the collection.
      assert.commandWorked(st.s.adminCommand(
          {moveCollection: coll.getFullName(), toShard: st.shard1.shardName}));  // <- Fails here
      
      st.stop();
      
      Show
      const dbName = 'test' ; const collName = 'foo' ; const st = new ShardingTest({mongos: 1, shards: 2}); const db = st.s.getDB(dbName); const coll = db[collName] assert.commandWorked( st.s.adminCommand({enableSharding: dbName, primaryShard: st.shard0.shardName})); // Create a capped collection. assert.commandWorked(db.createCollection(collName, {capped: true , size: 1000})); // Insert more than one document to it. assert.commandWorked(coll.insertMany([{x: 0}, {x: 1}])); // Move the collection. assert.commandWorked(st.s.adminCommand( {moveCollection: coll.getFullName(), toShard: st.shard1.shardName})); // <- Fails here st.stop();
    • Cluster Scalability 2024-4-29, Cluster Scalability 2024-5-13
    • 5

      moveCollection on a capped collection containing more than one document fails with the following error:

      Recipient shard repro-rs1 reached an unrecoverable error :: caused by :: Can't batch inserts into indexed capped collections
      

            Assignee:
            brett.nawrocki@mongodb.com Brett Nawrocki
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: