PLANNED MAINTENANCE

Hello, DataStax Community!

We want to make you aware of a few operational updates which will be carried out on the site. We are working hard to streamline the login process to integrate with other DataStax resources. As such, you will soon be prompted to update your password. Please note that your username will remain the same.

As we work to improve your user experience, please be aware that login to the DataStax Community will be unavailable for a few hours on:

  • Wednesday, July 15 16:00 PDT | 19:00 EDT | 20:00 BRT
  • Thursday, July 16 00:00 BST | 01:00 CEST | 04:30 IST | 07:00 CST | 09:00 AEST

For more info, check out the FAQ page. Thank you for being a valued member of our community.


question

376752150_179413 avatar image
376752150_179413 asked ·

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.