You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Thibaut Britz <th...@trendiction.com> on 2012/04/11 17:41:36 UTC

cassandra 0.8.7 + hector 0.8.3: All Quorum reads result in writes?

Hi,

I just diagnosted this strange behavior:

When I fetch a rangeslice through hector and set the consistency level to
quorum, according to cfstats (and also to the output files on the hd),
cassandra seems to execute a write request for each read I execute. The
write count in cfstats is increased when I execute the rangeslice function
over the same range again and again (without saving anything at all).

If I set the consitency level to ONE, no writes are executed.

How can I disable this? Why are the records rewritten each time, even
though I don't want them to be rewritten?

Thanks,
Thibaut.


Code:
                                Keyspace ks = getConnection(cluster,
consistencylevel);

RangeSlicesQuery<String, String, V> rangeSlicesQuery =
HFactory.createRangeSlicesQuery(ks, StringSerializer.get(),
StringSerializer.get(), s);

rangeSlicesQuery.setColumnFamily(columnFamily);
rangeSlicesQuery.setColumnNames(column);

rangeSlicesQuery.setKeys(start, end);
rangeSlicesQuery.setRowCount(maxrows);

QueryResult<OrderedRows<String, String, V>> result =
rangeSlicesQuery.execute();
return result.get();

Re: cassandra 0.8.7 + hector 0.8.3: All Quorum reads result in writes?

Posted by Thibaut Britz <th...@trendiction.com>.
I will disable read repair for slice requests fully (we can handle those on
the application side) until we upgrade to 1.0.8.

Thanks,
Thibaut


On Wed, Apr 11, 2012 at 7:04 PM, Jeremy Hanna <je...@gmail.com>wrote:

> I backported this to 0.8.4 and it didn't fix the problem we were seeing
> (as I outlined in my parallel post) but if it fixes it for you, then
> beautiful.  Just wanted to let you know our experience with similar
> symptoms.
>
> On Apr 11, 2012, at 11:56 AM, Thibaut Britz wrote:
>
> > Fixed in  https://issues.apache.org/jira/browse/CASSANDRA-3843
> >
> >
> >
> > On Wed, Apr 11, 2012 at 5:58 PM, Thibaut Britz <
> thibaut.britz@trendiction.com> wrote:
> > We have read repair disabled (0.0).
> >
> > Even if this would be the case, this also doesn't explain why the writes
> are executed again and again when going over the same range again and again.
> >
> > The keyspace is new, it doesn't contain any thumbstones and only 10000
> keys.
> >
> >
> >
> > On Wed, Apr 11, 2012 at 5:52 PM, R. Verlangen <ro...@us2.nl> wrote:
> > Are you sure this isn't read-repair?
> http://wiki.apache.org/cassandra/ReadRepair
> >
> >
> > 2012/4/11 Thibaut Britz <th...@trendiction.com>
> > Also executing the same multiget rangeslice query over the same range
> again will trigger the same writes again and again.
> >
> > On Wed, Apr 11, 2012 at 5:41 PM, Thibaut Britz <
> thibaut.britz@trendiction.com> wrote:
> > Hi,
> >
> > I just diagnosted this strange behavior:
> >
> > When I fetch a rangeslice through hector and set the consistency level
> to quorum, according to cfstats (and also to the output files on the hd),
> cassandra seems to execute a write request for each read I execute. The
> write count in cfstats is increased when I execute the rangeslice function
> over the same range again and again (without saving anything at all).
> >
> > If I set the consitency level to ONE, no writes are executed.
> >
> > How can I disable this? Why are the records rewritten each time, even
> though I don't want them to be rewritten?
> >
> > Thanks,
> > Thibaut.
> >
> >
> > Code:
> >                                 Keyspace ks = getConnection(cluster,
> consistencylevel);
> >
> >                               RangeSlicesQuery<String, String, V>
> rangeSlicesQuery = HFactory.createRangeSlicesQuery(ks,
> StringSerializer.get(), StringSerializer.get(), s);
> >
> >
> rangeSlicesQuery.setColumnFamily(columnFamily);
> >                               rangeSlicesQuery.setColumnNames(column);
> >
> >                               rangeSlicesQuery.setKeys(start, end);
> >                               rangeSlicesQuery.setRowCount(maxrows);
> >
> >                               QueryResult<OrderedRows<String, String,
> V>> result = rangeSlicesQuery.execute();
> >                               return result.get();
> >
> >
> >
> >
> >
> >
> >
> > --
> > With kind regards,
> >
> > Robin Verlangen
> > www.robinverlangen.nl
> >
> >
> >
>
>

Re: cassandra 0.8.7 + hector 0.8.3: All Quorum reads result in writes?

Posted by Jeremy Hanna <je...@gmail.com>.
I backported this to 0.8.4 and it didn't fix the problem we were seeing (as I outlined in my parallel post) but if it fixes it for you, then beautiful.  Just wanted to let you know our experience with similar symptoms.

On Apr 11, 2012, at 11:56 AM, Thibaut Britz wrote:

> Fixed in  https://issues.apache.org/jira/browse/CASSANDRA-3843 
> 
> 
> 
> On Wed, Apr 11, 2012 at 5:58 PM, Thibaut Britz <th...@trendiction.com> wrote:
> We have read repair disabled (0.0).
> 
> Even if this would be the case, this also doesn't explain why the writes are executed again and again when going over the same range again and again.
> 
> The keyspace is new, it doesn't contain any thumbstones and only 10000 keys.
> 
> 
> 
> On Wed, Apr 11, 2012 at 5:52 PM, R. Verlangen <ro...@us2.nl> wrote:
> Are you sure this isn't read-repair?  http://wiki.apache.org/cassandra/ReadRepair 
> 
> 
> 2012/4/11 Thibaut Britz <th...@trendiction.com>
> Also executing the same multiget rangeslice query over the same range again will trigger the same writes again and again.
> 
> On Wed, Apr 11, 2012 at 5:41 PM, Thibaut Britz <th...@trendiction.com> wrote:
> Hi,
> 
> I just diagnosted this strange behavior:
> 
> When I fetch a rangeslice through hector and set the consistency level to quorum, according to cfstats (and also to the output files on the hd), cassandra seems to execute a write request for each read I execute. The write count in cfstats is increased when I execute the rangeslice function over the same range again and again (without saving anything at all).
> 
> If I set the consitency level to ONE, no writes are executed.
> 
> How can I disable this? Why are the records rewritten each time, even though I don't want them to be rewritten?
> 
> Thanks,
> Thibaut.
> 
> 
> Code:
>                                 Keyspace ks = getConnection(cluster, consistencylevel);
> 
> 				RangeSlicesQuery<String, String, V> rangeSlicesQuery = HFactory.createRangeSlicesQuery(ks, StringSerializer.get(), StringSerializer.get(), s);
> 
> 				rangeSlicesQuery.setColumnFamily(columnFamily);
> 				rangeSlicesQuery.setColumnNames(column);
> 
> 				rangeSlicesQuery.setKeys(start, end);
> 				rangeSlicesQuery.setRowCount(maxrows);
> 
> 				QueryResult<OrderedRows<String, String, V>> result = rangeSlicesQuery.execute();
> 				return result.get();
> 
> 
> 
> 
> 
> 
> 
> -- 
> With kind regards,
> 
> Robin Verlangen
> www.robinverlangen.nl
> 
> 
> 


Re: cassandra 0.8.7 + hector 0.8.3: All Quorum reads result in writes?

Posted by Thibaut Britz <th...@trendiction.com>.
Fixed in  https://issues.apache.org/jira/browse/CASSANDRA-3843



On Wed, Apr 11, 2012 at 5:58 PM, Thibaut Britz <
thibaut.britz@trendiction.com> wrote:

> We have read repair disabled (0.0).
>
> Even if this would be the case, this also doesn't explain why the writes
> are executed again and again when going over the same range again and again.
>
> The keyspace is new, it doesn't contain any thumbstones and only 10000
> keys.
>
>
>
> On Wed, Apr 11, 2012 at 5:52 PM, R. Verlangen <ro...@us2.nl> wrote:
>
>> Are you sure this isn't read-repair?
>> http://wiki.apache.org/cassandra/ReadRepair
>>
>>
>> 2012/4/11 Thibaut Britz <th...@trendiction.com>
>>
>>> Also executing the same multiget rangeslice query over the same range
>>> again will trigger the same writes again and again.
>>>
>>> On Wed, Apr 11, 2012 at 5:41 PM, Thibaut Britz <
>>> thibaut.britz@trendiction.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I just diagnosted this strange behavior:
>>>>
>>>> When I fetch a rangeslice through hector and set the consistency level
>>>> to quorum, according to cfstats (and also to the output files on the hd),
>>>> cassandra seems to execute a write request for each read I execute. The
>>>> write count in cfstats is increased when I execute the rangeslice function
>>>> over the same range again and again (without saving anything at all).
>>>>
>>>> If I set the consitency level to ONE, no writes are executed.
>>>>
>>>> How can I disable this? Why are the records rewritten each time, even
>>>> though I don't want them to be rewritten?
>>>>
>>>> Thanks,
>>>> Thibaut.
>>>>
>>>>
>>>> Code:
>>>>                                 Keyspace ks = getConnection(cluster,
>>>> consistencylevel);
>>>>
>>>>  RangeSlicesQuery<String, String, V> rangeSlicesQuery =
>>>> HFactory.createRangeSlicesQuery(ks, StringSerializer.get(),
>>>> StringSerializer.get(), s);
>>>>
>>>> rangeSlicesQuery.setColumnFamily(columnFamily);
>>>> rangeSlicesQuery.setColumnNames(column);
>>>>
>>>> rangeSlicesQuery.setKeys(start, end);
>>>> rangeSlicesQuery.setRowCount(maxrows);
>>>>
>>>> QueryResult<OrderedRows<String, String, V>> result =
>>>> rangeSlicesQuery.execute();
>>>> return result.get();
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> With kind regards,
>>
>> Robin Verlangen
>> www.robinverlangen.nl
>>
>>
>

