Merge pull request #63035 from aalexfvk/fix_flaky_test_03000_traverse_shadow_system_data_paths

Fix flaky test 03000_traverse_shadow_system_data_paths
This commit is contained in:
Alexey Milovidov 2024-04-27 01:04:30 +00:00 committed by GitHub
commit 52f58f2fff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 30 deletions

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
# Tags: no-fasttest
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
TABLE="03000_traverse_shadow_system_data_path_table"
BACKUP="03000_traverse_shadow_system_data_path_backup"
${CLICKHOUSE_CLIENT} --query="CREATE TABLE ${TABLE} (
id Int64,
data String
) ENGINE=MergeTree()
ORDER BY id
SETTINGS storage_policy='s3_cache';"
${CLICKHOUSE_CLIENT} --query="INSERT INTO ${TABLE} VALUES (0, 'data');"
${CLICKHOUSE_CLIENT} --query "SELECT count() > 0 FROM system.remote_data_paths WHERE disk_name = 's3_cache'"
${CLICKHOUSE_CLIENT} --query="ALTER TABLE ${TABLE} FREEZE WITH NAME '${BACKUP}';"
${CLICKHOUSE_CLIENT} --query="DROP TABLE ${TABLE} SYNC;"
${CLICKHOUSE_CLIENT} --query "
SELECT count() > 0
FROM system.remote_data_paths
WHERE disk_name = 's3_cache' AND local_path LIKE '%shadow/${BACKUP}%'
SETTINGS traverse_shadow_remote_data_paths=1;"
${CLICKHOUSE_CLIENT} --query "SYSTEM UNFREEZE WITH NAME '${BACKUP}';" &>/dev/null || true

View File

@ -0,0 +1,20 @@
-- Tags: no-replicated-database, no-fasttest
DROP TABLE IF EXISTS 03000_traverse_shadow_system_data_path_table;
CREATE TABLE 03000_traverse_shadow_system_data_path_table (
id Int64,
data String
) ENGINE=MergeTree()
ORDER BY id
SETTINGS storage_policy='s3_cache';
INSERT INTO 03000_traverse_shadow_system_data_path_table VALUES (0, 'data');
ALTER TABLE 03000_traverse_shadow_system_data_path_table FREEZE WITH NAME '03000_traverse_shadow_system_data_path_table_backup';
SELECT count() > 0
FROM system.remote_data_paths
WHERE disk_name = 's3_cache' AND local_path LIKE '%shadow/03000_traverse_shadow_system_data_path_table_backup%'
SETTINGS traverse_shadow_remote_data_paths=1;
DROP TABLE IF EXISTS 03000_traverse_shadow_system_data_path_table;