You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Jaroslav Kameník <ja...@kamenik.cz> on 2017/01/20 12:24:53 UTC

WriteTimeoutException when doing paralel DELETE IF EXISTS

Hi,

I would like to ask here before posting new bug. I am trying to make a
simple system
for distribution preallocated tickets between concurrent clients using C*
LWTs.
It is simply one partition containing tickets for one domain, client reads
the first one
and tries to delete it conditionally, success = it owns it, fail = try
again..

It works well, but it starts to fail with WTEs under load. So I tried to
make simple
test with 16 concurrent threads competing for one row with 1000 cols. It
was running
on cluster with 5 C* 3.0.9 with default configuration, replication factor
3.

Surprisingly, it failed immediately after few requests. It takes longer
time with
less threads, but even 2 clients are enough to crash it.

I am wondering, if it Is problem in Cassandra or normal behaviour or bad
use of LWT?

Thanks,

Jaroslav

Re: WriteTimeoutException when doing paralel DELETE IF EXISTS

Posted by Blake Eggleston <be...@apple.com>.
Hi Jaroslav,

That's pretty much expected behavior for the current LWT implementation, which has problems with key contention (the usage pattern you're describing here). Typically, you want to avoid having multiple clients doing LWT operations on the same partition key at the same time.

Thanks,

Blake
On January 20, 2017 at 4:25:05 AM, Jaroslav Kameník (jaroslav@kamenik.cz) wrote:

Hi,  

I would like to ask here before posting new bug. I am trying to make a  
simple system  
for distribution preallocated tickets between concurrent clients using C*  
LWTs.  
It is simply one partition containing tickets for one domain, client reads  
the first one  
and tries to delete it conditionally, success = it owns it, fail = try  
again..  

It works well, but it starts to fail with WTEs under load. So I tried to  
make simple  
test with 16 concurrent threads competing for one row with 1000 cols. It  
was running  
on cluster with 5 C* 3.0.9 with default configuration, replication factor  
3.  

Surprisingly, it failed immediately after few requests. It takes longer  
time with  
less threads, but even 2 clients are enough to crash it.  

I am wondering, if it Is problem in Cassandra or normal behaviour or bad  
use of LWT?  

Thanks,  

Jaroslav  

Re: WriteTimeoutException when doing paralel DELETE IF EXISTS

Posted by Eric Stevens <mi...@gmail.com>.
This question is probably better suited for the user@ group.

It doesn't sound to me like you've uncovered a bug, but rather you're
engaging in highly contentious paxos, which is rarely going to have a
favorable outcome.  Likely you're overwhelming your cluster (or more
specifically the replicas for your single partition - in that sense for
your test as designed cluster size would be basically irrelevant).

It also sounds like you're building something like a queue, which is a
significant classic anti-pattern in the Cassandra realm; there are much
better purpose built tools for this.

See
http://www.datastax.com/dev/blog/cassandra-anti-patterns-queues-and-queue-like-datasets
for
more information on why queue-like datasets aren't a good fit for Cassandra.

On Fri, Jan 20, 2017 at 5:25 AM Jaroslav Kameník <ja...@kamenik.cz>
wrote:

> Hi,
>
> I would like to ask here before posting new bug. I am trying to make a
> simple system
> for distribution preallocated tickets between concurrent clients using C*
> LWTs.
> It is simply one partition containing tickets for one domain, client reads
> the first one
> and tries to delete it conditionally, success = it owns it, fail = try
> again..
>
> It works well, but it starts to fail with WTEs under load. So I tried to
> make simple
> test with 16 concurrent threads competing for one row with 1000 cols. It
> was running
> on cluster with 5 C* 3.0.9 with default configuration, replication factor
> 3.
>
> Surprisingly, it failed immediately after few requests. It takes longer
> time with
> less threads, but even 2 clients are enough to crash it.
>
> I am wondering, if it Is problem in Cassandra or normal behaviour or bad
> use of LWT?
>
> Thanks,
>
> Jaroslav
>