diff --git a/weed/admin/topology/internal.go b/weed/admin/topology/internal.go index b0ddef9a9..6286f5bca 100644 --- a/weed/admin/topology/internal.go +++ b/weed/admin/topology/internal.go @@ -84,13 +84,28 @@ func (at *ActiveTopology) isDiskAvailableForVolume(disk *activeDisk, taskType Ta return false } - // Check for volume-specific conflicts + // Check for volume-specific conflicts in ALL task states: + // 1. Pending tasks (queued but not yet started) + for _, task := range disk.pendingTasks { + if at.areTasksConflicting(task, taskType, volumeID) { + return false + } + } + + // 2. Assigned/Active tasks (currently running) for _, task := range disk.assignedTasks { if at.areTasksConflicting(task, taskType, volumeID) { return false } } + // 3. Recent tasks (just completed - avoid immediate re-scheduling on same volume) + for _, task := range disk.recentTasks { + if at.areTasksConflicting(task, taskType, volumeID) { + return false + } + } + return true }