[SERVER-47885] Have lookupCollectionBy{Namespace,UUID} return a shared_ptr Created: 01/May/20  Updated: 29/Oct/23  Resolved: 07/Aug/20

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

Type: New Feature Priority: Major - P3
Reporter: Geert Bosch Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-44146 Instead of looking at 'local.oplog.' ... Closed
Related
is related to SERVER-49714 Oplog visibility thread may read from... Closed
is related to SERVER-50819 Stop the OplogManager during shutdown... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-05-18, Execution Team 2020-06-01, Execution Team 2020-06-29, Execution Team 2020-07-13, Execution Team 2020-07-27, Execution Team 2020-08-10
Participants:
Linked BF Score: 15

 Description   

Have CollectionCatalog::lookupCollectionBy

{Namespace,UUID}

return shared_ptr<const Collection>, so it can be used without further locking or other concurrency control.



 Comments   
Comment by Githook User [ 07/Aug/20 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-47885 Added lookupCollectionByXXXForRead interface to the Collection catalog that returns collection as shared_ptr<const Collection>

AutoGetCollectionForRead and AutoGetCollectionForReadCommand now uses this and holds the shared_ptr. They return the collection as const.
Const correct various places to make this possible.

Moved some logic from Collection destructors to deregister from the catalog as they may now be destroyed at a later point.
Branch: master
https://github.com/mongodb/mongo/commit/9de175fb3776415e7237e6c0af4b76f518adc451

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