-
Type:
New Feature
-
Resolution: Works as Designed
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
2023-05-30 - 7.0 Readiness
-
None
wt salvage, and presumably the WT_SESSION::salvage() command, fails if run on a file with a corrupted or missing file header. This is because salvage opens a block manager for the file and the block manager complains if the file doesn't have the expected WT_BLOCK_DESC at the beginning of the file.
You can work around this (and I just did ) by manually writing a good header on the file you want to salvage. But it would be good if salvage could handle this case. A plausible form of corruption would be for someone to accidentally overwrite the beginning of a WT file.
I haven't looked at the details but a few possible approaches come to mind:
- Maybe salvage doesn't need the information in the header, in which case it could run and just write a new header when it is done.
- If salvage depends on some of the values in the header, it would either copy/infer them from other metadata or
- The user could provide any necessary values via arguments to salvage.