From d5b4b40b4e3a6265040462abe5c73334c56d5dd3 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Thu, 19 Dec 2019 04:46:20 +0100 Subject: [PATCH 1/7] Add parser --- dbms/src/Interpreters/InterpreterSystemQuery.cpp | 14 +++++++------- dbms/src/Parsers/ASTSystemQuery.cpp | 7 +++++-- dbms/src/Parsers/ASTSystemQuery.h | 10 ++++++++-- dbms/src/Parsers/ParserSystemQuery.cpp | 9 +++++++-- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterSystemQuery.cpp b/dbms/src/Interpreters/InterpreterSystemQuery.cpp index c742ac37a5f..28bf7b08cc6 100644 --- a/dbms/src/Interpreters/InterpreterSystemQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSystemQuery.cpp @@ -102,7 +102,7 @@ void startStopAction(Context & context, ASTSystemQuery & query, StorageActionBlo if (!query.target_table.empty()) { - String database = !query.target_database.empty() ? query.target_database : context.getCurrentDatabase(); + String database = !query.database.empty() ? query.database : context.getCurrentDatabase(); if (start) manager->remove(database, query.target_table, action_type); @@ -137,8 +137,8 @@ BlockIO InterpreterSystemQuery::execute() system_context.setSetting("profile", context.getSystemProfileName()); /// Make canonical query for simpler processing - if (!query.target_table.empty() && query.target_database.empty()) - query.target_database = context.getCurrentDatabase(); + if (!query.target_table.empty() && query.database.empty()) + query.database = context.getCurrentDatabase(); switch (query.type) { @@ -233,8 +233,8 @@ BlockIO InterpreterSystemQuery::execute() restartReplicas(system_context); break; case Type::RESTART_REPLICA: - if (!tryRestartReplica(query.target_database, query.target_table, system_context)) - throw Exception("There is no " + query.target_database + "." + query.target_table + " replicated table", + if (!tryRestartReplica(query.database, query.target_table, system_context)) + throw Exception("There is no " + query.database + "." + query.target_table + " replicated table", ErrorCodes::BAD_ARGUMENTS); break; case Type::FLUSH_LOGS: @@ -335,7 +335,7 @@ void InterpreterSystemQuery::restartReplicas(Context & system_context) void InterpreterSystemQuery::syncReplica(ASTSystemQuery & query) { - String database_name = !query.target_database.empty() ? query.target_database : context.getCurrentDatabase(); + String database_name = !query.database.empty() ? query.database : context.getCurrentDatabase(); const String & table_name = query.target_table; StoragePtr table = context.getTable(database_name, table_name); @@ -358,7 +358,7 @@ void InterpreterSystemQuery::syncReplica(ASTSystemQuery & query) void InterpreterSystemQuery::flushDistributed(ASTSystemQuery & query) { - String database_name = !query.target_database.empty() ? query.target_database : context.getCurrentDatabase(); + String database_name = !query.database.empty() ? query.database : context.getCurrentDatabase(); String & table_name = query.target_table; if (auto storage_distributed = dynamic_cast(context.getTable(database_name, table_name).get())) diff --git a/dbms/src/Parsers/ASTSystemQuery.cpp b/dbms/src/Parsers/ASTSystemQuery.cpp index 4e7525bb176..0d096bb805f 100644 --- a/dbms/src/Parsers/ASTSystemQuery.cpp +++ b/dbms/src/Parsers/ASTSystemQuery.cpp @@ -97,9 +97,9 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, { settings.ostr << " "; - if (!target_database.empty()) + if (!database.empty()) { - settings.ostr << (settings.hilite ? hilite_identifier : "") << backQuoteIfNeed(target_database) + settings.ostr << (settings.hilite ? hilite_identifier : "") << backQuoteIfNeed(database) << (settings.hilite ? hilite_none : "") << "."; } @@ -107,6 +107,9 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, << (settings.hilite ? hilite_none : ""); }; + if (!cluster.empty()) + { + } if ( type == Type::STOP_MERGES || type == Type::START_MERGES || type == Type::STOP_TTL_MERGES diff --git a/dbms/src/Parsers/ASTSystemQuery.h b/dbms/src/Parsers/ASTSystemQuery.h index 77e8591a5f5..fa2ee1b0a51 100644 --- a/dbms/src/Parsers/ASTSystemQuery.h +++ b/dbms/src/Parsers/ASTSystemQuery.h @@ -1,13 +1,14 @@ #pragma once #include "config_core.h" +#include #include namespace DB { -class ASTSystemQuery : public IAST +class ASTSystemQuery : public IAST, public ASTQueryWithOnCluster { public: @@ -55,13 +56,18 @@ public: Type type = Type::UNKNOWN; String target_dictionary; - String target_database; + String database; String target_table; String getID(char) const override { return "SYSTEM query"; } ASTPtr clone() const override { return std::make_shared(*this); } + ASTPtr getRewrittenASTWithoutOnCluster(const std::string & new_database) const override + { + return removeOnCluster(clone(), new_database); + } + protected: void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override; diff --git a/dbms/src/Parsers/ParserSystemQuery.cpp b/dbms/src/Parsers/ParserSystemQuery.cpp index 0a5bd1bf63e..b1047be6bfc 100644 --- a/dbms/src/Parsers/ParserSystemQuery.cpp +++ b/dbms/src/Parsers/ParserSystemQuery.cpp @@ -41,6 +41,11 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & switch (res->type) { case Type::RELOAD_DICTIONARY: + if (ParserKeyword{"ON"}.ignore(pos, expected)) + { + if (!ASTQueryWithOnCluster::parse(pos, res->cluster, expected)) + return false; + } if (!parseIdentifierOrStringLiteral(pos, expected, res->target_dictionary)) return false; break; @@ -48,7 +53,7 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & case Type::RESTART_REPLICA: case Type::SYNC_REPLICA: case Type::FLUSH_DISTRIBUTED: - if (!parseDatabaseAndTableName(pos, expected, res->target_database, res->target_table)) + if (!parseDatabaseAndTableName(pos, expected, res->database, res->target_table)) return false; break; @@ -66,7 +71,7 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & case Type::START_REPLICATION_QUEUES: case Type::STOP_DISTRIBUTED_SENDS: case Type::START_DISTRIBUTED_SENDS: - parseDatabaseAndTableName(pos, expected, res->target_database, res->target_table); + parseDatabaseAndTableName(pos, expected, res->database, res->target_table); break; default: From 9e808e4a0d833d004f3d0807f9213fa5dac73418 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Thu, 19 Dec 2019 08:54:43 +0100 Subject: [PATCH 2/7] Let the command SYSTEM RELOAD DICTIONARY to use ON CLUSTER syntax --- dbms/src/Interpreters/InterpreterSystemQuery.cpp | 4 ++++ dbms/src/Parsers/ASTSystemQuery.cpp | 5 +++-- dbms/src/Parsers/ParserSystemQuery.cpp | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterSystemQuery.cpp b/dbms/src/Interpreters/InterpreterSystemQuery.cpp index 28bf7b08cc6..272b38c86ba 100644 --- a/dbms/src/Interpreters/InterpreterSystemQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSystemQuery.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -130,6 +131,9 @@ BlockIO InterpreterSystemQuery::execute() { auto & query = query_ptr->as(); + if (!query.cluster.empty()) + return executeDDLQueryOnCluster(query_ptr, context, {query.database}); + using Type = ASTSystemQuery::Type; /// Use global context with fresh system profile settings diff --git a/dbms/src/Parsers/ASTSystemQuery.cpp b/dbms/src/Parsers/ASTSystemQuery.cpp index 0d096bb805f..578d151967c 100644 --- a/dbms/src/Parsers/ASTSystemQuery.cpp +++ b/dbms/src/Parsers/ASTSystemQuery.cpp @@ -108,8 +108,7 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, }; if (!cluster.empty()) - { - } + formatOnCluster(settings); if ( type == Type::STOP_MERGES || type == Type::START_MERGES || type == Type::STOP_TTL_MERGES @@ -133,7 +132,9 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, print_database_table(); } else if (type == Type::RELOAD_DICTIONARY) + { settings.ostr << " " << backQuoteIfNeed(target_dictionary); + } } diff --git a/dbms/src/Parsers/ParserSystemQuery.cpp b/dbms/src/Parsers/ParserSystemQuery.cpp index b1047be6bfc..a56c576aa96 100644 --- a/dbms/src/Parsers/ParserSystemQuery.cpp +++ b/dbms/src/Parsers/ParserSystemQuery.cpp @@ -38,14 +38,17 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & if (!found) return false; + + String cluster_str; switch (res->type) { case Type::RELOAD_DICTIONARY: if (ParserKeyword{"ON"}.ignore(pos, expected)) { - if (!ASTQueryWithOnCluster::parse(pos, res->cluster, expected)) + if (!ASTQueryWithOnCluster::parse(pos, cluster_str, expected)) return false; } + res->cluster = cluster_str; if (!parseIdentifierOrStringLiteral(pos, expected, res->target_dictionary)) return false; break; From 1f5a11b384c0d3106e8d90545997cacde16d53e8 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Thu, 19 Dec 2019 09:01:57 +0100 Subject: [PATCH 3/7] Add test for ON CLUSTER on RELOAD DICTIONARY command --- dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py b/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py index 31ee90de472..d77ab2b842a 100644 --- a/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py +++ b/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py @@ -43,6 +43,9 @@ def test_dictionary_ddl_on_cluster(started_cluster): assert node.query("SELECT count() from sometbl") == "1\n" assert node.query("SELECT dictGetString('default.somedict', 'value', toUInt64({}))".format(num)) == node.name + '\n' + instance = started_cluster.instances['ch1'] + started_cluster.ddl_check_query(instance, "SYSTEM RELOAD DICTIONARY ON CLUSTER 'cluster' default.somedict") + ch1.query("DETACH DICTIONARY default.somedict ON CLUSTER 'cluster'") for node in [ch1, ch2, ch3, ch4]: From d5d8fd7004f461b1f15f8a78258b6b0e22798b71 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Thu, 19 Dec 2019 10:27:12 +0100 Subject: [PATCH 4/7] refactor target_table to table for better hemogny --- dbms/src/Interpreters/InterpreterSystemQuery.cpp | 16 ++++++++-------- dbms/src/Parsers/ASTSystemQuery.cpp | 4 ++-- dbms/src/Parsers/ASTSystemQuery.h | 2 +- dbms/src/Parsers/ParserSystemQuery.cpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterSystemQuery.cpp b/dbms/src/Interpreters/InterpreterSystemQuery.cpp index 272b38c86ba..d346ddd04df 100644 --- a/dbms/src/Interpreters/InterpreterSystemQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSystemQuery.cpp @@ -101,14 +101,14 @@ void startStopAction(Context & context, ASTSystemQuery & query, StorageActionBlo auto manager = context.getActionLocksManager(); manager->cleanExpired(); - if (!query.target_table.empty()) + if (!query.table.empty()) { String database = !query.database.empty() ? query.database : context.getCurrentDatabase(); if (start) - manager->remove(database, query.target_table, action_type); + manager->remove(database, query.table, action_type); else - manager->add(database, query.target_table, action_type); + manager->add(database, query.table, action_type); } else { @@ -141,7 +141,7 @@ BlockIO InterpreterSystemQuery::execute() system_context.setSetting("profile", context.getSystemProfileName()); /// Make canonical query for simpler processing - if (!query.target_table.empty() && query.database.empty()) + if (!query.table.empty() && query.database.empty()) query.database = context.getCurrentDatabase(); switch (query.type) @@ -237,8 +237,8 @@ BlockIO InterpreterSystemQuery::execute() restartReplicas(system_context); break; case Type::RESTART_REPLICA: - if (!tryRestartReplica(query.database, query.target_table, system_context)) - throw Exception("There is no " + query.database + "." + query.target_table + " replicated table", + if (!tryRestartReplica(query.database, query.table, system_context)) + throw Exception("There is no " + query.database + "." + query.table + " replicated table", ErrorCodes::BAD_ARGUMENTS); break; case Type::FLUSH_LOGS: @@ -340,7 +340,7 @@ void InterpreterSystemQuery::restartReplicas(Context & system_context) void InterpreterSystemQuery::syncReplica(ASTSystemQuery & query) { String database_name = !query.database.empty() ? query.database : context.getCurrentDatabase(); - const String & table_name = query.target_table; + const String & table_name = query.table; StoragePtr table = context.getTable(database_name, table_name); @@ -363,7 +363,7 @@ void InterpreterSystemQuery::syncReplica(ASTSystemQuery & query) void InterpreterSystemQuery::flushDistributed(ASTSystemQuery & query) { String database_name = !query.database.empty() ? query.database : context.getCurrentDatabase(); - String & table_name = query.target_table; + String & table_name = query.table; if (auto storage_distributed = dynamic_cast(context.getTable(database_name, table_name).get())) storage_distributed->flushClusterNodesAllData(); diff --git a/dbms/src/Parsers/ASTSystemQuery.cpp b/dbms/src/Parsers/ASTSystemQuery.cpp index 578d151967c..d1c10b8cfd7 100644 --- a/dbms/src/Parsers/ASTSystemQuery.cpp +++ b/dbms/src/Parsers/ASTSystemQuery.cpp @@ -103,7 +103,7 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, << (settings.hilite ? hilite_none : "") << "."; } - settings.ostr << (settings.hilite ? hilite_identifier : "") << backQuoteIfNeed(target_table) + settings.ostr << (settings.hilite ? hilite_identifier : "") << backQuoteIfNeed(table) << (settings.hilite ? hilite_none : ""); }; @@ -124,7 +124,7 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, || type == Type::STOP_DISTRIBUTED_SENDS || type == Type::START_DISTRIBUTED_SENDS) { - if (!target_table.empty()) + if (!table.empty()) print_database_table(); } else if (type == Type::RESTART_REPLICA || type == Type::SYNC_REPLICA || type == Type::FLUSH_DISTRIBUTED) diff --git a/dbms/src/Parsers/ASTSystemQuery.h b/dbms/src/Parsers/ASTSystemQuery.h index fa2ee1b0a51..f5b9afde4b3 100644 --- a/dbms/src/Parsers/ASTSystemQuery.h +++ b/dbms/src/Parsers/ASTSystemQuery.h @@ -57,7 +57,7 @@ public: String target_dictionary; String database; - String target_table; + String table; String getID(char) const override { return "SYSTEM query"; } diff --git a/dbms/src/Parsers/ParserSystemQuery.cpp b/dbms/src/Parsers/ParserSystemQuery.cpp index a56c576aa96..5bfc1713585 100644 --- a/dbms/src/Parsers/ParserSystemQuery.cpp +++ b/dbms/src/Parsers/ParserSystemQuery.cpp @@ -56,7 +56,7 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & case Type::RESTART_REPLICA: case Type::SYNC_REPLICA: case Type::FLUSH_DISTRIBUTED: - if (!parseDatabaseAndTableName(pos, expected, res->database, res->target_table)) + if (!parseDatabaseAndTableName(pos, expected, res->database, res->table)) return false; break; @@ -74,7 +74,7 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & case Type::START_REPLICATION_QUEUES: case Type::STOP_DISTRIBUTED_SENDS: case Type::START_DISTRIBUTED_SENDS: - parseDatabaseAndTableName(pos, expected, res->database, res->target_table); + parseDatabaseAndTableName(pos, expected, res->database, res->table); break; default: From abbbf3e72670ba2f578de3d89c92e0eaa7f3456d Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Thu, 19 Dec 2019 10:29:13 +0100 Subject: [PATCH 5/7] cosmetic --- dbms/src/Parsers/ASTSystemQuery.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/dbms/src/Parsers/ASTSystemQuery.cpp b/dbms/src/Parsers/ASTSystemQuery.cpp index d1c10b8cfd7..1e542305f00 100644 --- a/dbms/src/Parsers/ASTSystemQuery.cpp +++ b/dbms/src/Parsers/ASTSystemQuery.cpp @@ -132,9 +132,7 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, print_database_table(); } else if (type == Type::RELOAD_DICTIONARY) - { settings.ostr << " " << backQuoteIfNeed(target_dictionary); - } } From 2977289b57bb446bf112e65e26ba2a2b9d3f6a73 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Fri, 20 Dec 2019 04:30:51 +0100 Subject: [PATCH 6/7] update test --- .../test_dictionary_ddl_on_cluster/test.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py b/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py index d77ab2b842a..4296b497d15 100644 --- a/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py +++ b/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py @@ -1,3 +1,4 @@ +import time import pytest from helpers.cluster import ClickHouseCluster from helpers.client import QueryRuntimeException @@ -43,9 +44,6 @@ def test_dictionary_ddl_on_cluster(started_cluster): assert node.query("SELECT count() from sometbl") == "1\n" assert node.query("SELECT dictGetString('default.somedict', 'value', toUInt64({}))".format(num)) == node.name + '\n' - instance = started_cluster.instances['ch1'] - started_cluster.ddl_check_query(instance, "SYSTEM RELOAD DICTIONARY ON CLUSTER 'cluster' default.somedict") - ch1.query("DETACH DICTIONARY default.somedict ON CLUSTER 'cluster'") for node in [ch1, ch2, ch3, ch4]: @@ -58,6 +56,16 @@ def test_dictionary_ddl_on_cluster(started_cluster): assert node.query("SELECT count() from sometbl") == "1\n" assert node.query("SELECT dictGetString('default.somedict', 'value', toUInt64({}))".format(num)) == node.name + '\n' + + for num, node in enumerate([ch1, ch2, ch3, ch4]): + node.query("ALTER TABLE sometbl UPDATE value = 'new_key' WHERE 1") + + ch1.query("SYSTEM RELOAD DICTIONARY ON CLUSTER 'cluster' `default.somedict`") + time.sleep(2) # SYSTEN RELOAD is a asynchronous query + + for num, node in enumerate([ch1, ch2, ch3, ch4]): + assert node.query("SELECT dictGetString('default.somedict', 'value', toUInt64({}))".format(num)) == 'new_key' + '\n' + ch1.query("DROP DICTIONARY default.somedict ON CLUSTER 'cluster'") for node in [ch1, ch2, ch3, ch4]: From 483d6287eb11bcf4f1fd92a4495b8e204df90b96 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Mon, 23 Dec 2019 04:48:34 +0100 Subject: [PATCH 7/7] cosmetic --- dbms/src/Interpreters/InterpreterSystemQuery.cpp | 4 ++-- dbms/src/Parsers/ASTSystemQuery.cpp | 4 ++-- dbms/src/Parsers/ParserSystemQuery.cpp | 5 ++--- .../tests/integration/test_dictionary_ddl_on_cluster/test.py | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterSystemQuery.cpp b/dbms/src/Interpreters/InterpreterSystemQuery.cpp index 60667f76439..da1d5c9385a 100644 --- a/dbms/src/Interpreters/InterpreterSystemQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSystemQuery.cpp @@ -144,8 +144,8 @@ BlockIO InterpreterSystemQuery::execute() if (!query.table.empty() && query.database.empty()) query.database = context.getCurrentDatabase(); - if (!query.target_dictionary.empty() && !query.target_database.empty()) - query.target_dictionary = query.target_database + "." + query.target_dictionary; + if (!query.target_dictionary.empty() && !query.database.empty()) + query.target_dictionary = query.database + "." + query.target_dictionary; switch (query.type) { diff --git a/dbms/src/Parsers/ASTSystemQuery.cpp b/dbms/src/Parsers/ASTSystemQuery.cpp index c2963d1e40b..41969f3fc63 100644 --- a/dbms/src/Parsers/ASTSystemQuery.cpp +++ b/dbms/src/Parsers/ASTSystemQuery.cpp @@ -116,10 +116,10 @@ void ASTSystemQuery::formatImpl(const FormatSettings & settings, FormatState &, settings.ostr << (settings.hilite ? hilite_identifier : "") << backQuoteIfNeed(target_dictionary) << (settings.hilite ? hilite_none : ""); }; - + if (!cluster.empty()) formatOnCluster(settings); - + if ( type == Type::STOP_MERGES || type == Type::START_MERGES || type == Type::STOP_TTL_MERGES diff --git a/dbms/src/Parsers/ParserSystemQuery.cpp b/dbms/src/Parsers/ParserSystemQuery.cpp index 6cb848e3690..0c93faa86a0 100644 --- a/dbms/src/Parsers/ParserSystemQuery.cpp +++ b/dbms/src/Parsers/ParserSystemQuery.cpp @@ -39,12 +39,11 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & if (!found) return false; - - String cluster_str; switch (res->type) { case Type::RELOAD_DICTIONARY: { + String cluster_str; if (ParserKeyword{"ON"}.ignore(pos, expected)) { if (!ASTQueryWithOnCluster::parse(pos, cluster_str, expected)) @@ -54,7 +53,7 @@ bool ParserSystemQuery::parseImpl(IParser::Pos & pos, ASTPtr & node, Expected & ASTPtr ast; if (ParserStringLiteral{}.parse(pos, ast, expected)) res->target_dictionary = ast->as().value.safeGet(); - else if (!parseDatabaseAndTableName(pos, expected, res->target_database, res->target_dictionary)) + else if (!parseDatabaseAndTableName(pos, expected, res->database, res->target_dictionary)) return false; break; } diff --git a/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py b/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py index 4296b497d15..76cdfb458ee 100644 --- a/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py +++ b/dbms/tests/integration/test_dictionary_ddl_on_cluster/test.py @@ -61,7 +61,7 @@ def test_dictionary_ddl_on_cluster(started_cluster): node.query("ALTER TABLE sometbl UPDATE value = 'new_key' WHERE 1") ch1.query("SYSTEM RELOAD DICTIONARY ON CLUSTER 'cluster' `default.somedict`") - time.sleep(2) # SYSTEN RELOAD is a asynchronous query + time.sleep(2) # SYSTEM RELOAD DICTIONARY is an asynchronous query for num, node in enumerate([ch1, ch2, ch3, ch4]): assert node.query("SELECT dictGetString('default.somedict', 'value', toUInt64({}))".format(num)) == 'new_key' + '\n'