Repository navigation
Multiple static stateless worker clusters, selectable per query - #124938
Conversation
A server can configure several stateless worker clusters: the flat `stateless_worker_client` block stays the default cluster, and named clusters live under `stateless_worker_client.clusters.<name>`. A query picks one with the new `distributed_plan_worker_cluster` setting. `IStatelessWorkersProvider` abstracts a worker source. Providers are built by `StatelessWorkersProviderFactory` from registered provider kinds; this build registers `static`, a fixed `cluster` (single-shard `remote_servers` entry) or `host`. `StatelessWorkersProviderRegistry` owns one provider per cluster, builds it on first use, and on config reload retires a cluster whose configuration changed (queries still holding it drain on it) without ever throwing. The query context resolves its cluster's provider once, so plan sizing and the allocation (`StatelessWorkerAllocation`) see one provider and one worker set. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [92f7b09] Summary: ✅
AI ReviewSummaryThe PR adds named stateless worker clusters, query-level cluster selection, and cached providers shared between planning and allocation. Two previously reported reload concerns remain in the current code; both were explicitly dismissed by the author and are retained below without reopening their threads. No new inline findings. Missing context / blind spots
Findings
Tests
Final VerdictStatus: |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A provider kind is registered under the configuration key that selects it (`cluster` and `host` for the static kind), so the factory finds a cluster's kind from the keys it sets and the per-kind source counting is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e client is disabled The worker fill no longer re-checks `stateless_worker_client.enabled`: a query that resolved its provider keeps allocating from it after a reload disables the client, while resolving a new provider is refused by the registry (`SUPPORT_IS_DISABLED`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
The server publishes a new configuration before it reloads the registry, so a lookup compares the cached provider's signature with the live configuration and rebuilds it on a mismatch; a query started after the change never resolves to the stale provider. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ected and signed with A lookup reads the server configuration once and uses it for the cluster selection, the signature and the build, including the static provider's worker resolution, so a reload published in between cannot mix two configurations. Building also refuses a cluster that does not configure exactly one worker source. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Commit See the job log for details. |
|
@groeneai, please investigate the AST fuzzer failure and provide a fix in a separate PR. If the fix is already in progress, link it here. Job: https://github.com/ClickHouse/ClickHouse/actions/runs/38013471256/job/114117867192 |
|
Acknowledged. The throw is in the three-argument |
|
Follow-up: #108787 does not fix this one. Its name-based fallback assigns the first DAG input to the left side, which is wrong for a join swapped by Cascades join commutativity, the shape in this failure. The fix is #125071: the |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`StatelessWorkersProviderRegistry::getBuiltProviders` returns the providers built so far, by cluster, without building any. Drops the unused `Context::tryGetStatelessWorkersProvider`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…refix on reload A provider lookup computes the configuration signature before taking the registry mutex, so concurrent queries do not serialize on it. A reload passes each provider its cluster's configuration prefix. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `getBuiltProviders` reports the default cluster under its `default_cluster_name`, so the system table no longer handles the registry's empty key; - the discovery provider's worker reachability check is a method rather than an injected function; tests replace it through the lease hooks; - rename `computeConfigSignature` to `computeConfigSignatureForCluster`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ker-clusters # Conflicts: # src/QueryPipeline/DistributedPlanExecutor.cpp
On a server without a `stateless_worker_client` block (the stock config, and the NightlySQLancer server) `make_distributed_plan = 1` failed with NO_ELEMENTS_IN_CONFIG "No default stateless worker cluster is configured; set `distributed_plan_worker_cluster` to one of: ." (an empty list). `StatelessWorkersProviderRegistry::getProvider` canonicalized the cluster selection first, and the `enabled` check lived in `buildProvider`, after it. ClickHouse#124938 removed the check from `fillWorkerAddresses` because "resolving a new provider is refused by the registry (SUPPORT_IS_DISABLED)", but that held only when a disabled client still named a worker source. Check `enabled` at the start of `getProvider` and drop the duplicate in `buildProvider` (its only caller, same configuration object). A disabled client never resolved a provider before either: a cached entry's signature never matches the empty signature of a disabled client, so only the error changes. A query that already resolved its provider still drains on it, since `Context::getStatelessWorkersProvider` never re-enters the registry. The SQLancer DistributedPlanEquivalence oracle expects SUPPORT_IS_DISABLED but not the new message, so every database was a finding and the 2026-10-19 nightly stopped at the 2000-finding cap. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A server can now configure several stateless worker clusters and pick one per query.
stateless_worker_clientblock remains the default cluster, so existing configs keep working unchanged. Named clusters go understateless_worker_client.clusters.<name>, and each names exactly one worker source: acluster(a single-shardremote_serversentry) or ahost. The default can be given a name withdefault_cluster_name, or omitted for a symmetric config where every query names its cluster.distributed_plan_worker_clusterselects the cluster for a query's distributed plan (empty = the default). An unknown cluster, one without a worker source, or an empty selection when there is no default is rejected rather than silently run locally.IStatelessWorkersProviderabstracts a worker source.StatelessWorkersProviderFactorybuilds providers from registered provider kinds; this build registers one,static.StatelessWorkersProviderRegistryowns one provider per cluster and builds it on first use.getCascadesPlanningNodeCount) and the per-queryStatelessWorkerAllocationuse the same provider and worker set.Tests: gtests for the static provider (host/cluster forms, single-shard check, snapshot across reload,
remote_serverschanges), the registry (named cluster, reload retirement, broken config on reload), the per-query provider resolution, and plan sizing for default/named/no-default/disabled/ambiguous configurations.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not for changelog.
Workflow [PR]
Sync PR [sync-upstream/pr/124938]
Version info
26.11.1.120-master(included in26.11and later)