-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Allow interactive queries finish in the background #49683
Description
Use case
A user can run an interactive session with long-running INSERT SELECT.
If the session is interrupted, the query is typically canceled (after an exception about connection loss in an attempt to send progress or read a network packet from a user).
But it is sad if the query was running for a long time.
Describe the solution you'd like
If a query is not expected to return any result to the user (such as SELECT) and does not require any data from the user (such as INSERT without SELECT), we can catch exceptions related to a network connection with the user, stop sending the progress packets and waiting for the incoming packets (such as cancellation), and continue normally.
The user can reconnect and then observe the progress in SHOW PROCESSLIST.
Additional context
The current behavior (query termination on connection loss) is also good. The behavior should be controllable by a setting.