Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-9591

Scrub (recover) sstables even when -Index.db is missing

    XMLWordPrintableJSON

    Details

      Description

      Today SSTableReader needs at minimum 3 files to load an sstable:

      • -Data.db
      • -CompressionInfo.db
      • -Index.db

      But during the scrub process the -Index.db file isn't actually necessary, unless there's corruption in the -Data.db and we want to be able to skip over corrupted rows. Given that there is still a fair chance that there's nothing wrong with the -Data.db file and we're just missing the -Index.db file this patch addresses that situation.

      So the following patch makes it possible for the StandaloneScrubber (sstablescrub) to recover sstables despite missing -Index.db files.

      This can happen from a catastrophic incident where data directories have been lost and/or corrupted, or wiped and the backup not healthy. I'm aware that normally one depends on replicas or snapshots to avoid such situations, but such catastrophic incidents do occur in the wild.

      I have not tested this patch against normal c* operations and all the other (more critical) ways SSTableReader is used. i'll happily do that and add the needed units tests if people see merit in accepting the patch.

      Otherwise the patch can live with the issue, in-case anyone else needs it. There's also a cassandra distribution bundled with the patch here to make life a little easier for anyone finding themselves in such a bad situation.

        Attachments

        1. 9591-2.1.txt
          16 kB
          Michael Semb Wever
        2. 9591-2.0.txt
          14 kB
          Michael Semb Wever

          Activity

            People

            • Assignee:
              mck Michael Semb Wever
              Reporter:
              mck Michael Semb Wever
              Authors:
              Michael Semb Wever
              Reviewers:
              Stefania Alborghetti
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: