-
Notifications
You must be signed in to change notification settings - Fork 127
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
WIP: ETCD-612: Added a function to check if the quorum is safe #1278
base: master
Are you sure you want to change the base?
WIP: ETCD-612: Added a function to check if the quorum is safe #1278
Conversation
@jubittajohn: This pull request references ETCD-612 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jubittajohn The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@jubittajohn: This pull request references ETCD-612 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@jubittajohn: This pull request references ETCD-612 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.17.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
+1 |
pkg/operator/starter.go
Outdated
@@ -301,6 +302,20 @@ func RunOperator(ctx context.Context, controllerContext *controllercmd.Controlle | |||
return !isSNO, precheckSucceeded, err | |||
} | |||
|
|||
// checks if quorum is valid | |||
quorumSafe := func() (bool, error) { |
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.
great start! could you also add another commit with the removal of all existing checks? That way we can maybe have an easier time to test whether it works correctly on its own.
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.
@tjungblu I have now added a commit removing the existing checks(with commenting the corresponding test routine changes for now). There are two required cases that are failing now.
0521f7f
to
3a5d0a0
Compare
@jubittajohn once the CI here is mostly green, you can run the payload jobs using /payload. For example You can check those out here as an example for the usual nightly runs: https://openshift-release.apps.ci.l2s4.p1.openshiftapps.com/releasestream/4.17.0-0.nightly/release/4.17.0-0.nightly-2024-06-20-005211 be aware, those tests are somewhat expensive to run, so use them sparingly when you feel like you're close to be done and you just want to have additional assurance that you don't break openshift as a whole somehow. |
50bae80
to
8645fa3
Compare
pkg/operator/starter.go
Outdated
} else if err != nil { | ||
err = fmt.Errorf("unable to evaluate if the quorum is safe: %w", err) | ||
} else { | ||
err = nil |
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.
At least from the current implementation of the quorumChecker, if it's safe to scale, then the error is nil and if it's not safe then the error is not nil. So this check won't ever happen.
From the other calls to the quorumChecker, they usually check !safe and err!=nil in separate if-blocks.
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.
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.
It's not required, just a code style suggestion; functionally, it's the same, but it's a little easier to parse at a glance the individual code paths.
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.
for me it would also just be
WithShouldRevisionInstall(quorumChecker.IsSafeToUpdateRevision).
no need for the additional code
@@ -269,7 +268,7 @@ func TestBootstrapAnnotationRemoval(t *testing.T) { | |||
} | |||
}, | |||
}, | |||
{ | |||
/* { |
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.
feel free to remove those testcases, we should trust what we get from library-go
58e8edd
to
fa6e8c3
Compare
/retest-required |
2 similar comments
/retest-required |
/retest-required |
Signed-off-by: jubittajohn <[email protected]>
Signed-off-by: jubittajohn <[email protected]> Removed test case related to exisiting quorum checks; Updated the starter.go to remove additional code to call the quorum checker Signed-off-by: jubittajohn <[email protected]>
01da4a8
to
81d9818
Compare
Signed-off-by: jubittajohn <[email protected]>
81d9818
to
add43ce
Compare
@jubittajohn: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This PR is blocked by openshift/library-go#1749