[SERVER-55280] Change the locked AutoGetCollection* helpers to use a shared_ptr<const Collection>, as the lock-free versions, to simplify code Created: 17/Mar/21 Updated: 29/Oct/23 Resolved: 02/Mar/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Dianna Hohensee (Inactive) | Assignee: | Henrik Edin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Storage Execution
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Execution Team 2023-03-06 | ||||||||
| Participants: | |||||||||
| Description |
|
TLDR; this is an attempt to simplify the collection helper code by consolidating underlying raw point and shared pointer to Collection instances to all be shared pointers. My targeted goal is to eliminate this type handling wherein the function return type is extracted from a function parameter. There are many changes that would be required to do this, and, if they work, would simplify other code complicated by juggling two possible Collection pointer types (raw pointer and shared_ptr). These are some points in the code of interest to eliminate
I'd like to simplify CollectionPtr as well, which currently handles both raw and shared Collection pointer types. |
| Comments |
| Comment by Githook User [ 02/Mar/23 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: Cleanup and clarify requirements for Collection instances to remain valid in CollectionCatalog header |
| Comment by Henrik Edin [ 23/Sep/22 ] |
|
dianna.hohensee@mongodb.com I think we should be able to remove shared_ptr from the interfaces and only expose raw pointers. The lifetimes should be managed by either stashing a catalog or in a decoration on the recovery unit for uncommitted read/write instances. |
| Comment by Dianna Hohensee (Inactive) [ 22/Sep/22 ] |
|
henrik.edin@mongodb.com would we want this to be an underlying Collection* at this point, rather than a shared_ptr<const Collection>? Since LFR AGC* hold a catalog copy, and locked AGC* hold collection IX locks. |