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

Fix non-recurring backups #509

Merged
merged 3 commits into from
Dec 23, 2022
Merged

Conversation

HoustonPutman
Copy link
Contributor

#455 introduced a bug for non-recurring backups that was unearthed while working on #507

Basically we need to only update the NextScheduledTimestamp if recurrence is enabled.

I also restructured the logic to hopefully make it more clear when backup logic should be run.

@HoustonPutman HoustonPutman added bug Something isn't working backup labels Dec 21, 2022
@HoustonPutman HoustonPutman added this to the main (v0.7.0) milestone Dec 21, 2022
Copy link
Contributor

@gerlowskija gerlowskija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - maybe next time we could put some of the more cosmetic improvements in their own commit, but it seems pretty harmless here.

Thanks for catching my bug!

@@ -146,7 +145,7 @@ func (r *SolrBackupReconciler) Reconcile(ctx context.Context, req ctrl.Request)
}

// Schedule the next backupTime, if it doesn't have a next scheduled time, it has recurrence and the current backup is finished
if backup.Status.IndividualSolrBackupStatus.Finished {
if backup.Status.IndividualSolrBackupStatus.Finished && backup.Spec.Recurrence.IsEnabled() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[+1] Weird that the comment on L147 mentions recurrence-being-enabled as being a prereq, but we never checked for it before now. Must've just been an oversight on my part?

Anyway, good catch!

@HoustonPutman
Copy link
Contributor Author

maybe next time we could put some of the more cosmetic improvements in their own commit, but it seems pretty harmless here.

Good call, just included since I was going mad trying to fix it so many ways before realizing that I wasn't testing the changes at all....

@HoustonPutman HoustonPutman merged commit c3cda10 into apache:main Dec 23, 2022
@HoustonPutman HoustonPutman deleted the backup-fix branch December 23, 2022 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backup bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants