[SERVER-85657] Unsplittable_collections_created_on_any_shard_passthrough may attempt to recreate a collection on a different shard Created: 24/Jan/24  Updated: 02/Feb/24  Resolved: 02/Feb/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 8.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Allison Easton Assignee: Allison Easton
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-80135 Allow ShardCollection to work correct... In Progress
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: CAR Team 2024-02-05
Participants:
Linked BF Score: 150

 Description   

In the implicitly_create_unsplittable_collections_on_random_shards override file, we override both the getCollection and createCollection helpers. In each override, we call createUnsplittableCollectionOnRandomShard and we only check if the collection already exists in the getCollection override.

SERVER-80135 caused the create collection coordinator to emit an error if a collection is created with a different data shard than the collection currently lives on (before this would return ok).

This means that if a test creates an unsplittable collection on shard 0 via getCollection and then explicitly creates that collection, the override for createCollection may try to create the collection on shard 1, causing an AlreadyInitialized error.

We should add a check to the createCollection override that doesn't attempt to create the collection if it already exists.



 Comments   
Comment by Githook User [ 02/Feb/24 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}

Message: SERVER-85657 Unsplittable_collections_created_on_any_shard_passthrough may attempt to recreate a collection on a different shard (#18549)

GitOrigin-RevId: bd07bb975bc97a29edd75e44a2e74fe843350e15
Branch: master
https://github.com/mongodb/mongo/commit/a11ceb368356323e7870925b4171ab03c3cd6c48

Generated at Thu Feb 08 06:58:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.