[SERVER-50317] Make uses of Collection const-correct Created: 14/Aug/20  Updated: 29/Oct/23  Resolved: 03/Sep/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: Henrik Edin 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-50145 Have DDL operations and MODE_X writer... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-08-24, Execution Team 2020-09-07
Participants:

 Description   

All interfaces for Collection should be const unless we need to write to the Collection object under MODE_X lock and in a WUOW.

A const Collection need to provide non-const access to the RecordStore.



 Comments   
Comment by Githook User [ 02/Sep/20 ]

Author:

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

Message: SERVER-50317 Const correct uses of Collection

Most of the code should only need a const Collection now. AutoGetCollection returns a const Collection by default. There is a placeholder getWritableCollection() interface that will handle the necessary steps we need for lock free reads in the future.

Added some operators to AutoGetCollection so it behaves more like a smart pointer.
Branch: master
https://github.com/mongodb/mongo/commit/bf5914a20b596ba3bde772b42e579e028f733bac

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