Skip to content

Commit ab2d44d

Browse files
committed
fix: fixed review feedback
1 parent a9e606c commit ab2d44d

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

examples/simple-trino-cluster-fault-tolerant-execution.yaml renamed to docs/modules/trino/examples/usage-guide/fault-tolerant-execution.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# stackablectl operator install commons secret listener trino
2-
# helm install minio minio --repo https://charts.bitnami.com/bitnami --version 15.0.7 --set auth.rootUser=minio-access-key --set auth.rootPassword=minio-secret-key --set tls.enabled=true --set tls.existingSecret=minio-tls-certificates --set provisioning.enabled=true --set provisioning.buckets[0].name=trino-exchange-bucket
31
---
42
apiVersion: trino.stackable.tech/v1alpha1
53
kind: TrinoCluster
@@ -17,7 +15,7 @@ spec:
1715
taskRetryAttemptsPerTask: 4
1816
retryInitialDelay: 10s
1917
retryMaxDelay: 60s
20-
retryDelayScaleFactor: "2.0"
18+
retryDelayScaleFactor: 2.0
2119
exchangeDeduplicationBufferSize: 64MB
2220
exchangeEncryptionEnabled: true
2321
exchangeManager:
@@ -107,3 +105,4 @@ metadata:
107105
spec:
108106
connector:
109107
tpch: {}
108+

docs/modules/trino/pages/usage-guide/fault-tolerant-execution.adoc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ This policy is recommended when executing large batch queries, as the cluster ca
6161

6262
IMPORTANT: A `TASK` retry policy is best suited for long-running queries, but this policy can result in higher latency for short-running queries executed in high volume.
6363
As a best practice, it is recommended to run a dedicated cluster with a `TASK` retry policy for large batch queries, separate from another cluster that handles short queries.
64+
There are tools that can help you achieve this by automatically routing queries based on certain criteria (such as query estimates or user) to different Trino clusters. Notable mentions are link:https://github.com/stackabletech/trino-lb[trino-lb {external-link-icon}^] and link:https://github.com/trinodb/trino-gateway[trino-gateway {external-link-icon}^].
6465

6566
[source,yaml]
6667
----
@@ -273,7 +274,7 @@ spec:
273274
- ReadWriteOnce
274275
resources:
275276
requests:
276-
storage: 10Gi
277+
storage: 50Gi
277278
----
278279

279280
== Connector support
@@ -283,6 +284,17 @@ Take a look at the link:https://trino.io/docs/current/admin/fault-tolerant-execu
283284

284285
When using connectors that do not explicitly support fault-tolerant execution, you may encounter a "This connector does not support query retries" error message.
285286

286-
== Examples
287+
== Example
287288

288-
* link:https://github.com/stackabletech/trino-operator/blob/main/examples/simple-trino-cluster-fault-tolerant-execution.yaml[TrinoCluster with TASK retry policy and S3 exchange manager {external-link-icon}^]
289+
Here's an example of a Trino cluster with fault-tolerant execution enabled using the `TASK` retry policy and MinIO backed S3 as the exchange manager:
290+
291+
[source,bash]
292+
----
293+
stackablectl operator install commons secret listener trino
294+
helm install minio minio --repo https://charts.bitnami.com/bitnami --version 15.0.7 --set auth.rootUser=minio-access-key --set auth.rootPassword=minio-secret-key --set tls.enabled=true --set tls.existingSecret=minio-tls-certificates --set provisioning.enabled=true --set provisioning.buckets[0].name=trino-exchange-bucket
295+
----
296+
297+
[source,yaml]
298+
----
299+
include::example$usage-guide/fault-tolerant-execution.yaml[]
300+
----

rust/operator-binary/src/crd/fault_tolerant_execution.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::{
2525
crd::{CONFIG_DIR_NAME, STACKABLE_CLIENT_TLS_DIR},
2626
};
2727

28-
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
28+
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
2929
#[serde(rename_all = "camelCase")]
3030
pub struct FaultTolerantExecutionConfig {
3131
/// The retry policy for fault tolerant execution.
@@ -58,7 +58,7 @@ pub struct FaultTolerantExecutionConfig {
5858

5959
/// Factor by which retry delay is increased on each query or task failure.
6060
#[serde(skip_serializing_if = "Option::is_none")]
61-
pub retry_delay_scale_factor: Option<String>,
61+
pub retry_delay_scale_factor: Option<f32>,
6262

6363
/// Data size of the coordinator's in-memory buffer used to store output of query stages.
6464
#[serde(skip_serializing_if = "Option::is_none")]
@@ -70,7 +70,7 @@ pub struct FaultTolerantExecutionConfig {
7070
}
7171

7272
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
73-
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
73+
#[serde(rename_all = "camelCase")]
7474
pub enum RetryPolicy {
7575
/// Retry entire queries on failure
7676
Query,
@@ -117,16 +117,12 @@ pub struct ExchangeManagerGeneralConfig {
117117
#[serde(rename_all = "camelCase")]
118118
pub enum ExchangeManagerBackend {
119119
/// S3-compatible storage configuration (includes AWS S3, MinIO, GCS).
120-
#[serde(rename = "s3")]
121120
S3(S3ExchangeConfig),
122121
/// Azure Blob Storage configuration.
123-
#[serde(rename = "azure")]
124122
Azure(AzureExchangeConfig),
125123
/// HDFS-based exchange manager.
126-
#[serde(rename = "hdfs")]
127124
Hdfs(HdfsExchangeConfig),
128125
/// Local filesystem storage (not recommended for production).
129-
#[serde(rename = "local")]
130126
Local(LocalExchangeConfig),
131127
}
132128

@@ -646,7 +642,7 @@ mod tests {
646642
task_retry_attempts_per_task: None,
647643
retry_initial_delay: Some(Duration::from_secs(15)),
648644
retry_max_delay: Some(Duration::from_secs(90)),
649-
retry_delay_scale_factor: Some("3.0".to_string()),
645+
retry_delay_scale_factor: Some(3.0),
650646
exchange_deduplication_buffer_size: Some("64MB".to_string()),
651647
exchange_encryption_enabled: Some(false),
652648
};
@@ -674,7 +670,7 @@ mod tests {
674670
);
675671
assert_eq!(
676672
fte_config.config_properties.get("retry-delay-scale-factor"),
677-
Some(&"3.0".to_string())
673+
Some(&"3".to_string())
678674
);
679675
assert_eq!(
680676
fte_config

0 commit comments

Comments
 (0)