ClickHouse / ClickHouse/dbt-clickhouse

Retries should retry on known retriable database errors in addition to connection errors

Open
#165 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
362
Forks
177
Avg merge
2d 10h
Merged PRs (30d)
8

Description

### Describe the bug

Based on this description:
```
retries: [1] # Number of times to retry a "retriable" database exception (such as a 503 'Service Unavailable' error)
```

I was kinda expecting retries to also retry failures in executing queries. Such as:
```
DB::Exception: Timeout: Cannot enqueue query on this replica, most likely because replica is busy with previous queue entries.
```

But looking at the code it looks like retries is set on retry_connection from SQLConnectionManager, which retries on connection failures, not on query failures.

Is this intended? Am I understanding it wrong? This might be a bit of a mix between either a bug report or a feature request, depending on what the intended behavior is! 😀

Contributor guide

Open the contributing guide

Research direction

Start by reading the retry_connection handling in SQLConnectionManager and trace how query execution failures are surfaced. Clarify whether documented retriable database errors should include query failures, then define completion around retrying the intended known errors without changing unrelated connection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.