Re: cassandra 0.8.7 + hector 0.8.3: All Quorum reads result in writes?

Posted by Jeremy Hanna <je...@gmail.com>.
fwiw - we had a similar problem reading at quorum with 0.8.4 when reading with hadoop.  The symptom we see is when reading a column family with hadoop using quorum using 0.8.4, we have lots of minor compactions as a result of heavy writes.  When we read at CL.ONE or move to 1.0.8 the problem is not there.  I tried to backport a couple of related patches but that did not solve the problem.  We're looking to upgrade soon to 1.0.9 but the workaround until then for us is read at CL.ONE and write at CL.ALL with hadoop.  I'm not sure this is the same problem, but it sounds like it and it doesn't have to do with hector.

On Apr 11, 2012, at 10:58 AM, Thibaut Britz wrote:

> We have read repair disabled (0.0).
> 
> Even if this would be the case, this also doesn't explain why the writes are executed again and again when going over the same range again and again.
> 
> The keyspace is new, it doesn't contain any thumbstones and only 10000 keys.
> 
> 
> 
> On Wed, Apr 11, 2012 at 5:52 PM, R. Verlangen <ro...@us2.nl> wrote:
> Are you sure this isn't read-repair?  http://wiki.apache.org/cassandra/ReadRepair 
> 
> 
> 2012/4/11 Thibaut Britz <th...@trendiction.com>
> Also executing the same multiget rangeslice query over the same range again will trigger the same writes again and again.
> 
> On Wed, Apr 11, 2012 at 5:41 PM, Thibaut Britz <th...@trendiction.com> wrote:
> Hi,
> 
> I just diagnosted this strange behavior:
> 
> When I fetch a rangeslice through hector and set the consistency level to quorum, according to cfstats (and also to the output files on the hd), cassandra seems to execute a write request for each read I execute. The write count in cfstats is increased when I execute the rangeslice function over the same range again and again (without saving anything at all).
> 
> If I set the consitency level to ONE, no writes are executed.
> 
> How can I disable this? Why are the records rewritten each time, even though I don't want them to be rewritten?
> 
> Thanks,
> Thibaut.
> 
> 
> Code:
>                                 Keyspace ks = getConnection(cluster, consistencylevel);
> 
> 				RangeSlicesQuery<String, String, V> rangeSlicesQuery = HFactory.createRangeSlicesQuery(ks, StringSerializer.get(), StringSerializer.get(), s);
> 
> 				rangeSlicesQuery.setColumnFamily(columnFamily);
> 				rangeSlicesQuery.setColumnNames(column);
> 
> 				rangeSlicesQuery.setKeys(start, end);
> 				rangeSlicesQuery.setRowCount(maxrows);
> 
> 				QueryResult<OrderedRows<String, String, V>> result = rangeSlicesQuery.execute();
> 				return result.get();
> 
> 
> 
> 
> 
> 
> 
> -- 
> With kind regards,
> 
> Robin Verlangen
> www.robinverlangen.nl
> 
> 


Re: cassandra 0.8.7 + hector 0.8.3: All Quorum reads result in writes?

Posted by Thibaut Britz <th...@trendiction.com>.
We have read repair disabled (0.0).

Even if this would be the case, this also doesn't explain why the writes
are executed again and again when going over the same range again and again.

The keyspace is new, it doesn't contain any thumbstones and only 10000 keys.



On Wed, Apr 11, 2012 at 5:52 PM, R. Verlangen <ro...@us2.nl> wrote:

