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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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