[SERVER-46593] Remove locks from ShardServerProcessInterface by directly accessing the routing info Created: 03/Mar/20  Updated: 29/Oct/23  Resolved: 02/Apr/20

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

Type: Task Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: PM-1645-Milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-46703 Make a variant of checkShardVersionOr... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-03-23, Sharding 2020-04-06
Participants:

 Description   

The locks acquired here:

https://github.com/mongodb/mongo/blob/323b567d32c787eced20822f708e6e6951174714/src/mongo/db/pipeline/process_interface/shardsvr_process_interface.cpp#L97-L100

do not cover the entire lifetime of the ScopedCollectionMetadata. Thus it is possible that we are accessing the metadata after that it have been actually dropped.
We should instead access directly the routing info here that doesn't require any lock mechanism.



 Comments   
Comment by Githook User [ 23/Mar/20 ]

Author:

{'email': 'kaloian.manassiev@mongodb.com', 'name': 'Kaloian Manassiev', 'username': 'kaloianm'}

Message: SERVER-46593 Use the CatalogCache directly in ShardServerProcessInterface::collectDocumentKeyFieldsForHostedCollection
Branch: master
https://github.com/mongodb/mongo/commit/5b4a8ab051b00579cb8f4957067ee05fbee279c3

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