Skip to content

fix: mark idempotent CQL queries for driver-level retry on write timeouts#10050

Open
mykaul wants to merge 1 commit intotemporalio:mainfrom
mykaul:fix/idempotent-cql-retry
Open

fix: mark idempotent CQL queries for driver-level retry on write timeouts#10050
mykaul wants to merge 1 commit intotemporalio:mainfrom
mykaul:fix/idempotent-cql-retry

Conversation

@mykaul
Copy link
Copy Markdown
Contributor

@mykaul mykaul commented Apr 24, 2026

Summary

  • Marks pure-read (SELECT) and unconditional-write (INSERT/DELETE without IF conditions) CQL queries with .Idempotent(true) across all 13 Cassandra persistence store files.
  • This allows the gocql driver's retry policy to retry these queries on WriteTimeoutError instead of returning Rethrow, reducing transient error propagation to the application layer.
  • LWT/CAS queries are intentionally left unmarked to preserve correctness guarantees.

Motivation

Both Cassandra and ScyllaDB can return write timeouts under load. Without the idempotent flag, the driver's OnWriteTimeout handler returns Rethrow, forcing expensive application-level retries (full persistence operation replay, context re-creation). Driver-level retry is significantly cheaper and handles the common transient timeout case transparently.

Testing

  • Tested with omes throughput_stress against both Cassandra 5.0 and ScyllaDB 2025.4 with no regressions.
  • Build and vet pass cleanly.

…outs

Pure reads (SELECT) and unconditional writes (INSERT/DELETE without IF
conditions) are now marked with .Idempotent(true) so the gocql driver
retries them on write timeouts instead of returning Rethrow. LWT/CAS
queries are intentionally left unmarked since retrying them could
violate correctness.

Tested with omes throughput_stress against both Cassandra 5.0 and
ScyllaDB 2025.4 with no regressions.
@mykaul mykaul requested review from a team as code owners April 24, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant