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
- depends on
-
WT-4283 Restore WT_ERROR and use a corrupt flag
- Closed
-
WT-4156 Add new wiredtiger_salvage top level API
- Closed
- is related to
-
SERVER-28734 Recover WiredTiger data files when lacking metadata, but have _mdb_catalog data
- Closed
-
WT-4310 Add option to not abort in diagnostic builds on data corruption
- Closed