From 44ab2ffee31672ca2f28f6bc6d878076ba0fa38c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 16 Apr 2026 01:35:12 -0700 Subject: [PATCH] fix(plugin): remove Min Volume Age field from vacuum plugin worker config (#9095) * fix(plugin): remove Min Volume Age field from vacuum plugin worker config The min_volume_age_seconds setting is not needed as a user-configurable field in the plugin worker form. The detection logic continues to use the hardcoded default from NewDefaultConfig(). * fix(plugin): disable volume age filtering in plugin worker detection Set MinVolumeAgeSeconds to 0 in deriveVacuumConfig so the plugin worker does not filter out volumes by age during detection. * fix(plugin): remove all volume age filtering from plugin worker detection Remove age-related fields from detection trace messages, activity reports, and per-volume diagnostics. The plugin worker now only filters by garbage threshold. --- weed/plugin/worker/vacuum_handler.go | 55 +++-------------------- weed/plugin/worker/vacuum_handler_test.go | 8 +--- 2 files changed, 7 insertions(+), 56 deletions(-) diff --git a/weed/plugin/worker/vacuum_handler.go b/weed/plugin/worker/vacuum_handler.go index 56cb22e73..3ffa95170 100644 --- a/weed/plugin/worker/vacuum_handler.go +++ b/weed/plugin/worker/vacuum_handler.go @@ -169,15 +169,6 @@ func (h *VacuumHandler) Descriptor() *plugin_pb.JobTypeDescriptor { MinValue: &plugin_pb.ConfigValue{Kind: &plugin_pb.ConfigValue_DoubleValue{DoubleValue: 0}}, MaxValue: &plugin_pb.ConfigValue{Kind: &plugin_pb.ConfigValue_DoubleValue{DoubleValue: 1}}, }, - { - Name: "min_volume_age_seconds", - Label: "Min Volume Age (s)", - Description: "Only detect volumes older than this age.", - FieldType: plugin_pb.ConfigFieldType_CONFIG_FIELD_TYPE_INT64, - Widget: plugin_pb.ConfigWidget_CONFIG_WIDGET_NUMBER, - Required: true, - MinValue: &plugin_pb.ConfigValue{Kind: &plugin_pb.ConfigValue_Int64Value{Int64Value: 0}}, - }, }, }, }, @@ -185,9 +176,6 @@ func (h *VacuumHandler) Descriptor() *plugin_pb.JobTypeDescriptor { "garbage_threshold": { Kind: &plugin_pb.ConfigValue_DoubleValue{DoubleValue: 0.3}, }, - "min_volume_age_seconds": { - Kind: &plugin_pb.ConfigValue_Int64Value{Int64Value: 24 * 60 * 60}, - }, }, }, AdminRuntimeDefaults: &plugin_pb.AdminRuntimeDefaults{ @@ -206,9 +194,6 @@ func (h *VacuumHandler) Descriptor() *plugin_pb.JobTypeDescriptor { "garbage_threshold": { Kind: &plugin_pb.ConfigValue_DoubleValue{DoubleValue: 0.3}, }, - "min_volume_age_seconds": { - Kind: &plugin_pb.ConfigValue_Int64Value{Int64Value: 24 * 60 * 60}, - }, }, } } @@ -297,48 +282,34 @@ func emitVacuumDetectionDecisionTrace( return nil } - minVolumeAge := time.Duration(workerConfig.MinVolumeAgeSeconds) * time.Second totalVolumes := len(metrics) - debugCount := 0 skippedDueToGarbage := 0 - skippedDueToAge := 0 for _, metric := range metrics { if metric == nil { continue } - if metric.GarbageRatio >= workerConfig.GarbageThreshold && metric.Age >= minVolumeAge { + if metric.GarbageRatio >= workerConfig.GarbageThreshold { continue } - if debugCount < 5 { - if metric.GarbageRatio < workerConfig.GarbageThreshold { - skippedDueToGarbage++ - } - if metric.Age < minVolumeAge { - skippedDueToAge++ - } - } - debugCount++ + skippedDueToGarbage++ } summaryMessage := "" summaryStage := "decision_summary" if len(results) == 0 { summaryMessage = fmt.Sprintf( - "VACUUM: No tasks created for %d volumes. Threshold=%.2f%%, MinAge=%s. Skipped: %d (garbage