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