KB Article #179671

Cassandra Repair History cleanup


By default Cassandra 2.2.x does NOT clean up nodetool repair trace history. This can cause the system_distributed keyspace to increase in size over time. The extent of the issue can be seen by running the following command to see how much space is being consumed by system_distributed

du -md 1 <cassandra_root>/data/data/ | sort -n


To prevent this we recommend that you set a 7 day TTL on the repair history tables and remove any existing data. First, execute the following using cqlsh on ONE of the Cassandra nodes

ALTER TABLE system_distributed.repair_history WITH default_time_to_live = 604800;
TRUNCATE system_distributed.repair_history;
ALTER TABLE system_distributed.parent_repair_history WITH default_time_to_live = 604800;
TRUNCATE system_distributed.parent_repair_history;

To reclaim the disk space, cleanup the snapshots generated by the truncate by executing the following against ALL Cassandra nodes

nodetool clearsnapshot system_distributed