Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra: primary range full repair on all nodes of cluster or datacenter

As everyone would agree, Cassandra repairs are necessary but are very expensive and failure prone, gets stuck most of the time if any node in the cluster go down while the repair is running on any other node in the cluster. I am running full sequential repair on primary range using the following command in a rolling fashion:

node repair -pr -full -seq

But have a doubt, Is it enough to run this repair on every node of a data-center (I have 4 different data-centers) or is it required to be run on every node of the whole cluster? I found some documents on this topic, but the language doesn't answer this question properly. For example 3.1 Primary range repair

like image 383
Pankaj Yadav Avatar asked Dec 02 '25 07:12

Pankaj Yadav


2 Answers

With repair -pr -full you must run repair on every node in the cluster. See this blog post I wrote a couple years ago for a detailed description of why.

like image 73
Zanson Avatar answered Dec 05 '25 05:12

Zanson



Update: I was actually wrong here thinking ring as two DCs instead of single, the actual token Ring is more of:

    | DC  | Node | Token |
    |-----|------|-------|
    | DC1 |node1 |   1   |     
    | DC2 |node2 |   5   |
    | DC1 |node3 |   10  |
    | DC2 |node4 |   15  |
    | DC1 |node5 |   20  |
    | DC2 |node6 |   25  |

The primary range for node4 here is 11-15, not 6-15 (which is the primary range + local ranges). You must do -pr on each node. Deleting original so it doesn't cause any confusion.

like image 38
Chris Lohfink Avatar answered Dec 05 '25 04:12

Chris Lohfink



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!