[SERVER-36682] Refactor repairDatabasesAndCheckVersion into components that separately repair then check data Created: 15/Aug/18  Updated: 27/Oct/23  Resolved: 27/Aug/20

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

Type: Task Priority: Major - P3
Reporter: Louis Williams Assignee: Louis Williams
Resolution: Gone away Votes: 1
Labels: execution_intern, intern_validate_improvements, neweng, nyc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Execution Team 2020-09-07
Participants:

 Description   

The existing repairDatabasesAndCheckVersion is always called at startup. This means that it doesn't always "repair" except when MongoDB is started with --repair. It is also 250 lines long and reaches a nesting depth of 6 in multiple places.

We could improve this by separating it into its components, which would each be called separately in db.cpp.

  • Create two different helpers, repairAllDatabases and checkAllDatabases
  • Call repairAllDatabases if --repair was provided
  • Next, call checkAllDatabases, which should be refactored to its components (in this order):
  • Checking data files
  • Rebuilding unfinished indexes
  • Checking FCV version and non-local databases


 Comments   
Comment by Louis Williams [ 27/Aug/20 ]

irrelevant due to SERVER-48050

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