Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-11086

Make salvage work on a table with a corrupted file header

    • Type: Icon: New Feature New Feature
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 2023-05-30 - 7.0 Readiness

      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:

      1. 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.
      2. If salvage depends on some of the values in the header, it would either copy/infer them from other metadata or
      3. The user could provide any necessary values via arguments to salvage.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            keith.smith@mongodb.com Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: