From 55aa8217f3d9370948772276c043d207e1d3b808 Mon Sep 17 00:00:00 2001 From: Vitaliy Lyudvichenko Date: Mon, 15 May 2017 00:57:30 +0300 Subject: [PATCH] Disable DDL ALTER for replicated tables. [#CLICKHOUSE-5] --- dbms/src/Interpreters/DDLWorker.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dbms/src/Interpreters/DDLWorker.cpp b/dbms/src/Interpreters/DDLWorker.cpp index f4b6f7475c..0ab2c66c58 100644 --- a/dbms/src/Interpreters/DDLWorker.cpp +++ b/dbms/src/Interpreters/DDLWorker.cpp @@ -349,6 +349,12 @@ void DDLWorker::processTaskAlter( if (execute_once_on_replica) { + /// The following code may perform ALTER twice if + /// current secver aquires lock, executes replicated alter, + /// losts zookeeper connection and doesn't have time to create /executed node, second server executes replicated alter again + /// To avoid this problem alter() method of replicated tables should be changed and takes into account ddl query id tag. + throw Exception("Distributed DDL alters don't work properly yet", ErrorCodes::NOT_IMPLEMENTED); + Strings replica_names; for (const auto & address : cluster->getShardsWithFailoverAddresses().at(shard_num)) replica_names.emplace_back(address.toString()); -- GitLab