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. |
Description
Current
159, TIMEOUT_EXCEEDEDis retried unconditionally. It should be a dedicated failure cause selectable per operation because different queries need different behavior:SELECTSELECTmax_execution_timemax_execution_timeor rewrite query.INSERTinsert_deduplicate = 1)INSERTDDL / MutationsALTER,OPTIMIZE, or background mutationssystem.mutations,system.merges) before re-executing.