Question-166: Why does it require that repair should be run manually and not automatically?

Answer: Since repair can result in a lot of disk and network IO, it is not run automatically by Cassandra and should be run by the operator using the nodetool as below 

nodetool repair 

and if you want to run full repair then use the full option. Even you can run the repair for a particular keyspace or a particular table by specifying it as part of nodetool repair command.

Question-167: Does repair command repair all the data across the cluster?

Answer: No, the repair command only repairs primary token ranges on the node being repaired and does not repair the whole cluster. By default, repair will operate on all token range, which is replicated by the node you are running repair on, and it can cause duplicity if you run repair on every node. 

Question-168: Then how can you do repair on entire cluster, without having the duplicity and reduced IO?

Answer: For that you have to use “-pr” flag. So that only the primary ranges on that node can be repaired. If you want to repair on the entire cluster, then run the repair command on each node in the cluster with this flag (-pr).

Question-169: What is the relation between repair and GC Grace period expired time?

Answer: Generally, it is recommended if you are running incremental repair then do it every 1-3 days, and full repair once in a 3 week. if you are running only full repair then do it once in every five days. 

But remember suppose your default GC Grace period is 10 days, then repair should be done at least before this. So, it is recommended that you run repair every node in your cluster once every 7 days. 

Question-170: What is compaction process?

Answer: In the compaction process it takes one or more SSTables and output new SSTables. there are few types of compactions as below

  • Minor Compaction: it is triggered by Cassandra automatically.
  • Major compaction: whenever user initiate to compaction, then all SSTables on particular node are merged to generate single SSTable on one node.