I had this problem, and it was caused by my retry policy. For reasons I don’t remember (but is documented in a C* Jira ticket), when onWriteTimeout() is called, you cannot call RetryDecision.retry(cl), as it will be a CL that is incompatible with LWT. After the fix (2.1.?), you can pass null, and it will use the original CL.
On Jun 30, 2016, at 6:11 PM, Justin Lin <linjianfeng...@gmail.com> wrote: > Hi everyone, > > I recently encountered a problem wrt light weight transaction. My query is to > insert a row to a table if the row doesn't exist. It goes like this: > > Insert Into mytable (key, col1, col2) Value("key1", 1, 2) If Not Exist > > My case is the driver somehow gets time out from waiting for coordinator to > response, but the transaction actually succeeded. So my code retry the query > and failed. > > This is not an idempotent write, so the retry might be a bad idea. And > honestly this is not a cassandra issue. But i wonder if anyone in the > community ever had this problem before and how would you recommend to solve > it? > > Thanks > > -- > come on