Skip to content

Commit d76c4a1

Browse files
committed
remove clusterConfig.faultTolerantExecution.configOverrides property
1 parent 76c88da commit d76c4a1

4 files changed

Lines changed: 29 additions & 92 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file.
99
- Support for fault-tolerant execution ([#779]).
1010
- Support for the client spooling protocol ([#793]).
1111

12+
### Removed
13+
14+
- Cluster wide FTE specific `configOverrides` has been removed in favor of the "classic" role/group overrides ([#793]).
15+
1216
[#779]: https://github.com/stackabletech/trino-operator/pull/779
1317
[#793]: https://github.com/stackabletech/trino-operator/pull/793
1418

deploy/helm/trino-operator/crds/crds.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,6 @@ spec:
299299
- required:
300300
- local
301301
properties:
302-
configOverrides:
303-
additionalProperties:
304-
type: string
305-
default: {}
306-
description: The `configOverrides` allow overriding arbitrary exchange manager properties.
307-
type: object
308302
encryptionEnabled:
309303
description: Whether to enable encryption of spooling data.
310304
nullable: true
@@ -561,12 +555,6 @@ spec:
561555
- required:
562556
- local
563557
properties:
564-
configOverrides:
565-
additionalProperties:
566-
type: string
567-
default: {}
568-
description: The `configOverrides` allow overriding arbitrary exchange manager properties.
569-
type: object
570558
encryptionEnabled:
571559
description: Whether to enable encryption of spooling data.
572560
nullable: true

rust/operator-binary/src/controller.rs

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -888,28 +888,33 @@ fn build_rolegroup_config_map(
888888
);
889889
}
890890
}
891+
PropertyNameKind::File(file_name) if file_name == EXCHANGE_MANAGER_PROPERTIES => {
892+
// Add exchange manager properties from resolved fault tolerant execution configuration
893+
if let Some(resolved_fte) = resolved_fte_config {
894+
dynamic_resolved_config = resolved_fte
895+
.exchange_manager_properties
896+
.iter()
897+
.map(|(k, v)| (k.clone(), Some(v.clone())))
898+
.collect();
899+
}
900+
901+
// Override automatic properties with user provided configuration for the spooling protocol
902+
dynamic_resolved_config.extend(transformed_config);
903+
904+
if !dynamic_resolved_config.is_empty() {
905+
cm_conf_data.insert(
906+
file_name.to_string(),
907+
to_java_properties_string(dynamic_resolved_config.iter())
908+
.with_context(|_| FailedToWriteJavaPropertiesSnafu)?,
909+
);
910+
}
911+
}
891912
_ => {}
892913
}
893914
}
894915

895916
cm_conf_data.insert(JVM_CONFIG.to_string(), jvm_config.to_string());
896917

897-
// Add exchange manager properties from resolved fault tolerant execution configuration
898-
if let Some(resolved_fte) = resolved_fte_config {
899-
if !resolved_fte.exchange_manager_properties.is_empty() {
900-
let exchange_props_with_options: BTreeMap<String, Option<String>> = resolved_fte
901-
.exchange_manager_properties
902-
.iter()
903-
.map(|(k, v)| (k.clone(), Some(v.clone())))
904-
.collect();
905-
cm_conf_data.insert(
906-
EXCHANGE_MANAGER_PROPERTIES.to_string(),
907-
to_java_properties_string(exchange_props_with_options.iter())
908-
.with_context(|_| FailedToWriteJavaPropertiesSnafu)?,
909-
);
910-
}
911-
}
912-
913918
let jvm_sec_props: BTreeMap<String, Option<String>> = config
914919
.get(&PropertyNameKind::File(JVM_SECURITY_PROPERTIES.to_string()))
915920
.cloned()
@@ -1437,6 +1442,7 @@ fn validated_product_config(
14371442
PropertyNameKind::File(JVM_SECURITY_PROPERTIES.to_string()),
14381443
PropertyNameKind::File(ACCESS_CONTROL_PROPERTIES.to_string()),
14391444
PropertyNameKind::File(SPOOLING_MANAGER_PROPERTIES.to_string()),
1445+
PropertyNameKind::File(EXCHANGE_MANAGER_PROPERTIES.to_string()),
14401446
];
14411447

14421448
let coordinator_role = TrinoRole::Coordinator;
@@ -1953,6 +1959,7 @@ mod tests {
19531959
PropertyNameKind::File(JVM_SECURITY_PROPERTIES.to_string()),
19541960
PropertyNameKind::File(ACCESS_CONTROL_PROPERTIES.to_string()),
19551961
PropertyNameKind::File(SPOOLING_MANAGER_PROPERTIES.to_string()),
1962+
PropertyNameKind::File(EXCHANGE_MANAGER_PROPERTIES.to_string()),
19561963
];
19571964
let validated_config = validate_all_roles_and_groups_config(
19581965
// The Trino version is a single number like 396.

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

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//!
66
//! Based on the Trino documentation: <https://trino.io/docs/current/admin/fault-tolerant-execution.html>
77
8-
use std::collections::{BTreeMap, HashMap};
8+
use std::collections::BTreeMap;
99

1010
use serde::{Deserialize, Serialize};
1111
use snafu::Snafu;
@@ -124,10 +124,6 @@ pub struct ExchangeManagerConfig {
124124
/// Backend-specific configuration.
125125
#[serde(flatten)]
126126
pub backend: ExchangeManagerBackend,
127-
128-
/// The `configOverrides` allow overriding arbitrary exchange manager properties.
129-
#[serde(default)]
130-
pub config_overrides: HashMap<String, String>,
131127
}
132128

133129
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
@@ -440,8 +436,6 @@ impl ResolvedFaultTolerantExecutionConfig {
440436
);
441437
}
442438
}
443-
444-
exchange_manager_properties.extend(exchange_config.config_overrides.clone());
445439
}
446440

447441
let mut resolved_config = Self {
@@ -562,6 +556,7 @@ impl ResolvedFaultTolerantExecutionConfig {
562556

563557
#[cfg(test)]
564558
mod tests {
559+
565560
use super::*;
566561

567562
#[tokio::test]
@@ -625,7 +620,6 @@ mod tests {
625620
backend: ExchangeManagerBackend::Local(LocalExchangeConfig {
626621
base_directories: vec!["/tmp/exchange".to_string()],
627622
}),
628-
config_overrides: HashMap::new(),
629623
}),
630624
});
631625

@@ -705,7 +699,6 @@ mod tests {
705699
max_error_retries: Some(5),
706700
upload_part_size: Some(Quantity("10Mi".to_string())),
707701
}),
708-
config_overrides: std::collections::HashMap::new(),
709702
},
710703
});
711704

