Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rust/garbage_collector/src/bin/garbage_collector_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ async fn main() {
config.min_versions_to_keep,
enable_log_gc,
enable_dangerous_option_to_ignore_min_versions_for_wal3,
10,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[BestPractice]

This hardcoded value could be replaced by the value from the configuration. I've left a suggestion on rust/garbage_collector/src/config.rs to make the max_concurrent_list_files_operations_per_collection field public. Once that's done, you can use config.max_concurrent_list_files_operations_per_collection here.

Suggested change
10,
config.max_concurrent_list_files_operations_per_collection,

Committable suggestion

Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Context for Agents
[**BestPractice**]

This hardcoded value could be replaced by the value from the configuration. I've left a suggestion on `rust/garbage_collector/src/config.rs` to make the `max_concurrent_list_files_operations_per_collection` field public. Once that's done, you can use `config.max_concurrent_list_files_operations_per_collection` here.

```suggestion
                config.max_concurrent_list_files_operations_per_collection,
```

⚡ **Committable suggestion**

Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

File: rust/garbage_collector/src/bin/garbage_collector_tool.rs
Line: 248

);

let result = orchestrator.run(system.clone()).await;
Expand Down
8 changes: 8 additions & 0 deletions rust/garbage_collector/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ pub struct GarbageCollectorConfig {
)]
pub(super) version_cutoff_time: Duration,
pub(super) max_collections_to_gc: u32,
#[serde(
default = "GarbageCollectorConfig::default_max_concurrent_list_files_operations_per_collection"
)]
pub(super) max_concurrent_list_files_operations_per_collection: usize,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[BestPractice]

The new configuration field max_concurrent_list_files_operations_per_collection has pub(super) visibility, which is inconsistent with other pub fields like min_versions_to_keep. This prevents garbage_collector_tool.rs from accessing this value from the loaded config, forcing it to use a hardcoded value.

Please consider making this field pub for consistency. This will also allow the tool to use the configured value.

Suggested change
pub(super) max_concurrent_list_files_operations_per_collection: usize,
pub max_concurrent_list_files_operations_per_collection: usize,

Committable suggestion

Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Context for Agents
[**BestPractice**]

The new configuration field `max_concurrent_list_files_operations_per_collection` has `pub(super)` visibility, which is inconsistent with other `pub` fields like `min_versions_to_keep`. This prevents `garbage_collector_tool.rs` from accessing this value from the loaded config, forcing it to use a hardcoded value.

Please consider making this field `pub` for consistency. This will also allow the tool to use the configured value.

```suggestion
    pub max_concurrent_list_files_operations_per_collection: usize,
```

⚡ **Committable suggestion**

Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

File: rust/garbage_collector/src/config.rs
Line: 40

pub(super) max_collections_to_fetch: Option<u32>,
pub(super) gc_interval_mins: u32,
#[serde(default = "GarbageCollectorConfig::default_min_versions_to_keep")]
Expand Down Expand Up @@ -70,6 +74,10 @@ impl GarbageCollectorConfig {
2
}

fn default_max_concurrent_list_files_operations_per_collection() -> usize {
10
}

fn default_filter_min_versions_if_alive() -> Option<u64> {
None
}
Expand Down
4 changes: 4 additions & 0 deletions rust/garbage_collector/src/garbage_collector_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ impl GarbageCollector {
self.config.min_versions_to_keep,
enable_log_gc,
enable_dangerous_option_to_ignore_min_versions_for_wal3,
self.config
.max_concurrent_list_files_operations_per_collection,
);

let started_at = SystemTime::now();
Expand Down Expand Up @@ -865,6 +867,7 @@ mod tests {
enable_log_gc_for_tenant_threshold: "tenant-threshold".to_string(),
log: LogConfig::Grpc(GrpcLogConfig::default()),
enable_dangerous_option_to_ignore_min_versions_for_wal3: false,
max_concurrent_list_files_operations_per_collection: 10,
};
let registry = Registry::new();

Expand Down Expand Up @@ -1067,6 +1070,7 @@ mod tests {
enable_log_gc_for_tenant: Vec::new(),
enable_log_gc_for_tenant_threshold: "ffffffff-ffff-ffff-ffff-ffffffffffff".to_string(),
log: LogConfig::Grpc(GrpcLogConfig::default()),
max_concurrent_list_files_operations_per_collection: 10,
..Default::default()
};
let registry = Registry::new();
Expand Down
Loading
Loading