[client-v2, jdbc-v2] Make execution TIMEOUT error optionally retriable

Open
#3,072 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
api, databases

Research direction

Start by tracing TIMEOUT_EXCEEDED handling in client-v2 and jdbc-v2, especially how the 159 failure is currently retried. Compare operation handling for SELECT, INSERT, and DDL or mutations, then determine where per-operation retry selection belongs. Done means timeout retry behavior can differ by operation and reflects the safety distinctions described in the table.

Written by the indexing model from the issue text.

Description

area:general client-api-v2 jdbc-v2

Description

Current 159, TIMEOUT_EXCEEDED is retried unconditionally. It should be a dedicated failure cause selectable per operation because different queries need different behavior:

Query Type Scenario Retriable? Recommended Action
SELECT Pure read operations Yes Retry with exponential backoff or redirect to a replica node.
SELECT Heavy unoptimized query hitting max_execution_time No Do not retry under identical settings. Increase max_execution_time or rewrite query.
INSERT MergeTree tables with deduplication active (insert_deduplicate = 1) Yes Safe to retry using the exact same data block structure.
INSERT Tables without block deduplication No Unsafe. Partial blocks may have been written; retrying risks duplicate rows. Check table state first.
DDL / Mutations ALTER, OPTIMIZE, or background mutations No Inspect system tables (system.mutations, system.merges) before re-executing.
Dominant language
Java
Stars
1.6k
Forks
637
Avg merge
2d 12h
Merged PRs (30d)
28

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ClickHouse/clickhouse-java

All issues in ClickHouse/clickhouse-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.