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

Use WiredTiger salvage API for repairing metadata files

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.3, 4.1.4
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • v4.0
    • Storage NYC 2018-09-10, Storage NYC 2018-09-24
    • 0

      WT will be adding functionality to salvage metadata information that would provide a similar result to the original goal of this ticket which is left quoted.

      When running MongoDB with the --repair flag and we find that the WiredTiger.wt metadata file is corrupted, we should attempt to salvage the metadata file.

      Because the WiredTiger.wt file cannot be salvaged directly, this process might work like so (similar to the repair-wt.sh script used in support).

      • Create a new WiredTiger db in a new directory with an empty table named "tmp"
      • Copy the WiredTiger.wt file into the new db directory as tmp.wt
      • Run salvage on "tmp" in the new db directory
      • Extract the salvaged checkpoint information for "tmp" from the new db's metadata
      • Copy the salvaged tmp.wt back as WiredTiger.wt to the original db path
      • Replace the checkpoint information in WiredTiger.turtle with the salvaged checkpoint information

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

              Created:
              Updated:
              Resolved: