cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Spriegel (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-13086) CAS resultset sometimes does not contain value column even though wasApplied is false
Date Mon, 09 Jan 2017 09:47:58 GMT


Christian Spriegel commented on CASSANDRA-13086:

I did not know that the value can be null. I think this is what is happening in my case:
# My application tries to delete with a condition, which fails due to a WriteTimeoutException
# My application retries the same delete operation
# Cassandra returns a wasapplied=false and no value column, because the last delete was already

I find that behaviour a bit strange, as the datastax-java-driver does not give me any method
to check whether a column exists or not. It gives me a way to check for null values though.

My question now would be: Wouldn't it be better if Cassandra would return a null value instead
of not including the column?

> CAS resultset sometimes does not contain value column even though wasApplied is false
> -------------------------------------------------------------------------------------
>                 Key: CASSANDRA-13086
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Christian Spriegel
>            Priority: Minor
> Every now and then I see a ResultSet for one of my CAS queries that contain wasApplied=false,
but does not contain my value column.
> I just now found another occurrence, which causes the following exception in the driver:
> {code}
> ...
> Caused by: com.mycompany.MyDataaccessException: checkLock(ResultSet[ exhausted: true,
>     at com.mycompany.MyDAO._checkLock(
>     at com.mycompany.MyDAO._releaseLock(
>     ... 16 more
> Caused by: java.lang.IllegalArgumentException: value is not a column defined in this
>     at com.datastax.driver.core.ColumnDefinitions.getAllIdx(
>     at com.datastax.driver.core.ColumnDefinitions.getFirstIdx(
>     at com.datastax.driver.core.ArrayBackedRow.getIndexOf(
>     at com.datastax.driver.core.AbstractGettableData.getBytes(
>     at com.mycompany.MyDAO._checkLock(
>     ... 17 more
> {code}
> The query the application was doing:
> delete from "Lock" where lockname=:lockname and id=:id if value=:value;
> I did some debugging recently and was able to track these ResultSets to StorageProxy.cas()
to the "CAS precondition does not match current values {}" return statement.
> I saw this happening with Cassandra 3.0.10 and earlier versions.

This message was sent by Atlassian JIRA

View raw message