Setting Impala Query Cancellation on Shut down
Learn how to configure Impala to cancel running queries before the shut down deadline, ensuring a controlled shut down and preventing resource leaks.
When the graceful shutdown deadline is reached, the Impala Daemon exits immediately, leaving queries unfinished. This can lead to unreleased resources, such as scratch files in remote storage.
To improve this process, a new state has been added to the graceful shut down
procedure. Before reaching the shut down deadline, Impala attempts to cancel any
remaining running queries within a configurable time limit,
shutdown_query_cancel_period_s
.- The default value is 60 seconds.
- If the specified value exceeds 20% of the total shut down deadline, it is automatically capped at that value.
- If this value is set to 0, the shutdown query cancellation state is disabled, and Impala waits directly until the shut down deadline.
How query cancellation works during shut down
- The shut down process is initiated.
- Before the shutdown deadline, Impala enters a query cancellation phase if shut down query cancellation state is enabled.
- Any remaining running queries are canceled within the
shutdown_query_cancel_period_s
duration. - If all queries are successfully canceled within this period, Impala shuts down immediately.
- If queries are still running when the deadline is reached, Impala shuts down with those queries still active.
To configure query cancellation before the shut down deadline, follow these steps:
- Log in to the Cloudera web interface and navigate to the Cloudera Data Warehouse service.
- In the Cloudera Data Warehouse service, click Virtual Warehouses in the left navigation panel.
-
Select the Impala Virtual Warehouse, click options
for the warehouse you want to set the query cancellation before the shut down deadline.
- Click Edit and go to the Configurations tab.
-
To configure shut down query cancellation state for Coordinator.
-
To configure shut down query cancellation state for Coordinator.
- Click Apply Changes and restart Impala.