From 6bc38df736526b5fc5a1052cc95844ef513d656e Mon Sep 17 00:00:00 2001 From: kssenii Date: Mon, 25 Sep 2023 23:25:42 +0200 Subject: [PATCH 1/9] Increase log level --- tests/config/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/config/install.sh b/tests/config/install.sh index b65f2cc8dd1..ce00ced6b2a 100755 --- a/tests/config/install.sh +++ b/tests/config/install.sh @@ -41,7 +41,7 @@ ln -sf $SRC_PATH/config.d/transactions.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/encryption.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/CORS.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/zookeeper_log.xml $DEST_SERVER_PATH/config.d/ -ln -sf $SRC_PATH/config.d/logger_trace.xml $DEST_SERVER_PATH/config.d/ +ln -sf $SRC_PATH/config.d/logger_test.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/named_collection.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/ssl_certs.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/filesystem_cache_log.xml $DEST_SERVER_PATH/config.d/ From 7317ff368462667a552f0ba706fb7528f4cdc59c Mon Sep 17 00:00:00 2001 From: kssenii Date: Tue, 26 Sep 2023 12:56:47 +0200 Subject: [PATCH 2/9] Fxi --- src/Interpreters/Cache/FileCache.cpp | 2 ++ src/Interpreters/Cache/FileCache.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Interpreters/Cache/FileCache.cpp b/src/Interpreters/Cache/FileCache.cpp index 01ee788cc74..f7c891afe02 100644 --- a/src/Interpreters/Cache/FileCache.cpp +++ b/src/Interpreters/Cache/FileCache.cpp @@ -123,6 +123,8 @@ void FileCache::initialize() { fs::create_directories(getBasePath()); } + + status_file = make_unique(fs::path(getBasePath()) / "status", StatusFile::write_full_info); } catch (...) { diff --git a/src/Interpreters/Cache/FileCache.h b/src/Interpreters/Cache/FileCache.h index 108f53cf2cc..b5c2fa28f4b 100644 --- a/src/Interpreters/Cache/FileCache.h +++ b/src/Interpreters/Cache/FileCache.h @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -166,6 +167,7 @@ private: std::exception_ptr init_exception; std::atomic is_initialized = false; mutable std::mutex init_mutex; + std::unique_ptr status_file; CacheMetadata metadata; From 8cd745ae462da7b3f40e744a24fca067c9599dfc Mon Sep 17 00:00:00 2001 From: kssenii Date: Tue, 26 Sep 2023 16:07:29 +0200 Subject: [PATCH 3/9] Fxi --- .../0_stateless/02842_filesystem_cache_validate_path.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/02842_filesystem_cache_validate_path.sql b/tests/queries/0_stateless/02842_filesystem_cache_validate_path.sql index c8fb776ac5f..03079c063dd 100644 --- a/tests/queries/0_stateless/02842_filesystem_cache_validate_path.sql +++ b/tests/queries/0_stateless/02842_filesystem_cache_validate_path.sql @@ -41,5 +41,5 @@ ENGINE = MergeTree() ORDER BY tuple() SETTINGS disk = disk(type = cache, max_size = '1Mi', - path = 'kek', + path = 'kek2', disk = 'local_disk'); From 1f13e3ac922b69294ae7b005ee5d6275e067f0a9 Mon Sep 17 00:00:00 2001 From: kssenii Date: Wed, 27 Sep 2023 11:35:03 +0200 Subject: [PATCH 4/9] Fix database replicated tests using the same paths for filesystem cache --- docker/test/stateless/run.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/test/stateless/run.sh b/docker/test/stateless/run.sh index 74ff536b98e..6f6cb52b023 100755 --- a/docker/test/stateless/run.sh +++ b/docker/test/stateless/run.sh @@ -69,6 +69,16 @@ else fi if [[ -n "$USE_DATABASE_REPLICATED" ]] && [[ "$USE_DATABASE_REPLICATED" -eq 1 ]]; then + sudo cat /etc/clickhouse-server1/config.d/filesystem_caches_path.xml \ + | sed "s|/var/lib/clickhouse/filesystem_caches/|/var/lib/clickhouse/filesystem_caches_1/|" \ + > /etc/clickhouse-server1/config.d/filesystem_caches_path.xml.tmp + mv /etc/clickhouse-server1/config.d/filesystem_caches_path.xml.tmp /etc/clickhouse-server1/config.d/filesystem_caches_path.xml + + sudo cat /etc/clickhouse-server2/config.d/filesystem_caches_path.xml \ + | sed "s|/var/lib/clickhouse/filesystem_caches/|/var/lib/clickhouse/filesystem_caches_1/|" \ + > /etc/clickhouse-server2/config.d/filesystem_caches_path.xml.tmp + mv /etc/clickhouse-server2/config.d/filesystem_caches_path.xml.tmp /etc/clickhouse-server2/config.d/filesystem_caches_path.xml + mkdir -p /var/run/clickhouse-server1 sudo chown clickhouse:clickhouse /var/run/clickhouse-server1 sudo -E -u clickhouse /usr/bin/clickhouse server --config /etc/clickhouse-server1/config.xml --daemon \ From 6d7285a825dd558f4422c5ad20c1d52bf8de1449 Mon Sep 17 00:00:00 2001 From: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:44:32 +0200 Subject: [PATCH 5/9] Return log level back --- tests/config/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/config/install.sh b/tests/config/install.sh index ce00ced6b2a..b65f2cc8dd1 100755 --- a/tests/config/install.sh +++ b/tests/config/install.sh @@ -41,7 +41,7 @@ ln -sf $SRC_PATH/config.d/transactions.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/encryption.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/CORS.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/zookeeper_log.xml $DEST_SERVER_PATH/config.d/ -ln -sf $SRC_PATH/config.d/logger_test.xml $DEST_SERVER_PATH/config.d/ +ln -sf $SRC_PATH/config.d/logger_trace.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/named_collection.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/ssl_certs.xml $DEST_SERVER_PATH/config.d/ ln -sf $SRC_PATH/config.d/filesystem_cache_log.xml $DEST_SERVER_PATH/config.d/ From f5cc191cce55df6af2f32544ed94d15cefd87a11 Mon Sep 17 00:00:00 2001 From: Kseniia Sumarokova <54203879+kssenii@users.noreply.github.com> Date: Thu, 28 Sep 2023 01:05:35 +0200 Subject: [PATCH 6/9] Update run.sh --- docker/test/stateless/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test/stateless/run.sh b/docker/test/stateless/run.sh index 6f6cb52b023..34fc12d1a72 100755 --- a/docker/test/stateless/run.sh +++ b/docker/test/stateless/run.sh @@ -75,7 +75,7 @@ if [[ -n "$USE_DATABASE_REPLICATED" ]] && [[ "$USE_DATABASE_REPLICATED" -eq 1 ]] mv /etc/clickhouse-server1/config.d/filesystem_caches_path.xml.tmp /etc/clickhouse-server1/config.d/filesystem_caches_path.xml sudo cat /etc/clickhouse-server2/config.d/filesystem_caches_path.xml \ - | sed "s|/var/lib/clickhouse/filesystem_caches/|/var/lib/clickhouse/filesystem_caches_1/|" \ + | sed "s|/var/lib/clickhouse/filesystem_caches/|/var/lib/clickhouse/filesystem_caches_2/|" \ > /etc/clickhouse-server2/config.d/filesystem_caches_path.xml.tmp mv /etc/clickhouse-server2/config.d/filesystem_caches_path.xml.tmp /etc/clickhouse-server2/config.d/filesystem_caches_path.xml From f8e1de1850a00b5271c91041a1ca537d43b69d57 Mon Sep 17 00:00:00 2001 From: kssenii Date: Thu, 28 Sep 2023 12:26:09 +0200 Subject: [PATCH 7/9] Fxu --- .../02240_filesystem_cache_bypass_cache_threshold.reference | 2 +- .../02240_filesystem_cache_bypass_cache_threshold.sql | 2 +- .../queries/0_stateless/02240_filesystem_query_cache.reference | 2 +- tests/queries/0_stateless/02240_filesystem_query_cache.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/queries/0_stateless/02240_filesystem_cache_bypass_cache_threshold.reference b/tests/queries/0_stateless/02240_filesystem_cache_bypass_cache_threshold.reference index 6b79d7bfcab..318ce749f8b 100644 --- a/tests/queries/0_stateless/02240_filesystem_cache_bypass_cache_threshold.reference +++ b/tests/queries/0_stateless/02240_filesystem_cache_bypass_cache_threshold.reference @@ -12,7 +12,7 @@ SETTINGS min_bytes_for_wide_part = 10485760, disk = disk( type = cache, max_size = '128Mi', - path = '${CLICKHOUSE_TEST_UNIQUE_NAME}_cache', + path = 'filesystem_cache_bypass_cache_threshold/', enable_bypass_cache_with_threshold = 1, bypass_cache_threshold = 100, delayed_cleanup_interval_ms = 100, diff --git a/tests/queries/0_stateless/02240_filesystem_cache_bypass_cache_threshold.sql b/tests/queries/0_stateless/02240_filesystem_cache_bypass_cache_threshold.sql index 094ef5414ba..ee92931ec54 100644 --- a/tests/queries/0_stateless/02240_filesystem_cache_bypass_cache_threshold.sql +++ b/tests/queries/0_stateless/02240_filesystem_cache_bypass_cache_threshold.sql @@ -15,7 +15,7 @@ SETTINGS min_bytes_for_wide_part = 10485760, disk = disk( type = cache, max_size = '128Mi', - path = '${CLICKHOUSE_TEST_UNIQUE_NAME}_cache', + path = 'filesystem_cache_bypass_cache_threshold/', enable_bypass_cache_with_threshold = 1, bypass_cache_threshold = 100, delayed_cleanup_interval_ms = 100, diff --git a/tests/queries/0_stateless/02240_filesystem_query_cache.reference b/tests/queries/0_stateless/02240_filesystem_query_cache.reference index b06ab436dd8..a8e80bb7ec5 100644 --- a/tests/queries/0_stateless/02240_filesystem_query_cache.reference +++ b/tests/queries/0_stateless/02240_filesystem_query_cache.reference @@ -14,7 +14,7 @@ SETTINGS min_bytes_for_wide_part = 10485760, disk = disk( type = cache, max_size = '128Mi', - path = '${CLICKHOUSE_TEST_UNIQUE_NAME}_cache', + path = 'filesystem_query_cache/', cache_on_write_operations= 1, enable_filesystem_query_cache_limit = 1, delayed_cleanup_interval_ms = 100, diff --git a/tests/queries/0_stateless/02240_filesystem_query_cache.sql b/tests/queries/0_stateless/02240_filesystem_query_cache.sql index b1a64cb47cf..a609702f22a 100644 --- a/tests/queries/0_stateless/02240_filesystem_query_cache.sql +++ b/tests/queries/0_stateless/02240_filesystem_query_cache.sql @@ -17,7 +17,7 @@ SETTINGS min_bytes_for_wide_part = 10485760, disk = disk( type = cache, max_size = '128Mi', - path = '${CLICKHOUSE_TEST_UNIQUE_NAME}_cache', + path = 'filesystem_query_cache/', cache_on_write_operations= 1, enable_filesystem_query_cache_limit = 1, delayed_cleanup_interval_ms = 100, From b62848beddcf7e636deed472c5f6059d7075784c Mon Sep 17 00:00:00 2001 From: kssenii Date: Thu, 28 Sep 2023 16:28:57 +0200 Subject: [PATCH 8/9] Fxi --- .../0_stateless/02842_filesystem_cache_validate_path.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/queries/0_stateless/02842_filesystem_cache_validate_path.sql b/tests/queries/0_stateless/02842_filesystem_cache_validate_path.sql index 03079c063dd..c33a5cf65b0 100644 --- a/tests/queries/0_stateless/02842_filesystem_cache_validate_path.sql +++ b/tests/queries/0_stateless/02842_filesystem_cache_validate_path.sql @@ -1,4 +1,4 @@ --- Tags: no-fasttest +-- Tags: no-fasttest, no-replicated-database DROP TABLE IF EXISTS test; DROP TABLE IF EXISTS test_1; From 6c10cb484c732c76224aeff2ba63f01e235a5eab Mon Sep 17 00:00:00 2001 From: kssenii Date: Fri, 29 Sep 2023 11:11:51 +0200 Subject: [PATCH 9/9] Ping CI