-
Notifications
You must be signed in to change notification settings - Fork 9
Fix SYSTEM DROP FILESYSTEM CACHE ON CLUSTER #1130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| localhost 9000 0 0 0 | ||
| localhost 9000 0 0 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/usr/bin/env bash | ||
| # Tags: no-fasttest, no-parallel, no-object-storage, no-random-settings | ||
|
|
||
| # set -x | ||
|
|
||
| CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
| # shellcheck source=../shell_config.sh | ||
| . "$CUR_DIR"/../shell_config.sh | ||
|
|
||
|
|
||
| disk_name="${CLICKHOUSE_TEST_UNIQUE_NAME}" | ||
| $CLICKHOUSE_CLIENT -m --query """ | ||
| DROP TABLE IF EXISTS test; | ||
| CREATE TABLE test (a Int32, b String) | ||
| ENGINE = MergeTree() ORDER BY tuple() | ||
| SETTINGS disk = disk(name = '$disk_name', type = cache, max_size = '100Ki', path = ${CLICKHOUSE_TEST_UNIQUE_NAME}, disk = s3_disk); | ||
| INSERT INTO test SELECT 1, 'test'; | ||
| """ | ||
|
|
||
| $CLICKHOUSE_CLIENT --query """ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Offtopic: Huh TIL this kind of strings is used in shell queries is used in ClickHouse. Three double quotes are not actually supported in bash. Effectively it creates an empty line, then appends a "multi-line" string (in quotes because the newline is replaced with a space), then appends another empty line here. So it's effectively the same as writing $CLICKHOUSE_CLIENT --query "
SYSTEM SYNC FILESYSTEM CACHE '$disk_name' ON CLUSTER 'test_shard_localhost';
"
No need to change anything, though. I can see it's used quite a lot in those tests.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have copied part of code from other test with triple quotas. Try to do not forgive this next time. |
||
| SYSTEM SYNC FILESYSTEM CACHE '$disk_name' ON CLUSTER 'test_shard_localhost'; | ||
| """ | ||
|
|
||
| $CLICKHOUSE_CLIENT --query """ | ||
| SYSTEM DROP FILESYSTEM CACHE '$disk_name' ON CLUSTER 'test_shard_localhost'; | ||
| """ | ||
|
|
||
| $CLICKHOUSE_CLIENT --query """ | ||
| DROP TABLE IF EXISTS test; | ||
| """ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not really matter,
but 'static const' seem reasonable here.