Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

dynamic periodic etcd backup timer feature #56

Merged
merged 5 commits into from
Jan 29, 2020
Merged

Conversation

tvainutis
Copy link

I suggest this implementation to issue

Problem:

For example we want to have periodic backup every hour from 09:00. 09:30 pod crashed and new one
created with a new time ticker for 1 hour, that means we wont get backup at 10:00 because new timer will execute backup at 10:30.

Solution:

Use dynamic etcd backup timer duration. After a pod crashed it will collect EtcdBackup CRD's and will create processes with expected timer, but it would be better if backup operator will calculate remaining time from last backup execution time or CRD creation date and after successful etcd backup it will get back to previous expected timer.

Implementation:

Backup still not executed.
For example if EtcdBackup CRD was created at 09:00 and I want periodic backups for every hour, then it will calculate remaining time and create a timer with remaining time duration, based on EtcdBackup CRD creation date (creation date + expected duration – current date). When timer is finished it will create new timer with expected duration (presented in EtcdBackupCRD-spec->backupPolicy->backupIntervalInSecond)

Backup was executed.
Basically it goes through the same process, but duration it’s calculated not from creation date but from last execution date (That is parameter that I pass into EtcdBackup CRD in status section lastExecutionDate). Then ticker duration formula is (Last Execution Date + Expected duration – Current Date) . lastSuccessDate != lastExecutionDate, because lastExecution is set even if Etcd Backup failed (azure connection error, etc … )

Additional parameters:

EtcdBackup -> status -> lastExecutionDate - this shows last backup execution date regardless if it was successful or not

@Marlinc Marlinc merged commit c9c6097 into cbws:master Jan 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants