Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-36682

Refactor repairDatabasesAndCheckVersion into components that separately repair then check data

    • Execution Team 2020-09-07

      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

            Assignee:
            louis.williams@mongodb.com Louis Williams
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: