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

KILL QUERY should work during all phases of a query #7457

Closed
beckettsean opened this issue Oct 13, 2016 · 3 comments · Fixed by #8158
Closed

KILL QUERY should work during all phases of a query #7457

beckettsean opened this issue Oct 13, 2016 · 3 comments · Fixed by #8158

Comments

@beckettsean
Copy link
Contributor

beckettsean commented Oct 13, 2016

Feature Request

Opening a feature request kicks off a discussion.
Requests may be closed if we're not actively planning to work on them.

Proposal:

Make it so queries can be interrupted during the planning phase, not just the execution phase.

Current behavior:

KILL QUERY can't interrupt queries until the query is at the execution phase, actually sampling data from disk. With large datasets, a query like SELECT * FROM /.*/ will spend a long time and a very large amount of RAM just instantiating the query engine iterators. During that phase, KILL QUERY won't interrupt the process and the RAM use will continue to rise.

Desired behavior:

KILL QUERY should terminate the query as quickly as feasible no matter what phase the query is in.

Use case:

Currently there are queries that can't be killed before they OOM the system even if the query is detected and a KILL is issued.

@jsternberg
Copy link
Contributor

This is blocked until #7646 is merged. That PR changes the structure of the query engine enough that any work on this will conflict with that PR.

@jwilder jwilder mentioned this issue Mar 17, 2017
4 tasks
@jwilder jwilder self-assigned this Mar 17, 2017
@jwilder jwilder added this to the 1.3.0 milestone Mar 17, 2017
@hardiksondagar
Copy link

I'm still facing this issue in 1.6x

> show queries
qid  query                                                                                                                                                                              database   duration status
---  -----                                                                                                                                                                              --------   -------- ------
5649 SELECT SensorId, first("2001") AS Value FROM Reading WHERE time >= '2018-09-15 12:15:00' AND time < '2018-09-15 12:30:00' AND SensorId =~ /^17[0-9]{1}[0-9]{2}$/ GROUP BY SensorId smartsense 5m16s    killed
5651 SELECT SensorId, last("2001") AS Value FROM Reading WHERE time >= '2018-09-15 21:30:00' AND time < '2018-09-15 21:45:00' AND SensorId =~ /^17[0-9]{1}[0-9]{2}$/ GROUP BY SensorId  smartsense 5m14s    killed
5652 SELECT SensorId, first("2001") AS Value FROM Reading WHERE time >= '2018-09-15 18:30:00' AND time < '2018-09-15 18:45:00' AND SensorId =~ /^17[0-9]{1}[0-9]{2}$/ GROUP BY SensorId smartsense 5m14s    killed
5712 SHOW QUERIES                                                                                                                                                                                  380µs    running
5647 SELECT SensorId, last("2001") AS Value FROM Reading WHERE time >= '2018-09-15 09:00:00' AND time < '2018-09-15 09:15:00' AND SensorId =~ /^17[0-9]{1}[0-9]{2}$/ GROUP BY SensorId  smartsense 5m19s    killed
5648 SELECT SensorId, first("2001") AS Value FROM Reading WHERE time >= '2018-09-15 06:00:00' AND time < '2018-09-15 06:15:00' AND SensorId =~ /^17[0-9]{1}[0-9]{2}$/ GROUP BY SensorId smartsense 5m19s    killed
5650 SELECT SensorId, last("2001") AS Value FROM Reading WHERE time >= '2018-09-15 15:15:00' AND time < '2018-09-15 15:30:00' AND SensorId =~ /^17[0-9]{1}[0-9]{2}$/ GROUP BY SensorId  smartsense 5m16s    killed
1  [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] Tasks: 58, 210 thr, 106 kthr; 5 running
2  [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] Load average: 4.09 3.34 2.03
3  [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] Uptime: 283 days(!), 22:30:51
4  [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%]
Mem[||||||||||||||||||||||||||||||||||||||||||||||||||||||13.4G/15.7G]
Swp[||                                                     774M/32.0G]

@VadimSelyanik
Copy link

VadimSelyanik commented Dec 17, 2019

Still have this issue in 1.7.0

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

Successfully merging a pull request may close this issue.

6 participants