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
Now let me look at the existing tests:
- Assistant
Now let's update the tests to cover the new behavior:
- Assistant
Now add tests for the preemption scenario in the
CanExecuteBackupdescribe block: - Assistant
The fix is complete and verified. Summary of the changes:
Problem
In
CanExecuteBackup(api/v1/backup_funcs.go), the scheduling loop usedIsInProgress(), which countspendingbackups as in-progress. Since the list is sorted by name, a pending backup whose name sorted before a started/running backup was treated as "the first in-progress backup" and allowed to execute — preempting the backup already holding active resources. Pending selection was also name-based rather than oldest-first.Changes (
api/v1/backup_funcs.go)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.