Skip to content
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

ISSUES-2688 support on cluster for kill & optimize query #2689

Merged
merged 2 commits into from
Jul 24, 2018

Conversation

zhang2014
Copy link
Contributor

@zhang2014 zhang2014 commented Jul 20, 2018

#2688
cc @sundy-li
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

@alexey-milovidov alexey-milovidov merged commit 2f3c02c into ClickHouse:master Jul 24, 2018
@alexey-milovidov
Copy link
Member

Ok, but the purpose remains unclear.

@sundy-li
Copy link
Contributor

sundy-li commented Jul 27, 2018

I think this feature is very useful.
We often face a problem that when a complicate query comes, we want it to be killed right now.
The big query will cause a lot of alarm messages by monitor system (too much IO,CPU usage etc ), we have a shell like

for i in ${hosts[@]};do
	 echo "killing $i"
	  echo "kill query  where elapsed > 320" | $ck --host $i
done

It was less convenient, because we must modify the hosts variable each time we do cluster expansion.

@blinkov
Copy link
Contributor

blinkov commented Jul 27, 2018

@sundy-li doesn't your company have some infrastructure to execute arbitrary command in parallel on a tagged subset of servers via ssh? If it does, than such stuff is easily done just by querying localhost with clickhouse-client or curl.

@alexey-milovidov
Copy link
Member

Thank you! KILL on cluster is indeed useful.

By the way, if you have a distributed query (that generate many queries on cluster nodes), and if you KILL just the initiating query, all generated queries will also be killed.

About OPTIMIZE. In many cases excessive OPTIMIZE (especially with FINAL) may be harmful, because it will initiate huge merge, that can fill a queue for merges and prevent other merges to run. This feature should be used with caution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants