[SERVER-52556] Make multiple lookups within a snapshot from the CollectionCatalog consistent Created: 02/Nov/20  Updated: 29/Jan/24  Resolved: 13/Nov/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.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:
Backports
Problem/Incident
Related
related to SERVER-51674 Filter out $where clauses in the find... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4, v4.2
Sprint: Execution Team 2020-11-16, Execution Team 2020-11-30
Participants:
Case:
Linked BF Score: 0

 Description   

Implement copy-on-write on the CollectionCatalog. Where its data structures that contain shared pointers are copied.

The new catalog instance should be able to be installed with atomic compare-and-swap and we can remove the catalog mutex that is currently there.

Lock-Free read operations hold a shared_ptr to a CollectionCatalog consistent with the established storage snapshot and may perform multiple lookups from this instance that all is consistent with the storage snapshot.

This should allow us to support DBDirectClient in Lock-Free Reads.



 Comments   
Comment by Githook User [ 13/Nov/20 ]

Author:

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

Message: SERVER-52556 Remove faulty catalog iterator test. This is no longer safe.
Branch: master
https://github.com/mongodb/mongo/commit/ae1f02be485b9ecc4e43e757baf54c70dcf07ed1

Comment by Githook User [ 13/Nov/20 ]

Author:

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

Message: SERVER-52556 Versioned CollectionCatalog. Writes are performed using copy-on-write.

Internal mutexes when reading CollectionCatalog are removed, just one mutex for writes are needed.
Lock-free reads helper AutoGetCollectionForReadLockFree stashes a CollectionCatalog consistent with snapshot on OperationContext
Branch: master
https://github.com/mongodb/mongo/commit/8f9823f644d0b6beba8a301866141a578d278534

Comment by Githook User [ 13/Nov/20 ]

Author:

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

Message: SERVER-52556 Versioned CollectionCatalog, interface updates.
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/74922687a6a75ea972b6038e1494b4b35a07378e

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