Open
Description
Currently, when task finishes running, its next activation is calculated in relation to the time when task ended, not when it started.
This results in rare, yet problematic scenarios like:
- schedule repair to run once a week
- repair starts and runs for a week + 1h
- next repair activation takes place in a week - 1h, meaning that we skip one week's repair
This scenario can be found here: Ref: https://github.com/scylladb/scylla-enterprise/issues/5281
Here are the places in the code from which we can see next task activation calculation:
scylla-manager/pkg/scheduler/scheduler.go
Lines 396 to 405 in 9dc2b7e
scylla-manager/pkg/scheduler/scheduler.go
Lines 139 to 168 in 9dc2b7e
In order to fix that, SM should calculate the next task activation in relation to the task start time.