[SERVER-40681] Make AutoGetCollection interface match AutoGetDB Created: 16/Apr/19  Updated: 29/Oct/23  Resolved: 18/Jun/19

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

Type: Improvement Priority: Major - P3
Reporter: Eric Milkie Assignee: Gregory Noma
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-06-17, Execution Team 2019-07-01
Participants:

 Description   

The current interface is confusing, and the AutoGetDB one makes a lot of sense, so I think we should copy that.



 Comments   
Comment by Githook User [ 18/Jun/19 ]

Author:

{'name': 'Gregory Noma', 'email': 'gregory.noma@gmail.com', 'username': 'gregorynoma'}

Message: SERVER-40681 Make AutoGetCollection interface match AutoGetDB
Branch: master
https://github.com/mongodb/mongo/commit/4e7baa088cd86b378386bb78ee49298011d67b32

Comment by Daniel Gottlieb (Inactive) [ 19/Apr/19 ]

Capturing the discussion in the needs triage meeting that clarifies the request. The ticket is proposing the following constructor signature and semantics:

AutoGetCollection(OperationContext*, NamespaceStringOrUUID nsUUID, LockMode lockMode);
 
| nsUUID    | Result                         |
|-----------+--------------------------------|
| Not Found | uassert with NamespaceNotFound |
| Found     | See Locking Table              |
 
| lockMode | DB Lock Result | Collection Lock Result |
|----------+----------------+------------------------|
| MODE_IX  | MODE_IX        | MODE_IX                |
| MODE_X   | MODE_IX        | MODE_X                 |
| MODE_IS  | MODE_IS        | MODE_IS                |
| MODE_S   | MODE_IS        | MODE_S                 |

W.r.t: ViewMode and Date_t deadline on other constructors, this constructor would behave as if the defaults on the other Collection RAII constructors were used: kViewsForbidden and Date_t::max().

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