Add max_skip_unavailable_shards_num and max_skip_unavailable_shards_ratio settings#99369
Conversation
…s_ratio` settings When `skip_unavailable_shards` is enabled, these settings limit how many shards can be silently skipped before throwing an exception: - `max_skip_unavailable_shards_num` (UInt64, default 0): if the number of unavailable shards exceeds this value, throw `TOO_MANY_UNAVAILABLE_SHARDS`. A value of 0 means no limit. - `max_skip_unavailable_shards_ratio` (Float, default 0): if the ratio of unavailable shards to total shards exceeds this value, throw `TOO_MANY_UNAVAILABLE_SHARDS`. A value of 0 means no limit. This prevents silently returning incomplete results when a large portion of the cluster is down. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s_ratio` to SettingsChangesHistory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@alexey-milovidov |
This is alright. |
…re in headers Avoid including `UnavailableShardTracker.h` (which pulls in `Common/Exception.h`) from high-fan-out headers `RemoteQueryExecutor.h` and `ReadFromRemote.h`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@orloffv, yes, I want to add it. It will be one of the next PRs. |
LLVM Coverage ReportPR changed lines: PR changed-lines coverage: 99.16% (118/119, 0 noise lines excluded) |

Summary
max_skip_unavailable_shards_num(UInt64, default 0) setting: whenskip_unavailable_shardsis enabled, if the number of unavailable shards exceeds this value, throwTOO_MANY_UNAVAILABLE_SHARDSinstead of silently skipping. A value of 0 means no limit.max_skip_unavailable_shards_ratio(Float, default 0) setting: same but based on the ratio of unavailable shards to total shards. A value of 0 means no limit.Test plan
04038_max_skip_unavailable_shardsthat verifies:skip_unavailable_shardsis disabledTOO_MANY_UNAVAILABLE_SHARDSis thrown when thresholds are exceededChangelog category:
Changelog entry:
Added
max_skip_unavailable_shards_numandmax_skip_unavailable_shards_ratiosettings to limit how many shards can be silently skipped whenskip_unavailable_shardsis enabled. If the number or ratio of unavailable shards exceeds the configured threshold, an exception is thrown instead of returning silently incomplete results.🤖 Generated with Claude Code
Note
Medium Risk
Touches distributed query execution to optionally throw when too many shards are skipped, which could change runtime behavior for users enabling the new limits. Default settings preserve existing behavior but the new shared tracker/exception path needs careful review for concurrency and query fan-out cases.
Overview
Adds two new settings,
max_skip_unavailable_shards_numandmax_skip_unavailable_shards_ratio, to cap how many shards can be silently skipped whenskip_unavailable_shardsis enabled; exceeding either threshold now throwsTOO_MANY_UNAVAILABLE_SHARDSinstead of returning partial results.Implements a shared
UnavailableShardTrackerwired fromexecuteQueryintoReadFromRemote/RemoteQueryExecutorso each skipped shard is counted once across the whole distributed query, and adds a stateless test covering success/error cases for both numeric and ratio limits.Written by Cursor Bugbot for commit 01d35a1. This will update automatically on new commits. Configure here.
Version info
26.3.1.704