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

[4.0] repairDatabase should catch and report exceptions from repairCollections before re-opening the database

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.14
    • Affects Version/s: 4.0.0
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2019-09-23, Execution Team 2019-10-07, Execution Team 2019-10-21

      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.

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

              Created:
              Updated:
              Resolved: