Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup gets triggered when schedule unpaused #6517

Closed
rnarenpujari opened this issue Jul 18, 2023 · 7 comments · Fixed by #7169
Closed

Backup gets triggered when schedule unpaused #6517

rnarenpujari opened this issue Jul 18, 2023 · 7 comments · Fixed by #7169
Assignees
Milestone

Comments

@rnarenpujari
Copy link

rnarenpujari commented Jul 18, 2023

What steps did you take and what happened:

If the cron expression would have fired while the schedule was paused, a backup is immediately triggered when you unpause it. For example if you create a schedule with cron "45 * * * *" and pause it at say the 43rd minute and then unpause it at say 50th minute, a backup gets triggered (I guess since .Status.LastBackup is nil or >60min ago).

Wanted to confirm if this is expected behavior or not.

What did you expect to happen:

Schedule state to get reset when unpaused (i.e. a backup to get triggered when the cron fires next in the future).

The following information will help us better understand what's going on:

N/A

Anything else you would like to add:

N/A

Environment:

  • Velero version (use velero version): 1.10.3
  • Velero features (use velero client config get features):
  • Kubernetes version (use kubectl version): 1.25
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"
@qiuming-best
Copy link
Contributor

@rnarenpujari After going through the codes, the schedule will trigger one backup after unpause.

if the schedule is paused, the related CR will not be requeued, and the .Status.LastBackup will not be updated, once unpause the schedule CR, the controller will compare the next trigger time of corn expression based on the LastBackuptimestamp and the result is the schedule has expired then it submits one backup immediately.

we will discuss whether it's by design or needs adjustment

@reasonerjt
Copy link
Contributor

Per my understanding, this is working as designed, @rnarenpujari do you see any issue with this implementation?

@draghuram
Copy link
Contributor

FWIW, I agree that the current behavior is counter intuitive. Backups should be triggered only on schedule and it seems that they are getting triggered as soon as one is unpaused (even if the current time is not as per schedule).

@rnarenpujari
Copy link
Author

I guess in the common case where you have a daily backup and pause it for a few days, the day you unpause you'd take 2 backups (one immediately and one at the scheduled time). It's kind of a nitpick - unless there's a use case for only wanting to take backups at a particular time.
@pradeepkchaturvedi your thoughts?

@pradeepkchaturvedi pradeepkchaturvedi added the 1.13-candidate issue/pr that should be considered to target v1.13 minor release label Aug 4, 2023
@kaovilai
Copy link
Member

I would like to be assigned this issue!

@reasonerjt reasonerjt added this to the v1.13 milestone Aug 25, 2023
@reasonerjt reasonerjt removed the 1.13-candidate issue/pr that should be considered to target v1.13 minor release label Aug 25, 2023
@weshayutin weshayutin added this to OADP Sep 20, 2023
@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. If a Velero team member has requested log or more information, please provide the output of the shared commands.

@kaovilai
Copy link
Member

unstale

@github-actions github-actions bot removed the staled label Oct 26, 2023
@weshayutin weshayutin moved this to In Progress in OADP Dec 5, 2023
@kaovilai kaovilai moved this from In Progress to Ready for Review in OADP Dec 5, 2023
@kaovilai kaovilai moved this from Ready for Review to Done in OADP Dec 13, 2023
@kaovilai kaovilai moved this from Done to Merged / Ready for build in OADP Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants