Skip to content

Commit 2567920

Browse files
committed
feat: adapted graceful shutdown docs
1 parent 840eb31 commit 2567920

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

docs/modules/trino/pages/usage-guide/operations/graceful-shutdown.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ spec:
8080
All queries that take less than the minimal graceful shutdown period of all roleGroups (`1` hour as a default) are guaranteed to not be disturbed by regular termination of Pods.
8181
They can obviously still fail when, for example, a Kubernetes node dies or gets rebooted before it is fully drained.
8282

83-
Because of this, the operator automatically restricts the execution time of queries to the minimal graceful shutdown period of all roleGroups using the Trino configuration `query.max-execution-time=3600s`.
83+
Because of this, the operator automatically restricts the execution time of queries to the minimal graceful shutdown period of all roleGroups using the Trino configuration `query.max-execution-time=3600s` when xref:usage-guide/fault-tolerant-execution.adoc[fault tolerant execution] is not configured.
8484
This causes all queries that take longer than 1 hour to fail with the error message `Query failed: Query exceeded the maximum execution time limit of 3600s.00s`.
8585

86-
In case you need to execute queries that take longer than the configured graceful shutdown period, you need to increase the `query.max-execution-time` property as follows:
86+
However, when xref:usage-guide/fault-tolerant-execution.adoc[fault tolerant execution] is enabled, the `query.max-execution-time` restriction is not applied since queries can be automatically retried in case of failures, allowing them to run indefinitely without being cancelled by worker restarts.
87+
88+
In case you need to execute queries that take longer than the configured graceful shutdown period and do not want to configure fault tolerant execution, you can increase the `query.max-execution-time` property as follows:
8789

8890
[source,yaml]
8991
----
@@ -95,8 +97,6 @@ spec:
9597
----
9698

9799
Keep in mind, that queries taking longer than the graceful shutdown period are now subject to failure when a Trino worker gets shut down.
98-
Running into this issue can be circumvented by using https://trino.io/docs/current/admin/fault-tolerant-execution.html[Fault-tolerant execution], which is not supported natively yet.
99-
Until native support is added, you will have to use `configOverrides` to enable it.
100100

101101
== Authorization requirements
102102

rust/operator-binary/src/operations/graceful_shutdown.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,22 @@ pub fn graceful_shutdown_config_properties(
2727
) -> BTreeMap<String, Option<String>> {
2828
match role {
2929
TrinoRole::Coordinator => {
30-
let min_worker_graceful_shutdown_timeout = trino.min_worker_graceful_shutdown_timeout();
31-
// We know that queries taking longer than the minimum gracefulShutdownTimeout are subject to failure.
32-
// Read operator docs for reasoning.
33-
BTreeMap::from([(
34-
"query.max-execution-time".to_string(),
35-
Some(format!(
36-
"{}s",
37-
min_worker_graceful_shutdown_timeout.as_secs()
38-
)),
39-
)])
30+
// Only set query.max-execution-time if fault tolerant execution is not configured.
31+
// With fault tolerant execution enabled, queries can be retried and run indefinitely.
32+
if trino.spec.cluster_config.fault_tolerant_execution.is_none() {
33+
let min_worker_graceful_shutdown_timeout = trino.min_worker_graceful_shutdown_timeout();
34+
// We know that queries taking longer than the minimum gracefulShutdownTimeout are subject to failure.
35+
// Read operator docs for reasoning.
36+
BTreeMap::from([(
37+
"query.max-execution-time".to_string(),
38+
Some(format!(
39+
"{}s",
40+
min_worker_graceful_shutdown_timeout.as_secs()
41+
)),
42+
)])
43+
} else {
44+
BTreeMap::new()
45+
}
4046
}
4147
TrinoRole::Worker => BTreeMap::from([(
4248
"shutdown.grace-period".to_string(),

0 commit comments

Comments
 (0)