BugZero found this defect 68 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/15/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
When the feature flag gTrackUnshardedCollectionsUponCreation is enabled, on movePrimary the call to get unsplittable collections catalogClient->getUnsplittableCollectionNamespacesForDb() returns all unsharded collections. This is added to the list of "tracked collections". However later on when we copy the DB over we create all the collections, but if the collection is a tracked collection we neither copy the indexes over nor copy the contents of the collection over either. Seen on base commit 64dca7eaed26da5ee7547e1d62be599a87678327
Create a two shard cluster. Assuming database "test" lives on "shard-rs1" initially, connect to mongos, and then: // Create an unsharded collection mongos> db.mycoll.insert({a: 1}) // Move primary from the original home "shard-rs1" to "shard-rs0" mongos> db.adminCommand({movePrimary: 'test', to: 'shard-rs0'}) Now if you connect to shard-rs1 directly, you'll see that "test.mycoll" still exists on it.