[SERVER-43678] Background collection validation should take a MODE_IS collection lock instead of MODE_IX Created: 27/Sep/19  Updated: 29/Oct/23  Resolved: 30/Sep/19

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

Type: Task Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dianna Hohensee (Inactive)
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-42358 Add background collection validation ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-10-07
Participants:

 Description   

It looks like foreground validation holds a writer lock (MODE_X) only because it does a persisted collection stats update here. Otherwise, it just reads and could hold a MODE_S lock.

Background validation runs on a checkpoint, so it cannot perform any stats updates – they would be stale. So rather than a MODE_IX lock, we should be able to hold a MODE_IS collection lock for background collection validation. This would also obviate needing special handling for admin DB collections in the validate command with {background:true}, because for admin DB lock requests, we upgrade a MODE_IX DB lock request to a MODE_X DB lock request.



 Comments   
Comment by Githook User [ 30/Sep/19 ]

Author:

{'name': 'Dianna Hohensee', 'username': 'DiannaHohensee', 'email': 'dianna.hohensee@mongodb.com'}

Message: SERVER-43678 Background collection validation should take a MODE_IS collection lock instead of MODE_IX
Branch: master
https://github.com/mongodb/mongo/commit/1234d1a499f7eaab38334735217798e7b3260f3b

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