[SERVER-39077] IndexBuilder should always re-lock the database when exceptions are thrown Created: 18/Jan/19  Updated: 29/Oct/23  Resolved: 18/Jan/19

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

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2019-01-28
Participants:
Linked BF Score: 31

 Description   

The IndexBuilder catches exceptions, but if the database isn't locked in MODE_X, instead of exiting and reporting the error, this invariant fails in the IndexBuildBlock.

The IndexBuilder should use a ScopeGuard to relock the database on exit so that the destructor of the MultiIndexBlock is never called without the appropriate lock.



 Comments   
Comment by Githook User [ 18/Jan/19 ]

Author:

{'username': 'louiswilliams', 'email': 'louis.williams@mongodb.com', 'name': 'Louis Williams'}

Message: SERVER-39077 IndexBuilder should always relock database on exceptions
Branch: master
https://github.com/mongodb/mongo/commit/615e8ff0cecdced8fbac8559a9abaa17b5e12a79

Generated at Thu Feb 08 04:50:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.