[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: |
|
||||||||||||
| 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: |
| Comment by Kaloian Manassiev [ 25/Jan/21 ] |
|
I believe this came from |