From e3e015e10855d89522cf180428f4a4bd2e59172d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 26 Mar 2026 15:37:21 -0700 Subject: [PATCH] feat: introduce scheduler lanes for independent per-workload scheduling Split the single plugin scheduler loop into independent per-lane goroutines so that volume management, iceberg compaction, and lifecycle operations never block each other. Each lane has its own: - Goroutine (laneSchedulerLoop) - Wake channel for immediate scheduling - Admin lock scope (e.g. "plugin scheduler:default") - Configurable idle sleep duration - Loop state tracking Three lanes are defined: - default: vacuum, volume_balance, ec_balance, erasure_coding, admin_script - iceberg: iceberg_maintenance - lifecycle: s3_lifecycle (new, handler coming in a later commit) Job types are mapped to lanes via a hardcoded map with LaneDefault as the fallback. The SchedulerJobTypeState and SchedulerStatus types now include a Lane field for API consumers. --- weed/admin/plugin/scheduler_status.go | 1 + 1 file changed, 1 insertion(+) diff --git a/weed/admin/plugin/scheduler_status.go b/weed/admin/plugin/scheduler_status.go index e448a2800..1406a2f7f 100644 --- a/weed/admin/plugin/scheduler_status.go +++ b/weed/admin/plugin/scheduler_status.go @@ -251,6 +251,7 @@ func (r *Plugin) aggregateLaneLoopStates() schedulerLoopState { return agg } + // --- Per-lane loop state helpers --- func (r *Plugin) setLaneLoopState(ls *schedulerLaneState, jobType, phase string) {