From 9bbebadef4ee3d8599946cafe2f74e1a473763fc Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 25 Oct 2024 23:03:32 +0200 Subject: [PATCH] Fixup --- programs/server/Server.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/programs/server/Server.cpp b/programs/server/Server.cpp index 35dae614d87..c106a68f360 100644 --- a/programs/server/Server.cpp +++ b/programs/server/Server.cpp @@ -2267,6 +2267,21 @@ try throw; } + bool found_stop_flag = false; + + if (has_zookeeper && global_context->getMacros()->getMacroMap().contains("replica")) + { + auto zookeeper = global_context->getZooKeeper(); + String stop_flag_path = "/clickhouse/stop_replicated_ddl_queries/{replica}"; + stop_flag_path = global_context->getMacros()->expand(stop_flag_path); + found_stop_flag = zookeeper->exists(stop_flag_path); + } + + if (found_stop_flag) + LOG_INFO(log, "Found a stop flag for replicated DDL queries. They will be disabled"); + else + DatabaseCatalog::instance().startReplicatedDDLQueries(); + LOG_DEBUG(log, "Loaded metadata."); if (has_trace_collector)