Skip to content

Commit 4380f03

Browse files
committed
[ENH]: limit concurrency on operators spawned by GC
1 parent 8646eac commit 4380f03

File tree

10 files changed

+166
-322
lines changed

10 files changed

+166
-322
lines changed

rust/garbage_collector/src/bin/garbage_collector_tool.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ async fn main() {
245245
config.min_versions_to_keep,
246246
enable_log_gc,
247247
enable_dangerous_option_to_ignore_min_versions_for_wal3,
248+
10,
248249
);
249250

250251
let result = orchestrator.run(system.clone()).await;

rust/garbage_collector/src/config.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ pub struct GarbageCollectorConfig {
3434
)]
3535
pub(super) version_cutoff_time: Duration,
3636
pub(super) max_collections_to_gc: u32,
37+
#[serde(
38+
default = "GarbageCollectorConfig::default_max_concurrent_list_files_operations_per_collection"
39+
)]
40+
pub(super) max_concurrent_list_files_operations_per_collection: usize,
3741
pub(super) max_collections_to_fetch: Option<u32>,
3842
pub(super) gc_interval_mins: u32,
3943
#[serde(default = "GarbageCollectorConfig::default_min_versions_to_keep")]
@@ -70,6 +74,10 @@ impl GarbageCollectorConfig {
7074
2
7175
}
7276

77+
fn default_max_concurrent_list_files_operations_per_collection() -> usize {
78+
10
79+
}
80+
7381
fn default_filter_min_versions_if_alive() -> Option<u64> {
7482
None
7583
}

rust/garbage_collector/src/garbage_collector_component.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ impl GarbageCollector {
187187
self.config.min_versions_to_keep,
188188
enable_log_gc,
189189
enable_dangerous_option_to_ignore_min_versions_for_wal3,
190+
self.config
191+
.max_concurrent_list_files_operations_per_collection,
190192
);
191193

192194
let started_at = SystemTime::now();
@@ -865,6 +867,7 @@ mod tests {
865867
enable_log_gc_for_tenant_threshold: "tenant-threshold".to_string(),
866868
log: LogConfig::Grpc(GrpcLogConfig::default()),
867869
enable_dangerous_option_to_ignore_min_versions_for_wal3: false,
870+
max_concurrent_list_files_operations_per_collection: 10,
868871
};
869872
let registry = Registry::new();
870873

0 commit comments

Comments
 (0)