You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/10/06 19:45:00 UTC

[jira] [Resolved] (CAMEL-24595) CassandraKeyValueRepository: implement atomic replace() and delete(key, expected) using lightweight transactions

     [ https://issues.apache.org/jira/browse/CAMEL-24595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-24595.
---------------------------------
    Fix Version/s: 4.23.0
       Resolution: Fixed

Done in commit aa7bf6a6820b on main (2026-09-03). Resolving, as the ticket was not updated when the change was merged.

_Claude Code on behalf of Claus Ibsen_

> CassandraKeyValueRepository: implement atomic replace() and delete(key, expected) using lightweight transactions
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24595
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24595
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cassandraql
>            Reporter: Guillaume Nodet
>            Priority: Minor
>             Fix For: 4.23.0
>
>
> CassandraKeyValueRepository.putIfAbsent() already uses Cassandra's lightweight transactions (INSERT ... IF NOT EXISTS) for atomic CAS semantics, but replace(key, expected, newValue, ttl) and delete(key, expected) fall back to the non-atomic default implementation from the KeyValueRepository SPI (read-then-write).
> Cassandra natively supports conditional mutations that would make these truly atomic:
> - UPDATE ... SET value = ? WHERE key = ? IF value = ?  for replace()
> - DELETE FROM ... WHERE key = ? IF value = ?  for delete(key, expected)
> This would bring the Cassandra backend in line with putIfAbsent() which already uses LWT for true server-side CAS.
> Flagged during review of [PR #25993|https://github.com/apache/camel/pull/25993] by [~davsclaus]: [review comment|https://github.com/apache/camel/pull/25993#discussion_r3913781654]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)