[SERVER-54015] Race condition in the `shardCollectionLegacy` logic due to usage of CatalogCache instead of CSS Created: 25/Jan/21  Updated: 29/Oct/23  Resolved: 29/Jan/21

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

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: PM-1965-Cleanup, Sharding-EMEA, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-52616 Create the _shardsvrCreateCollection ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2021-02-08
Participants:
Linked BF Score: 59

 Description   

When the legacy shardCollection logic runs, it does an optimistic check of whether the collection is already sharded with the same options using direct reads from the config server. However, later on it uses the CatalogCache in order to return information about the collection.

If the collection was sharded from another node, the CatalogCache is not guaranteed to be up to date and it is possible that it returns that a collection is unsharded (even though it is sharded on the config server).

Because of this, the check needs to be done using the CSS instead of direct reads.



 Comments   
Comment by Githook User [ 29/Jan/21 ]

Author:

{'name': 'Marcos José Grillo Ramírez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-54015 Use catalog cache with a refresh to check if a collection was already created when sharding
Branch: master
https://github.com/mongodb/mongo/commit/cc088fe029f2da2deb439c4808a6a6eb280c5adf

Comment by Kaloian Manassiev [ 25/Jan/21 ]

I believe this came from SERVER-52616, so assigning it to marcos.grillo.

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