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

[release-4.16] OCPBUGS-36489: parallelize member health checks #1290

Open
wants to merge 1 commit into
base: release-4.16
Choose a base branch
from

Conversation

openshift-cherrypick-robot

This is an automated cherry-pick of #1286

/assign tjungblu

/cherrypick release-4.15 release-4.14 release-4.13 release-4.12

@openshift-ci-robot
Copy link

@openshift-cherrypick-robot: Jira Issue OCPBUGS-36301 has been cloned as Jira Issue OCPBUGS-36489. Will retitle bug to link to clone.
/retitle [release-4.16] OCPBUGS-36489: parallelize member health checks

In response to this:

This is an automated cherry-pick of #1286

/assign tjungblu

/cherrypick release-4.15 release-4.14 release-4.13 release-4.12

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.

@openshift-ci openshift-ci bot changed the title [release-4.16] OCPBUGS-36301: parallelize member health checks [release-4.16] OCPBUGS-36489: parallelize member health checks Jul 3, 2024
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Jul 3, 2024
@openshift-ci-robot
Copy link

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-36489, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required"
  • expected dependent Jira Issue OCPBUGS-36301 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is MODIFIED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This is an automated cherry-pick of #1286

/assign tjungblu

/cherrypick release-4.15 release-4.14 release-4.13 release-4.12

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.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jul 3, 2024
@openshift-ci openshift-ci bot requested review from dusk125 and hasbro17 July 3, 2024 10:49
// closing here to avoid late replies to panic on resChan,
// the result will be considered a timeout anyway
close(resChan)
resChan <- checkSingleMemberHealth(ctx, member)
Copy link
Contributor

Choose a reason for hiding this comment

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

pkg/etcdcli/health.go:54:44: loop variable member captured by func literal

this one doesn't seem to pass the verify linter somehow, interesting.

https://issues.redhat.com/browse/OCPBUGS-36301

Currently,
member health is checked in serial with a 30s timeout per member.
3 out of 4 GetMemberHealth callers had their own default 30s timeout as well for the entire process.
Because of this,
a slow check on one member could exhaust the timeout for the entire GetMemberHealth function,
and thus cause later-checked members
to report as unhealthy even though they were fine.

With this commit,
I am dropping the internal 30s timeout from GetMemberHealth,
and instead letting the caller set the timeout.
Also, the code now checks the health of all members in parallel.
This will prevent a single slow member
from affecting the health reporting of other members.

I also added a timeout to the context used in IsMemberHealthy
which calls GetMemberHealth.
Neither Trevor nor I were sure why a default timeout wasn't present there,
though one was present in all other callsites.
@hasbro17 hasbro17 force-pushed the cherry-pick-1286-to-release-4.16 branch from 8e86f81 to 94d3821 Compare July 3, 2024 19:41
@hasbro17
Copy link
Contributor

hasbro17 commented Jul 3, 2024

Added the patch to pass the member as an arg to the health check closure to prevent the member variable changing for each closure to be in compliance with the linter.

pkg/etcdcli/health.go:54:44: loop variable member captured by func literal

https://go.dev/doc/faq#closures_and_goroutines

4.17 is on Go 1.22 which has this issue fixed by default which changes loop variable to have per iteration scope so closure won't have the loop variables change on them.
https://go.dev/blog/loopvar-preview
https://go.dev/wiki/LoopvarExperiment#what-is-the-problem-this-solves

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 3, 2024
Copy link
Member

@wking wking left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2024
Copy link
Contributor

openshift-ci bot commented Jul 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hasbro17, openshift-cherrypick-robot, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

openshift-ci bot commented Jul 3, 2024

@openshift-cherrypick-robot: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-etcd-scaling 94d3821 link true /test e2e-aws-ovn-etcd-scaling
ci/prow/e2e-aws-etcd-recovery 94d3821 link false /test e2e-aws-etcd-recovery
ci/prow/e2e-aws-ovn-serial 94d3821 link true /test e2e-aws-ovn-serial
ci/prow/e2e-aws-ovn-single-node 94d3821 link true /test e2e-aws-ovn-single-node
ci/prow/e2e-operator-fips 94d3821 link false /test e2e-operator-fips

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.

@tjungblu
Copy link
Contributor

tjungblu commented Jul 4, 2024

/label backport-risk-assessed

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Jul 4, 2024
@tjungblu
Copy link
Contributor

tjungblu commented Jul 8, 2024

/jira refresh

@openshift-ci-robot
Copy link

@tjungblu: This pull request references Jira Issue OCPBUGS-36489, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required"
  • expected dependent Jira Issue OCPBUGS-36301 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is ON_QA instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants