Skip to content

Conversation

@ianton-ru
Copy link

@ianton-ru ianton-ru commented Nov 10, 2025

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix SYSTEM DROP FILESYSTEM CACHE ON CLUSTER

Documentation entry for user-facing changes

Parser expects query

SYSTEM DROP FILESYSTEM CACHE 'cache_name' ON CLUSTER `cluster_name`

but in DDL cluster name is at end:

SYSTEM DROP FILESYSTEM CACHE ON CLUSTER `cluster_name` 'cache_name'

and query failed with error

clickhouse1 :) SYSTEM DROP FILESYSTEM CACHE 'cache' ON CLUSTER `clickhouse-cluster`

SYSTEM DROP FILESYSTEM CACHE ON CLUSTER `clickhouse-cluster` 'cache'

Query id: 48c41c7b-bb81-4b9e-a49a-fcd8b5a537cb

Row 1:
──────
host:                clickhouse2
port:                9000
status:              62
error:               Code: 62. DB::Exception: Syntax error: failed at position 62 ('cache'): 'cache'. Expected one of: ParallelWithClause, PARALLEL WITH, end of query. (SYNTAX_ERROR) (version 25.8.10.7 (official build))
num_hosts_remaining: 2
num_hosts_active:    0

Row 2:
──────
host:                clickhouse1
port:                9000
status:              62
error:               Code: 62. DB::Exception: Syntax error: failed at position 62 ('cache'): 'cache'. Expected one of: ParallelWithClause, PARALLEL WITH, end of query. (SYNTAX_ERROR) (version 25.8.10.7 (official build))
num_hosts_remaining: 1
num_hosts_active:    0

Row 3:
──────
host:                clickhouse3
port:                9000
status:              62
error:               Code: 62. DB::Exception: Syntax error: failed at position 62 ('cache'): 'cache'. Expected one of: ParallelWithClause, PARALLEL WITH, end of query. (SYNTAX_ERROR) (version 25.8.10.7 (official build))
num_hosts_remaining: 0
num_hosts_active:    0

3 rows in set. Elapsed: 0.099 sec.

Received exception from server (version 25.8.10):
Code: 62. DB::Exception: Received from localhost:9000. DB::Exception: There was an error on [clickhouse2:9000]: Code: 62. DB::Exception: Syntax error: failed at position 62 ('cache'): 'cache'. Expected one of: ParallelWithClause, PARALLEL WITH, end of query. (SYNTAX_ERROR) (version 25.8.10.7 (official build)). (SYNTAX_ERROR)

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • Tiered Storage (2h)

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Workflow [PR], commit [aebebf5]

@ianton-ru ianton-ru changed the title Fix system drop filesystem cache on cluster [WIP] Fix system drop filesystem cache on cluster Nov 10, 2025
@ianton-ru ianton-ru changed the title [WIP] Fix system drop filesystem cache on cluster [WIP] Fix SYSTEM DROP FILESYSTEM CACHE ON CLUSTER Nov 10, 2025
@ianton-ru ianton-ru force-pushed the bugfix/antalya-25.8/system_drop_filesystem_cache_on_cluster branch from 0b16f06 to 7061fbc Compare November 10, 2025 14:14
@ianton-ru ianton-ru changed the title [WIP] Fix SYSTEM DROP FILESYSTEM CACHE ON CLUSTER Fix SYSTEM DROP FILESYSTEM CACHE ON CLUSTER Nov 11, 2025
INSERT INTO test SELECT 1, 'test';
"""

$CLICKHOUSE_CLIENT --query """
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The 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.
Thanks!

Copy link
Collaborator

@mkmkme mkmkme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

print_keyword(typeToString(type));
if (!cluster.empty())

std::unordered_set<Type> queries_with_on_cluster_at_end = {
Copy link
Collaborator

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.

@Enmk Enmk merged commit b61dbc0 into antalya-25.8 Nov 13, 2025
136 of 139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants