Migrating to incremental repairs

Migrating to incremental repairs requires several steps to change nodes because SSTable metadata has changed, adding the RepairedAt field.

Migrating to incremental repairs

Migrating to incremental repairs by using the sstablerepairedset utility is recommended only under the following conditions:
  • You are doing an incremental repair for the first time.
  • You are using the leveled compaction strategy.
Full, sequential repairs are the default because until the first incremental repair, Cassandra does not know the repaired state of SSTables. After an incremental repair, anticompaction marks SSTables as repaired or not. If you use the leveled compaction strategy and perform an incremental repair for the first time, Cassandra performs size-tiering on all SSTables because the repair/unrepaired status is unknown. This operation can take a long time. To save time, migrate to incremental repair one node at a time. The migration procedure, covered in the next section, uses utilities in the tools/bin directory of installations other than RHEL and Debian:
  • sstablemetadata for checking the repaired or unrepaired status of an SSTable
  • sstablerepairedset for manually marking an SSTable as repaired
The syntax of these commands is:
sstablemetadata <sstable filenames>
sstablerepairedset [--is-repaired | --is-unrepaired] [-f <sstable-list> | <sstables>] 
In Cassandra 2.1.1, sstablerepairedset can take as arguments a list of SSTables on the command line or a file of SSTables with a "-f" flag.
Note: In RHEL and Debian installations, you must install the tools packages.

This example shows how to use sstablerepairedset to clear the repaired state of an SSTable, rendering the SSTable unrepaired. As mentioned above, because until the first incremental repair, Cassandra does not know the repaired state of SSTables, this example shows how to use sstablerepairedset to clear the repaired state of an SSTable, rendering the SSTable unrepaired.

  1. Stop the node.
  2. Run this command:
    sstablerepairedset --is-unrepaired -f list_of_sstable_names.txt
  3. Restart the node.

    All data is changed to an unrepaired state.

Procedure for migrating to incremental repairs

To migrate to incremental repair, one node at a time:

  1. Disable compaction on the node using nodetool disableautocompaction.
  2. Run the default full, sequential repair.
  3. Stop the node.
  4. Use the tool sstablerepairedset to mark all the SSTables that were created before you disabled compaction.
  5. Restart cassandra

SSTables remain in a repaired state after running a full, but not a partition range, repair if you make no changes to the SSTables.