From 3fcd892a3629e2621a64989461b6d26431fd5773 Mon Sep 17 00:00:00 2001 From: Ilya Golshtein Date: Sun, 17 Nov 2024 15:41:51 +0300 Subject: [PATCH] mv_dependencies: test passed --- src/Storages/StorageMaterializedView.cpp | 5 +++-- tests/integration/test_async_load_databases/test.py | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Storages/StorageMaterializedView.cpp b/src/Storages/StorageMaterializedView.cpp index d4049d2f388..792c7baab0e 100644 --- a/src/Storages/StorageMaterializedView.cpp +++ b/src/Storages/StorageMaterializedView.cpp @@ -53,6 +53,7 @@ namespace Setting namespace ServerSetting { extern const ServerSettingsUInt64 max_materialized_views_count_for_table; + extern const ServerSettingsUInt64 startup_mv_delay_ms; } namespace RefreshSetting @@ -749,7 +750,7 @@ void StorageMaterializedView::renameInMemory(const StorageID & new_table_id) void StorageMaterializedView::pushDependencies() { - assert(!dependencies_are_tracked); + // assert(!dependencies_are_tracked); if (!dependencies_are_tracked) { auto metadata_snapshot = getInMemoryMetadataPtr(); @@ -762,7 +763,7 @@ void StorageMaterializedView::pushDependencies() void StorageMaterializedView::startup() { - if (const auto configured_delay_ms = getContext()->getServerSettings().startup_mv_delay_ms; configured_delay_ms) + if (const auto configured_delay_ms = getContext()->getServerSettings()[ServerSetting::startup_mv_delay_ms]; configured_delay_ms) { std::random_device rd; const auto delay_ms = std::uniform_int_distribution<>(0, 1)(rd) ? configured_delay_ms : 0UL; diff --git a/tests/integration/test_async_load_databases/test.py b/tests/integration/test_async_load_databases/test.py index 9701747cf4a..03adfd5e9ea 100644 --- a/tests/integration/test_async_load_databases/test.py +++ b/tests/integration/test_async_load_databases/test.py @@ -198,7 +198,6 @@ def test_multiple_tables(started_cluster): query(f"drop table test.table_{i} sync") -<<<<<<< HEAD def test_async_load_system_database(started_cluster): id = 1 for i in range(4): @@ -243,9 +242,10 @@ def test_async_load_system_database(started_cluster): for i in range(id - 1): node2.query(f"drop table if exists system.text_log_{i + 1}_test") node2.query(f"drop table if exists system.query_log_{i + 1}_test") -======= + + def test_materialzed_views(started_cluster): - query = instance.query + query = node1.query query("create database test_mv") query("create table test_mv.t (Id UInt64) engine=MergeTree order by Id") query("create table test_mv.a (Id UInt64) engine=MergeTree order by Id") @@ -253,15 +253,14 @@ def test_materialzed_views(started_cluster): query("create materialized view t_to_a to test_mv.a as select Id from test_mv.t") query("create materialized view t_to_z to test_mv.z as select Id from test_mv.t") - instance.restart_clickhouse() + node1.restart_clickhouse() query("insert into test_mv.t values(42)") assert query("select * from test_mv.a Format CSV") == "42\n" assert query("select * from test_mv.z Format CSV") == "42\n" - query("drop materialized view t_to_a") - query("drop materialized view t_to_z") + query("drop view t_to_a") + query("drop view t_to_z") query("drop table test_mv.t") query("drop table test_mv.a") query("drop table test_mv.z") query("drop database test_mv") ->>>>>>> 4d4a53cc440 (mv_dependencies: initial)