incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Lebresne <sylv...@datastax.com>
Subject Re: Does HH work (or make sense) for counters?
Date Wed, 02 Feb 2011 15:33:22 GMT
When you create a counter column family, there is an option called
replicate_on_write. When this option is off then during a write the
increment is written to only one node and not replicated at all. In
particular it is not hinted to any node.

While unsafe, if you can accept its potential consequences, this
option can make sense if you want to do sustain very fast increments,
because replication for counters (unlike for normal writes) implies a read.

Right now, replicate_on_write is off by default, but if you turn it on HH
should work as expected (or then, that would likely be a bug).

Sylvain

On Tue, Feb 1, 2011 at 8:23 PM, Narendra Sharma
<narendra.sharma@gmail.com>wrote:

> Version: Cassandra 0.7.1 (build from trunk)
>
> Setup:
> - Cluster of 2 nodes (Say A and B)
> - HH enabled
> - Using the default Keyspace definition in cassandra.yaml
> - Using SuperCounter1 CF
>
> Client:
> - Using CL of ONE
>
> I started the two Cassandra nodes, created schema and then shutdown one of
> the instances (say B). Executed counter update and read operations on A with
> CL=ONE. Everything worked fine. All counters were returned with correct
> values. Now started node B, waited for couple of mins. Executed only counter
> read operation on B with CL=ONE. Initially got no counters for any of the
> rows. On second (and subsequent tries) try got counters for only one (same
> row always) out of ten rows.
>
> After doing one read with CL=QUORUM, reads with CL=ONE started returning
> correct data.
>
> Thanks,
> Naren
>
>
>
>

Mime
View raw message