[SERVER-42014] [4.0] repairDatabase should catch and report exceptions from repairCollections before re-opening the database Created: 28/Jun/19  Updated: 29/Oct/23  Resolved: 16/Oct/19

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

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:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2019-09-23, Execution Team 2019-10-07, Execution Team 2019-10-21
Participants:

 Description   

In 4.0, we have a cleanup handler in repairDatabase that re-opens the database and its collections when the function exits. If an exception is thrown while repairing a collection, this cleanup handler attempts to re-open all collections before the active exception is caught and reported.

If a single collection repair fails by throwing an exception, the cleanup handler tries to re-open all collections in the database before exiting the function. If a failure occurs before all collections have been repaired, the RecordStores may not be reinitialized by a call to reinitCollectionAfterRepair and leads to a fatal assertion. The results in the cleanup handler's error suppressing any actual cause of failure.

This is not a problem in 4.2 because of the work done by SERVER-40126, but I don't believe this is something we can backport.



 Comments   
Comment by Githook User [ 16/Oct/19 ]

Author:

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

Message: SERVER-42014 repairDatabase should catch and report exceptions from
repairCollections before re-opening the database
Branch: v4.0
https://github.com/mongodb/mongo/commit/14ec9885f91b6ef51d7c9007d0a55f46c2cd7464

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