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