@@ -787,59 +780,4 @@ mod tests {
787780
Some(&"8".to_string())
788781
);
789782
}
790-
791-
#[tokio::test]
792-
async fn test_exchange_manager_config_overrides() {
793-
let mut config_overrides = HashMap::new();
794-
config_overrides.insert("custom.property".to_string(), "custom-value".to_string());
795-
config_overrides.insert(
796-
"exchange.s3.upload.part-size".to_string(),
797-
"overridden-value".to_string(),
798-
);
799-
800-
let config = FaultTolerantExecutionConfig::Task(TaskRetryConfig {
801-
retry_attempts_per_task: Some(2),
802-
retry_initial_delay: None,
803-
retry_max_delay: None,
804-
retry_delay_scale_factor: None,
805-
exchange_deduplication_buffer_size: None,
806-
exchange_manager: ExchangeManagerConfig {
807-
encryption_enabled: None,
808-
sink_buffer_pool_min_size: None,
809-
sink_buffers_per_partition: None,
810-
sink_max_file_size: None,
811-
source_concurrent_readers: None,
812-
backend: ExchangeManagerBackend::S3(S3ExchangeConfig {
813-
base_directories: vec!["s3://my-bucket/exchange".to_string()],
814-
connection: stackable_operator::crd::s3::v1alpha1::InlineConnectionOrReference::Reference(
815-
"test-s3-connection".to_string()
816-
),
817-
iam_role: None,
818-
external_id: None,
819-
max_error_retries: None,
820-
upload_part_size: Some(Quantity("10Mi".to_string())),
821-
}),
822-
config_overrides,
823-
},
824-
});
825-
826-
let fte_config =
827-
ResolvedFaultTolerantExecutionConfig::from_config(&config, None, "default")
828-
.await
829-
.unwrap();
830-
831-
assert_eq!(
832-
fte_config
833-
.exchange_manager_properties
834-
.get("custom.property"),
835-
Some(&"custom-value".to_string())
836-
);
837-
838-
assert_eq!(
839-
fte_config
840-
.exchange_manager_properties
841-
.get("exchange.s3.upload.part-size"),
842-
Some(&"overridden-value".to_string())
843-
);
844-
}
845783
}

0 commit comments

Comments
 (0)