Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
90f3cfa
Reload cluster discovery settings from remote_servers without restart.
ianton-ru Aug 6, 2026
90650b8
Fix cluster discovery start races and observer unregister on reload.
ianton-ru Aug 6, 2026
f851336
Fix discovery cluster not appearing after invisible-to-visible reload.
ianton-ru Aug 6, 2026
90d6e81
Fix static discovery replacing a dynamic cluster of the same name.
ianton-ru Aug 6, 2026
a0cb696
Fix stale discovery nodes_info after my_hostname/shard reload.
ianton-ru Aug 10, 2026
b888caa
Start cluster discovery worker when created after server startup.
ianton-ru Aug 10, 2026
e5cd276
Validate discovery config before committing Clusters on reload.
ianton-ru Aug 10, 2026
7e875fa
Skip DDL host-id notify when remote_servers did not change.
ianton-ru Aug 10, 2026
6082415
Validate discovery on reload even when the allow flag is off.
ianton-ru Aug 10, 2026
c02662c
Apply pending discovery config before retrying initialUpdate.
ianton-ru Aug 10, 2026
08148d0
Retry failed discovery ZK unregister after config remove.
ianton-ru Aug 10, 2026
d6a59b0
Cancel pending discovery unregister when the path is live again.
ianton-ru Aug 11, 2026
e7b9dc6
Simplify pending discovery unregister retry path.
ianton-ru Aug 11, 2026
cde1440
Drop unused Flags constructor and duplicate discovery reload docs.
ianton-ru Aug 11, 2026
0a3163a
Rescan multicluster roots after removing a static discovery shadow.
ianton-ru Aug 11, 2026
270b45a
Merge branch 'antalya-26.6' into feature/antalya-26.6/cluster_discove…
ianton-ru Aug 11, 2026
3bd021e
Merge branch 'antalya-26.6' into feature/antalya-26.6/cluster_discove…
mkmkme Aug 12, 2026
6583975
Keep Clusters ownership consistent across static and discovery reloads.
ianton-ru Aug 12, 2026
46dd1fa
Restore ClusterDiscovery wake signals after Keeper exceptions.
ianton-ru Aug 12, 2026
11fb1d4
Stop cluster discovery when allow_experimental_cluster_discovery is d…
ianton-ru Aug 12, 2026
b86f27d
Keep shared discovery path registration when removing an alias.
ianton-ru Aug 12, 2026
49db0ee
Ignore late Keeper watches for removed discovery clusters.
ianton-ru Aug 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/en/operations/cluster-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Traditionally, in ClickHouse, each shard and replica in the cluster needed to be

With Cluster Discovery, rather than defining each node explicitly, you simply specify a path in ZooKeeper. All nodes that register under this path in ZooKeeper will be automatically discovered and added to the cluster.

Discovery settings under `remote_servers` (including `user`, `password`, `secret`, `path`, `multicluster_root_path`, and adding or removing discovery clusters) are applied on configuration reload (for example with `SYSTEM RELOAD CONFIG`). A server restart is not required for these changes.

```xml
<remote_servers>
<cluster_name>
Expand Down
2 changes: 2 additions & 0 deletions src/Common/FailPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ static struct InitFiu
REGULAR(use_delayed_remote_source) \
ONCE(remote_query_executor_cancel_before_send) \
REGULAR(cluster_discovery_faults) \
REGULAR(cluster_discovery_unregister_fail) \
ONCE(cluster_discovery_retry_signal_fail) \
REGULAR(stripe_log_sink_write_fallpoint) \
REGULAR(hybrid_watermarks_read_fail) \
ONCE(smt_commit_merge_mutate_zk_fail_after_op) \
Expand Down
22 changes: 13 additions & 9 deletions src/Interpreters/Cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,36 +386,40 @@ void Clusters::updateClusters(const Poco::Util::AbstractConfiguration & new_conf

std::lock_guard lock(mutex);

/// If old config is set, remove deleted clusters from impl, otherwise just clear it.
/// If old config is set, remove deleted clusters; otherwise rebuild ownership from scratch
/// while preserving non-automatic entries (e.g. clusters added via setCluster).
if (old_config)
{
for (const auto & key : deleted_keys)
{
if (!automatic_clusters.contains(key))
impl.erase(key);
automatic_clusters.erase(key);
impl.erase(key);
}
}
else
{
if (!automatic_clusters.empty())
std::erase_if(impl, [this](const auto & e) { return automatic_clusters.contains(e.first); });
else
impl.clear();
for (const auto & name : automatic_clusters)
impl.erase(name);
automatic_clusters.clear();
}


for (const auto & key : new_config_keys)
{
if (new_config.has(config_prefix + "." + key + ".discovery"))
{
/// Handled in ClusterDiscovery
/// Handled in ClusterDiscovery — must not leave a prior static Cluster in impl,
/// or Context::getCluster / getClusters would prefer the stale static entry.
automatic_clusters.insert(key);
impl.erase(key);
continue;
}

if (key.contains('.'))
throw Exception(ErrorCodes::SYNTAX_ERROR, "Cluster names with dots are not supported: '{}'", key);

/// Leaving discovery (or never was discovery): drop automatic ownership for this name.
automatic_clusters.erase(key);

/// If old config is set and cluster config wasn't changed, don't update this cluster.
if (!old_config || !isSameConfiguration(new_config, *old_config, config_prefix + "." + key))
impl[key] = std::make_shared<Cluster>(new_config, settings, config_prefix, key);
Expand Down
Loading
Loading