BugZero found this defect 60 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/20/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
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.
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}));