Operational Defect Database

BugZero found this defect 60 days ago.

MongoDB | 2614913

Disallow tracking unsupported collection types as part of moveCollection

Last update date:

3/20/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

There are some types of unsharded collections that are not currently trackable in the config server. SERVER-87625 changed moveCollection to register the namespace it's being called on. It does so by reusing the create command that eventually ends up calling the create coordinator. Since the command is invoked without the current collection options, those checks are skipped and we may end up tracking an unsupported type of collection.

Top User Comments


Steps to Reproduce

const st = new ShardingTest( {mongos: 1, shards: 2} ); const mongos = st.s; const shard0 = st.shard0.shardName; const shard1 = st.shard1.shardName; const dbName = "db"; const collName = "coll"; const ns = dbName + '.' + collName; assert.commandWorked(mongos.adminCommand( {enableSharding: dbName, primaryShard: shard0} )); assert.commandWorked(mongos.getDB(dbName).runCommand({create: collName, timeseries: {timeField: 'time'}})); // Fail because moving timeseries is not supported yet assert.commandFailedWithCode(mongos.adminCommand( {moveCollection: unsplittableCollNs, toShard: shard1} ), ErrorCodes.NotImplemented); // The moveCollection command tracked the collection on the config server (even though timeseries are not properly supported ATM) assert.eq(1, mongos.getDB('config').collections.countDocuments({_id: dbName + '.system.buckets.' + collName}));

Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Open

Learn More

Search:

...