Skip to content

Commit 6eea9b4

Browse files
authored
fix(query): fix default values of SpillConfig may not take effect (#17113)
fix SpillConfig::default
1 parent d4bc96c commit 6eea9b4

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

scripts/ci/deploy/config/databend-query-node-1.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,6 @@ data_cache_storage = "none"
155155
path = "./.databend/_cache"
156156
# max bytes of cached data 20G
157157
max_bytes = 21474836480
158+
159+
[spill]
160+
spill_local_disk_path = "./.databend/temp/_query_spill"

src/query/config/src/config.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2920,7 +2920,7 @@ impl Default for DiskCacheKeyReloadPolicy {
29202920
}
29212921
}
29222922

2923-
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args, Default)]
2923+
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args)]
29242924
#[serde(default, deny_unknown_fields)]
29252925
pub struct DiskCacheConfig {
29262926
/// Max bytes of cached raw table data. Default 20GB, set it to 0 to disable it.
@@ -2952,7 +2952,13 @@ pub struct DiskCacheConfig {
29522952
pub sync_data: bool,
29532953
}
29542954

2955-
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args, Default)]
2955+
impl Default for DiskCacheConfig {
2956+
fn default() -> Self {
2957+
inner::DiskCacheConfig::default().into()
2958+
}
2959+
}
2960+
2961+
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Args)]
29562962
#[serde(default, deny_unknown_fields)]
29572963
pub struct SpillConfig {
29582964
/// Path of spill to local disk. disable if it's empty.
@@ -2968,6 +2974,12 @@ pub struct SpillConfig {
29682974
pub spill_local_disk_max_bytes: u64,
29692975
}
29702976

2977+
impl Default for SpillConfig {
2978+
fn default() -> Self {
2979+
inner::SpillConfig::default().into()
2980+
}
2981+
}
2982+
29712983
mod cache_config_converters {
29722984
use std::path::PathBuf;
29732985

src/query/service/tests/it/configs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,6 @@ fn test_spill_config() -> Result<()> {
935935
r#"
936936
[spill]
937937
spill_local_disk_path = "/data/spill"
938-
spill_local_disk_reserved_space_percentage = 0.5
939938
"#
940939
.as_bytes(),
941940
)?;
@@ -949,6 +948,7 @@ spill_local_disk_reserved_space_percentage = 0.5
949948
let cfg = InnerConfig::load_for_test().expect("config load failed");
950949

951950
assert_eq!(cfg.spill.path, "/data/spill");
951+
assert_eq!(cfg.spill.reserved_disk_ratio, 0.3);
952952
},
953953
);
954954

0 commit comments

Comments
 (0)