Note that there are some explanatory texts on larger screens.

plurals
  1. POШnconsistent counter values between replicas in Cassandra
    text
    copied!<p>I've got a 3 machine Cassandra cluster using rack unaware placements strategy with a replication factor of 2. </p> <p>The column family is defined as follows:</p> <pre><code>create column family UserGeneralStats with comparator = UTF8Type and default_validation_class = CounterColumnType; </code></pre> <p>Unfortunately after a few days of production use I got some inconsistent values for the counters:</p> <p>Query on replica 1:</p> <pre><code>[default@StatsKeyspace] list UserGeneralStats['5261666978': '5261666978']; Using default limit of 100 ------------------- RowKey: 5261666978 =&gt; (counter=bandwidth, value=96545030198) =&gt; (counter=downloads, value=1013) =&gt; (counter=previews, value=10304) </code></pre> <p>Query on replica 2:</p> <pre><code>[default@StatsKeyspace] list UserGeneralStats['5261666978': '5261666978']; Using default limit of 100 ------------------- RowKey: 5261666978 =&gt; (counter=bandwidth, value=9140386229) =&gt; (counter=downloads, value=339) =&gt; (counter=previews, value=1321) </code></pre> <p>As the standard read repair mechanism doesn't seem to repair the values I tried to force an anti-entropy repair using nodetool repair. It did't have any effect on the counter values. </p> <p>Data inspection showed that the lower values for the counters are the correct ones so I suspect that either Cassandra (or Hector which I used as API to call Cassandra from Java) retried some increments. </p> <p>Any ideas how to repair the data and possibly prevent the sittuation from happening again?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload