Read/Write consistency issue

2014-01-10 Thread Manoj Khangaonkar
Hi Using Cassandra 2.0.0. 3 node cluster Replication 2. Using consistency ALL for both read and writes. I have a single thread that reads a value, updates it and writes it back to the table. The column type is big int. Updating counts for a timestamp. With single thread and consistency ALL , I

Re: Read/Write consistency issue

2014-01-10 Thread Robert Wille
@cassandra.apache.org Date: Friday, January 10, 2014 at 2:50 PM To: user@cassandra.apache.org Subject: Read/Write consistency issue Hi Using Cassandra 2.0.0. 3 node cluster Replication 2. Using consistency ALL for both read and writes. I have a single thread that reads a value, updates it and writes

RE: Read/Write consistency issue

2014-01-10 Thread Todd Carrico
That, or roll your own locking. Means multiple updates, but it works reliably. tc From: Robert Wille [mailto:rwi...@fold3.com] Sent: Friday, January 10, 2014 4:25 PM To: user@cassandra.apache.org Subject: Re: Read/Write consistency issue Cassandra is a last-write wins kind of a deal. The last

Re: Read/Write consistency issue

2014-01-10 Thread Robert Wille
...@match.com Reply-To: user@cassandra.apache.org Date: Friday, January 10, 2014 at 3:28 PM To: user@cassandra.apache.org user@cassandra.apache.org Subject: RE: Read/Write consistency issue That, or roll your own locking. Means multiple updates, but it works reliably. tc From: Robert Wille

RE: Read/Write consistency issue

2014-01-10 Thread Todd Carrico
Is it possible to pin to a node, instead of letting the client find the next node (round robin)? Sorry, a C* noob here... tc From: Robert Wille [mailto:rwi...@fold3.com] Sent: Friday, January 10, 2014 4:35 PM To: user@cassandra.apache.org Subject: Re: Read/Write consistency issue Actually

Re: Read/Write consistency issue

2014-01-10 Thread Steven A Robenalt
. Robert From: Todd Carrico todd.carr...@match.com Reply-To: user@cassandra.apache.org Date: Friday, January 10, 2014 at 3:28 PM To: user@cassandra.apache.org user@cassandra.apache.org Subject: RE: Read/Write consistency issue That, or roll your own locking. Means multiple updates

Re: Read/Write consistency issue

2014-01-10 Thread Tupshin Harper
From: Todd Carrico todd.carr...@match.com Reply-To: user@cassandra.apache.org Date: Friday, January 10, 2014 at 3:28 PM To: user@cassandra.apache.org user@cassandra.apache.org Subject: RE: Read/Write consistency issue That, or roll your own locking. Means multiple updates, but it works reliably

Re: Read/Write consistency issue

2014-01-10 Thread Robert Wille
rapid repeated writing is not an issue. Why would this be bad? Robert From: Steven A Robenalt srobe...@stanford.edu Reply-To: user@cassandra.apache.org Date: Friday, January 10, 2014 at 3:41 PM To: user@cassandra.apache.org Subject: Re: Read/Write consistency issue My understanding

Re: Read/Write consistency issue

2014-01-10 Thread Tupshin Harper
: Steven A Robenalt srobe...@stanford.edu Reply-To: user@cassandra.apache.org Date: Friday, January 10, 2014 at 3:41 PM To: user@cassandra.apache.org Subject: Re: Read/Write consistency issue My understanding is that it's generally a Cassandra anti-pattern to do read-before-write in any case

RE: Read/Write consistency issue

2014-01-10 Thread Todd Carrico
, January 10, 2014 4:52 PM To: user@cassandra.apache.org Subject: Re: Read/Write consistency issue Interested in knowing more on why read-before-write is an anti-pattern. In the next month or so, I intend to use Cassandra as a doc store. One very common operation will be to read the document, make

RE: Read/Write consistency issue

2014-01-10 Thread Todd Carrico
] Sent: Friday, January 10, 2014 5:13 PM To: user@cassandra.apache.org Subject: Re: Read/Write consistency issue It is bad because of the risk of concurrent modifications. If you don't have some kind of global lock on the document/row, then 2 readers might read version A, reader 1 writes version

Re: Read/Write consistency issue

2014-01-10 Thread Manoj Khangaonkar
To: user@cassandra.apache.org user@cassandra.apache.org Subject: RE: Read/Write consistency issue That, or roll your own locking. Means multiple updates, but it works reliably. tc *From:* Robert Wille [mailto:rwi...@fold3.com rwi...@fold3.com] *Sent:* Friday, January 10, 2014 4:25 PM

Re: Read/Write consistency issue

2014-01-10 Thread Steven A Robenalt
*Subject:* Re: Read/Write consistency issue It is bad because of the risk of concurrent modifications. If you don't have some kind of global lock on the document/row, then 2 readers might read version A, reader 1 writes version B based on A, and reader 2 writes version C based

Re: Read/Write consistency issue

2014-01-10 Thread Tupshin Harper
this pattern work. Robert From: Todd Carrico todd.carr...@match.com Reply-To: user@cassandra.apache.org Date: Friday, January 10, 2014 at 3:28 PM To: user@cassandra.apache.org user@cassandra.apache.org Subject: RE: Read/Write consistency issue That, or roll your own locking. Means multiple

Re: Read/Write consistency issue

2014-01-10 Thread Steven A Robenalt
work. Robert From: Todd Carrico todd.carr...@match.com Reply-To: user@cassandra.apache.org Date: Friday, January 10, 2014 at 3:28 PM To: user@cassandra.apache.org user@cassandra.apache.org Subject: RE: Read/Write consistency issue That, or roll your own locking. Means multiple updates

Re: Read/Write consistency issue

2014-01-10 Thread Andrey Ilinykh
For single thread, consistency ALL it should work. I believe you do something different. What are these three numbers exactly? old=60616 val =19 new =60635 On Fri, Jan 10, 2014 at 1:50 PM, Manoj Khangaonkar khangaon...@gmail.comwrote: Hi Using Cassandra 2.0.0. 3 node cluster Replication 2.

Re: Read/Write consistency issue

2014-01-10 Thread Manoj Khangaonkar
old is the value that was read from the column. val is the value that needs to be added to it. new is (old + val) that is written back to the column. regards On Fri, Jan 10, 2014 at 4:36 PM, Andrey Ilinykh ailin...@gmail.com wrote: For single thread, consistency ALL it should work. I believe

Re: Read/Write consistency issue

2014-01-10 Thread Robert Wille
@cassandra.apache.org Date: Friday, January 10, 2014 at 4:59 PM To: user@cassandra.apache.org Subject: Re: Read/Write consistency issue As was pointed out earlier, Consistency.ALL is still subject to the possibility of clock drift between nodes, and there is also the problem of using the exact same