[SERVER-47642] Investigate adding an assertion that a snapshot is not already held before acquiring an exclusive collection lock Created: 17/Apr/20  Updated: 29/Oct/23  Resolved: 15/Oct/20

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

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: Brian DeLeonardis (Inactive)
Resolution: Fixed Votes: 0
Labels: newgrad
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2020-10-19
Participants:
Linked BF Score: 50

 Description   

There is a class of bugs that involves acquiring a Collection X lock, while already holding a storage snapshot, potentially because a global lock is already held and a prior read occurred. This violates assumptions that the owner of the Collection X lock makes, which is that all writes are visible, even though they may not. These lock acquisitions should be preceded by an abandonSnapshot().

It would be interesting to add an invariant that a snapshot is is not already held while acquiring a collection X lock to evaluate whether these bugs already exist.



 Comments   
Comment by Githook User [ 15/Oct/20 ]

Author:

{'name': 'Brian DeLeonardis', 'email': 'brian.deleonardis@mongodb.com', 'username': 'bdeleonardis1'}

Message: SERVER-47642 Ensure no active snapshot before acquiring collection X lock
Branch: master
https://github.com/mongodb/mongo/commit/bef72de45709f2e1e6874e9b5f29a01e3fa8c413

Comment by Brian DeLeonardis (Inactive) [ 14/Oct/20 ]

https://mongodbcr.appspot.com/677140001/

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