[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: |
|
||||||||
| 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: 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. |