[SERVER-60318] (Investigation) Create something similar to WithLock for AutoGetCollection Created: 29/Sep/21  Updated: 06/Dec/22

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

Type: New Feature Priority: Major - P3
Reporter: Haley Connelly Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 0
Labels: techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-68942 Use type-checking to ensure correct D... Backlog
Assigned Teams:
Storage Execution
Participants:

 Description   

When there is a mutex, we have methods that contain mymethodname(….m WithLock) to enforce a lock is taken.

It would be cool to have a Wrapper similar to WithLock that works with AutoGetCollection and forces callers to be holding AutoGetCollection with a certain level of lock before calling the function.



 Comments   
Comment by Yuhong Zhang [ 05/Oct/21 ]

This will require more design and investigations. Not high priority for now.

Comment by Dianna Hohensee (Inactive) [ 30/Sep/21 ]

louis.williams CollectionPtrs can be fetched directly from the CollectionCatalog, as well as via AutoGet* instances. I think anywhere we invariant isCollectionLockedForMode, and such, would be good candidates.

Comment by Louis Williams [ 30/Sep/21 ]

Passing a Collection pointer, and now with LFR, CollectionPtr, usually provides the guarantee that the caller is holding a lock on the collection, because a collection pointer may only be obtained by first taking a lock.

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