You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Yang <te...@gmail.com> on 2011/02/03 22:39:45 UTC

for counters: does read have to be ALL ?

the pdf at the design doc
https://issues.apache.org/jira/secure/attachment/12459754/Partitionedcountersdesigndoc.pdf

does say so:
page 2 "- strongly consistent read: requires consistency level ALL.
(QUORUM is insufficient.)
"

but the wiki  http://wiki.apache.org/cassandra/Counters
gave a code example:

rv = client.get_counter('key1', ColumnPath(column_family='Counter1',
column='c1'), ConsistencyLevel.ONE)


is one of them wrong?

Thanks
Yang

Re: for counters: does read have to be ALL ?

Posted by Sylvain Lebresne <sy...@datastax.com>.
On Thu, Feb 3, 2011 at 10:39 PM, Yang <te...@gmail.com> wrote:

> the pdf at the design doc
>
> https://issues.apache.org/jira/secure/attachment/12459754/Partitionedcountersdesigndoc.pdf
>
> does say so:
> page 2 "- strongly consistent read: requires consistency level ALL.
> (QUORUM is insufficient.)
> "
>
> but the wiki  http://wiki.apache.org/cassandra/Counters
> gave a code example:
>
> rv = client.get_counter('key1', ColumnPath(column_family='Counter1',
> column='c1'), ConsistencyLevel.ONE)
>
>
> is one of them wrong?
>

Three things:
First, the design doc is talking of strongly consistent reads, the wiki
gives
a simple exemple of a read (it's even followed with a warning) so there is
no actual contradiction here.

Second, and more to the point, the design docs are slightly outdated, on
this point at least. There is now support for QUORUM (or ALL) writes (since
https://issues.apache.org/jira/browse/CASSANDRA-1944), so you have the
usual consistency guarantee (i.e, you get strong consistency with QUORUM
(resp. ONE) read provided you wrote at QUORUM (resp. ALL)).

Third, it is good to recall that counters are not considered stable yet
(that
includes the documentations).

--
Sylvain


> Thanks
> Yang
>

Re: for counters: does read have to be ALL ?

Posted by Anthony John <ch...@gmail.com>.
>From the architecture section of wiki. And it makes sense!

More specifically: R=read replica count W=write replica count N=replication
factor Q=*QUORUM* (Q = N / 2 + 1)

   -

   If W + R > N, you will have consistency
   - W=1, R=N
   - W=N, R=1
   - W=Q, R=Q where Q = N / 2 + 1


On Thu, Feb 3, 2011 at 3:39 PM, Yang <te...@gmail.com> wrote:

> the pdf at the design doc
>
> https://issues.apache.org/jira/secure/attachment/12459754/Partitionedcountersdesigndoc.pdf
>
> does say so:
> page 2 "- strongly consistent read: requires consistency level ALL.
> (QUORUM is insufficient.)
> "
>
> but the wiki  http://wiki.apache.org/cassandra/Counters
> gave a code example:
>
> rv = client.get_counter('key1', ColumnPath(column_family='Counter1',
> column='c1'), ConsistencyLevel.ONE)
>
>
> is one of them wrong?
>
> Thanks
> Yang
>