-
Notifications
You must be signed in to change notification settings - Fork 193
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
K8SPXC-1366: Add suspendedDeadlineSeconds #1970
Conversation
suspendedDeadlineSeconds allows user to configure maximum duration that backup job can wait in suspended state. This field is optional and can be configured in two separate places: 1. PerconaXtraDBClusterBackup.spec.suspendedDeadlineSeconds: Always used if defined. 2. PerconaXtraDBCluster.spec.backup.suspendedDeadlineSeconds: Used only if not defined in PerconaXtraDBClusterBackup. Suspended deadlines seconds are checked against the last transition time of job status condidition with type JobSuspended and status true. Commit 5a07740 introduced startingDeadlineSeconds to fail backup it doesn't start before configured deadline. This commit also allows user to configure it globally, just like suspendedDeadlineSeconds. startingDeadlineSeconds is an optinal field and can be configured in two separate places: 1. PerconaXtraDBClusterBackup.spec.startedDeadlineSeconds: Always used if defined. 2. PerconaXtraDBCluster.spec.backup.startedDeadlineSeconds: Used only if not defined in PerconaXtraDBClusterBackup.
2a0baf2
to
cb39bb5
Compare
cb39bb5
to
8202127
Compare
|
||
var deadlineSeconds *int64 | ||
if cr.Spec.StartingDeadlineSeconds != nil { | ||
deadlineSeconds = cr.Spec.StartingDeadlineSeconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it will be a bit nicer to use switch here?
And does it make sense to separate this function to 2 functions? Get deadlineSeconds and check the value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think switch will be much different, why do you think that it might be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var deadlineSeconds *int64
switch {
case cr.Spec.StartingDeadlineSeconds != nil:
deadlineSeconds = cr.Spec.StartingDeadlineSeconds
case cluster.Spec.Backup.StartingDeadlineSeconds != nil:
deadlineSeconds = cluster.Spec.Backup.StartingDeadlineSeconds
default:
return nil
}
For me it looks more readable, but it's not critical for sure, just want to understand when what is better to use.
commit: 8202127 |
suspendedDeadlineSeconds allows user to configure maximum duration that
backup job can wait in suspended state. This field is optional and can
be configured in two separate places:
Suspended deadlines seconds are checked against the last transition time
of job status condidition with type JobSuspended and status true.
Commit 5a07740 introduced startingDeadlineSeconds to fail backup it
doesn't start before configured deadline. This commit also allows user
to configure it globally, just like suspendedDeadlineSeconds.
startingDeadlineSeconds is an optinal field and can be configured in two
separate places:
CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
compare/*-oc.yml
)?Config/Logging/Testability