You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ClickHouse clusters operating without replicas, individual shards may become unavailable or overloaded, potentially causing distributed queries to fail when encountering compromised nodes.
The current implementation provides the skip_unavailable_shards configuration parameter to silently exclude non-responsive shards from query execution. However, this mechanism lacks the capability to handle other types of shard-level errors such as TOO_MANY_SIMULTANEOUS_QUERIES, which typically indicates temporary resource constraints.
This limitation becomes particularly relevant in logging implementations and other time-series use cases where system resilience benefits from gracefully ignoring transient node failures. A more comprehensive error-handling approach could improve query continuity while maintaining data consistency across operational shards.
Describe the solution you'd like
Introduce a configuration parameter skip_failed_shards_mode (disabled by default) to enable granular control over error handling in distributed queries. This parameter accepts a comma-separated list of error codes that should be non-fatally ignored during query execution.
e.g. skip_failed_shards_mode=TOO_MANY_SIMULTANEOUS_QUERIES,MEMORY_LIMIT_EXCEEDED
For testing, we can use integration tests (they are in the tests/integration directory). You will find ways how to spin up a cluster with multiple nodes, and then do some operations on a particular node. The easiest way for testing will be - damage the table on one of the nodes, so it will have an incorrect structure, or something like throwIf in an ALIAS column.
Activity
byte-sourcerer commentedon Apr 11, 2025
If this approach makes sense, I’d love to work on implementing it.
Just need:
alexey-milovidov commentedon Apr 11, 2025
Yes, this makes sense.
Let's not allow listing every error code, but, instead, make
skip_unavailable_shards_mode = 'unavailable' | 'unavailable_or_exception'byte-sourcerer commentedon Apr 12, 2025
Thanks for confirming! Just to clarify:
skip_unavailable_shards_mode = 'unavailable':'unavailable_or_exception':Testing strategy question:
For multi-instance testing for this feature, any approach you recommend?
alexey-milovidov commentedon Apr 12, 2025
For testing, we can use integration tests (they are in the
tests/integrationdirectory). You will find ways how to spin up a cluster with multiple nodes, and then do some operations on a particular node. The easiest way for testing will be - damage the table on one of the nodes, so it will have an incorrect structure, or something likethrowIfin an ALIAS column.byte-sourcerer commentedon Apr 30, 2025
Hi @alexey-milovidov
Could you please spare some time to review this PR when you have a chance? Your feedback would be greatly appreciated!
Link to PR: PR #79091
Thank you! 😊