> Are you sure this isn't read-repair?
> http://wiki.apache.org/cassandra/ReadRepair
>
>
> 2012/4/11 Thibaut Britz <th...@trendiction.com>
>
>> Also executing the same multiget rangeslice query over the same range
>> again will trigger the same writes again and again.
>>
>> On Wed, Apr 11, 2012 at 5:41 PM, Thibaut Britz <
>> thibaut.britz@trendiction.com> wrote:
>>
>>> Hi,
>>>
>>> I just diagnosted this strange behavior:
>>>
>>> When I fetch a rangeslice through hector and set the consistency level
>>> to quorum, according to cfstats (and also to the output files on the hd),
>>> cassandra seems to execute a write request for each read I execute. The
>>> write count in cfstats is increased when I execute the rangeslice function
>>> over the same range again and again (without saving anything at all).
>>>
>>> If I set the consitency level to ONE, no writes are executed.
>>>
>>> How can I disable this? Why are the records rewritten each time, even
>>> though I don't want them to be rewritten?
>>>
>>> Thanks,
>>> Thibaut.
>>>
>>>
>>> Code:
>>>                                 Keyspace ks = getConnection(cluster,
>>> consistencylevel);
>>>
>>>  RangeSlicesQuery<String, String, V> rangeSlicesQuery =
>>> HFactory.createRangeSlicesQuery(ks, StringSerializer.get(),
>>> StringSerializer.get(), s);
>>>
>>> rangeSlicesQuery.setColumnFamily(columnFamily);
>>> rangeSlicesQuery.setColumnNames(column);
>>>
>>> rangeSlicesQuery.setKeys(start, end);
>>> rangeSlicesQuery.setRowCount(maxrows);
>>>
>>> QueryResult<OrderedRows<String, String, V>> result =
>>> rangeSlicesQuery.execute();
>>> return result.get();
>>>
>>>
>>>
>>>
>>
>
>
> --
> With kind regards,
>
> Robin Verlangen
> www.robinverlangen.nl
>
>

Re: cassandra 0.8.7 + hector 0.8.3: All Quorum reads result in writes?

Posted by "R. Verlangen" <ro...@us2.nl>.
Are you sure this isn't read-repair?
http://wiki.apache.org/cassandra/ReadRepair

2012/4/11 Thibaut Britz <th...@trendiction.com>

> Also executing the same multiget rangeslice query over the same range
> again will trigger the same writes again and again.
>
> On Wed, Apr 11, 2012 at 5:41 PM, Thibaut Britz <
> thibaut.britz@trendiction.com> wrote:
>
>> Hi,
>>
>> I just diagnosted this strange behavior:
>>
>> When I fetch a rangeslice through hector and set the consistency level to
>> quorum, according to cfstats (and also to the output files on the hd),
>> cassandra seems to execute a write request for each read I execute. The
>> write count in cfstats is increased when I execute the rangeslice function
>> over the same range again and again (without saving anything at all).
>>
>> If I set the consitency level to ONE, no writes are executed.
>>
>> How can I disable this? Why are the records rewritten each time, even
>> though I don't want them to be rewritten?
>>
>> Thanks,
>> Thibaut.
>>
>>
>> Code:
>>                                 Keyspace ks = getConnection(cluster,
>> consistencylevel);
>>
>>  RangeSlicesQuery<String, String, V> rangeSlicesQuery =
>> HFactory.createRangeSlicesQuery(ks, StringSerializer.get(),
>> StringSerializer.get(), s);
>>
>> rangeSlicesQuery.setColumnFamily(columnFamily);
>> rangeSlicesQuery.setColumnNames(column);
>>
>> rangeSlicesQuery.setKeys(start, end);
>> rangeSlicesQuery.setRowCount(maxrows);
>>
>> QueryResult<OrderedRows<String, String, V>> result =
>> rangeSlicesQuery.execute();
>> return result.get();
>>
>>
>>
>>
>


-- 
With kind regards,

Robin Verlangen
www.robinverlangen.nl

Re: cassandra 0.8.7 + hector 0.8.3: All Quorum reads result in writes?

Posted by Thibaut Britz <th...@trendiction.com>.
Also executing the same multiget rangeslice query over the same range again
will trigger the same writes again and again.

On Wed, Apr 11, 2012 at 5:41 PM, Thibaut Britz <
thibaut.britz@trendiction.com> wrote:

> Hi,
>
> I just diagnosted this strange behavior:
>
> When I fetch a rangeslice through hector and set the consistency level to
> quorum, according to cfstats (and also to the output files on the hd),
> cassandra seems to execute a write request for each read I execute. The
> write count in cfstats is increased when I execute the rangeslice function
> over the same range again and again (without saving anything at all).
>
> If I set the consitency level to ONE, no writes are executed.
>
> How can I disable this? Why are the records rewritten each time, even
> though I don't want them to be rewritten?
>
> Thanks,
> Thibaut.
>
>
> Code:
>                                 Keyspace ks = getConnection(cluster,
> consistencylevel);
>
>  RangeSlicesQuery<String, String, V> rangeSlicesQuery =
> HFactory.createRangeSlicesQuery(ks, StringSerializer.get(),
> StringSerializer.get(), s);
>
> rangeSlicesQuery.setColumnFamily(columnFamily);
> rangeSlicesQuery.setColumnNames(column);
>
> rangeSlicesQuery.setKeys(start, end);
> rangeSlicesQuery.setRowCount(maxrows);
>
> QueryResult<OrderedRows<String, String, V>> result =
> rangeSlicesQuery.execute();
> return result.get();
>
>
>
>