Pending backups can preempt a backup that is already executing Backup scheduling must…
- User
Pending backups can preempt a backup that is already executing
Backup scheduling must not select a pending backup while another backup is already executing. When none is executing, select the oldest pending backup, using a deterministic tie-break for equal creation times.
Interface
Type: Function Name: IsExecuting Path: api/v1/backup_funcs.go Input: () Output: bool Description: Returns true if the backup has started or is running. Use this to determine whether a backup holds active resources and should not be preempted.
- Assistant
I'll explore the backup scheduling code and implement
IsExecutingso pending backups can't preempt an active one. - Assistant
Checking git history and how backup phases are used in the controller:
- Assistant
Implementing
IsExecutingand updating scheduling so pending backups can't preempt active ones. - Assistant
Adding tests for
IsExecutingand the preemption fix: - Assistant
Fixed the backup scheduling bug where pending backups could preempt an executing one.
Root cause
CanExecuteBackuptreatedBackupPhasePendingthe same as actively running backups viaIsInProgress(). Because the list is sorted by name, a pending backup (e.g.backup-1) could be selected ahead of an actually executing backup (e.g.backup-2inrunningphase).Changes
api/v1/backup_funcs.go-
IsExecuting()— Returnstrueonly forstartedorrunningphases, distinguishing active execution from waiting. -
GetPendingBackupNames()— Now:- Includes backups that are not done and not executing (including
pendingphase) - Sorts by creation time (oldest first), with name as tie-breaker
- Includes backups that are not done and not executing (including
-
CanExecuteBackup()— Now:- Uses instead of to detect active backups
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.