Operational Defect Database

BugZero found this defect 37 days ago.

MongoDB | 2640374

MoveCollection fails for capped collections

Last update date:

4/12/2024

Affected products:

MongoDB Server

Affected releases:

8.0.0-rc0

Fixed releases:

No fixed releases provided.

Description:

Info

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

Top User Comments


Steps to Reproduce

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();

Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...