ClickHouse/tests/queries/0_stateless/02286_drop_filesystem_cache.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
3.4 KiB
Bash
Raw Normal View History

2022-05-30 22:46:21 +00:00
#!/usr/bin/env bash
2024-07-02 12:15:59 +00:00
# Tags: long, no-fasttest, no-parallel, no-object-storage, no-random-settings
2022-05-30 22:46:21 +00:00
# set -x
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
for STORAGE_POLICY in 's3_cache' 'local_cache' 'azure_cache'; do
2022-12-29 20:16:07 +00:00
echo "Using storage policy: $STORAGE_POLICY"
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS test_02286"
2022-05-30 22:46:21 +00:00
$CLICKHOUSE_CLIENT -n --query "CREATE TABLE test_02286 (key UInt32, value String)
2022-12-29 20:16:07 +00:00
Engine=MergeTree()
ORDER BY key
SETTINGS storage_policy='$STORAGE_POLICY', min_bytes_for_wide_part = 10485760"
$CLICKHOUSE_CLIENT --query "SYSTEM STOP MERGES test_02286"
2022-12-29 20:16:07 +00:00
$CLICKHOUSE_CLIENT --query "SYSTEM DROP FILESYSTEM CACHE"
$CLICKHOUSE_CLIENT --query "SELECT count() FROM system.filesystem_cache"
$CLICKHOUSE_CLIENT --enable_filesystem_cache_on_write_operations=0 --query "INSERT INTO test_02286 SELECT number, toString(number) FROM numbers(100)"
$CLICKHOUSE_CLIENT --query "SELECT * FROM test_02286 FORMAT Null"
$CLICKHOUSE_CLIENT --query "SELECT count() FROM system.filesystem_cache"
$CLICKHOUSE_CLIENT --query "SYSTEM DROP FILESYSTEM CACHE"
$CLICKHOUSE_CLIENT --query "SELECT count() FROM system.filesystem_cache"
$CLICKHOUSE_CLIENT --query "SELECT * FROM test_02286 FORMAT Null"
$CLICKHOUSE_CLIENT --query "SELECT count() FROM system.filesystem_cache"
$CLICKHOUSE_CLIENT --multiline --query "SYSTEM DROP FILESYSTEM CACHE 'ff'; --{serverError 36}"
2022-12-29 20:16:07 +00:00
$CLICKHOUSE_CLIENT --query "SELECT count() FROM system.filesystem_cache"
$CLICKHOUSE_CLIENT --query "SELECT * FROM test_02286 FORMAT Null"
$CLICKHOUSE_CLIENT --query "SELECT count() FROM system.filesystem_cache"
$CLICKHOUSE_CLIENT -n --query "SELECT count()
2022-12-29 20:16:07 +00:00
FROM (
SELECT
arrayJoin(cache_paths) AS cache_path,
local_path,
remote_path
FROM
system.remote_data_paths
) AS data_paths
INNER JOIN system.filesystem_cache AS caches
ON data_paths.cache_path = caches.cache_path"
2023-05-03 18:06:46 +00:00
$CLICKHOUSE_CLIENT --query "DROP TABLE test_02286 SYNC"
2022-12-29 20:16:07 +00:00
$CLICKHOUSE_CLIENT --query "SELECT count() FROM system.filesystem_cache"
$CLICKHOUSE_CLIENT --query "SELECT cache_path FROM system.filesystem_cache"
$CLICKHOUSE_CLIENT -n --query "SELECT cache_path, local_path
2022-12-29 20:16:07 +00:00
FROM (
SELECT
arrayJoin(cache_paths) AS cache_path,
local_path,
remote_path
FROM
system.remote_data_paths
) AS data_paths
INNER JOIN system.filesystem_cache AS caches
ON data_paths.cache_path = caches.cache_path"
$CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS test_022862"
2022-05-30 22:46:21 +00:00
done