[SERVER-54488] Rename Collection might take the unsharded path while sharding a collection Created: 12/Feb/21  Updated: 29/Oct/23  Resolved: 19/Feb/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Pierlauro Sciarelli
Resolution: Fixed Votes: 0
Labels: PM-1965-Milestone-0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

0. Create an unsharded collection
1. Run a rename collection which chooses the unsharded rename path
2. A shard collection runs and successfully shards the collection
3. The rename fails because the source collection

Participants:
Case:

 Description   

The new rename collection is checking if the source collection is sharded without any lock before choosing which path to take. This leaves the following scenario to happen:

0. Create an unsharded collection
1. Run a rename collection which chooses the unsharded rename path
2. A shard collection runs and successfully shards the collection
3. The rename fails because the source collection must not be sharded

We could move the unsharded path to inside the coordinator, so the choice can be taken after serializing with other DDL operations.



 Comments   
Comment by Githook User [ 22/Feb/21 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-54488 Fix rename code checking for multiversion suites
Branch: master
https://github.com/mongodb/mongo/commit/042dfa405eea58ff735e338688ffa9f3fd8bbaf0

Comment by Githook User [ 19/Feb/21 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-54488 Rename Collection might take the unsharded path while sharding a collection
Branch: master
https://github.com/mongodb/mongo/commit/e9f91c18323784288cd89cbbb70bc0eca8e89aae

Generated at Thu Feb 08 05:33:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.