Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

376752150_179413 avatar image
376752150_179413 asked Erick Ramirez answered

Does nodetool repair trigger compaction if there is no discrepancy?

I have executed "./nodetool repair -pr -local -full cursor1" n times. So I believe there is no discrepancy when I executed the same repair command (n+1)th time.

But the log still shows that sstables compaction is triggered. May I know why nodetool repair triggers sstables compaction if there is no discrepancy?

repair
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

@376752150_179413 Repairs don't trigger the type of compaction that you are probably thinking of.

When running a repair, the first phase is to build a Merkle tree of the data to be repaired (leaves of a Merkle tree are hashes of key values). Cassandra compares the hash values between replicas to determine which parts of the tree (replica data) to repair. To perform the Merkle tree calculation, Cassandra does a validation compaction -- a special kind of compaction.

To answer your question, parallel repairs do validation compaction in order to determine whether replicas are out of sync, and which parts of the data it needs to synchronise. For more information, see Repairing nodes particularly the section on Manual anti-entropy repair. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.