Skip to content

OCPBUGS-98719: retry GetVotingMemberNames on transient etcd client fails - #31445

Open
IlanZuckerman wants to merge 2 commits into
openshift:mainfrom
IlanZuckerman:fix-OCPBUGS-98719-retry-voting-members
Open

OCPBUGS-98719: retry GetVotingMemberNames on transient etcd client fails#31445
IlanZuckerman wants to merge 2 commits into
openshift:mainfrom
IlanZuckerman:fix-OCPBUGS-98719-retry-voting-members

Conversation

@IlanZuckerman

@IlanZuckerman IlanZuckerman commented Jul 29, 2026

Copy link
Copy Markdown

GetVotingMemberNames previously failed immediately when NewEtcdClient or MemberList errored, which is flaky during master replacement while etcd is restarting and port-forwards drop.
Poll and retry those transient errors instead of failing the CPMS OnDelete scaling test on the first attempt.

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when retrieving etcd voting member information during transient connection failures or restarts.
    • Added polling and retry behavior so temporary port-forward or client errors no longer cause immediate failures.

…ilures

`GetVotingMemberNames` previously failed immediately when `NewEtcdClient` or
`MemberList` errored, which is flaky during master replacement while etcd is
restarting and port-forwards drop.
Poll and retry those transient errors
instead of failing the CPMS OnDelete scaling test on the first attempt.
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@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. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 29, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@IlanZuckerman: This pull request references Jira Issue OCPBUGS-98719, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

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.

Details

In response to this:

…ilures

GetVotingMemberNames previously failed immediately when NewEtcdClient or MemberList errored, which is flaky during master replacement while etcd is restarting and port-forwards drop.
Poll and retry those transient errors
instead of failing the CPMS OnDelete scaling test on the first attempt.

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.

@IlanZuckerman IlanZuckerman changed the title OCPBUGS-98719: retry GetVotingMemberNames on transient etcd client fa… OCPBUGS-98719: retry GetVotingMemberNames on transient etcd client fails Jul 29, 2026
@openshift-ci
openshift-ci Bot requested review from hasbro17 and tjungblu July 29, 2026 12:04
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e930b4ae-33d0-48f6-9bf9-97009d8ee6c0

📥 Commits

Reviewing files that changed from the base of the PR and between fd9cc13 and 4800f55.

📒 Files selected for processing (1)
  • test/extended/etcd/helpers/helpers.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/extended/etcd/helpers/helpers.go

Walkthrough

GetVotingMemberNames retries etcd client creation and member listing with fresh clients and per-attempt timeouts. It logs transient failures and returns non-learner member names after a successful poll.

Changes

etcd member discovery

Layer / File(s) Summary
Poll etcd member discovery
test/extended/etcd/helpers/helpers.go
GetVotingMemberNames retries client creation and MemberList until success or the polling deadline. It closes each client, logs failures, and returns non-learner member names.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: hasbro17, tjungblu

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: retrying GetVotingMemberNames after transient etcd client failures.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR changes only etcd helper logic and adds no Ginkgo title declarations; existing etcd test titles are static and contain no runtime values.
Test Structure And Quality ✅ Passed The changed helper uses a 10-minute PollUntilContextTimeout, a 15-second MemberList context, and defers client cleanup per attempt; its caller uses suite setup/cleanup and a wrapped failure message.
Microshift Test Compatibility ✅ Passed The full PR changes only test/extended/etcd/helpers/helpers.go and adds no new Ginkgo tests, so the MicroShift test compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR changes only the existing GetVotingMemberNames helper; it adds no Ginkgo e2e tests and introduces no SNO multi-node assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes only an etcd test helper, adding retry and timeout logic; it adds no deployment, controller, manifest, or scheduling constraint.
Ote Binary Stdout Contract ✅ Passed The PR changes only helper timeout handling. It adds no process-level stdout writes, and GetVotingMemberNames is called inside a Ginkgo It block.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR changes only test/extended/etcd/helpers/helpers.go; it adds no Ginkgo test and no IPv4 or external-connectivity requirement.
No-Weak-Crypto ✅ Passed The PR changes only etcd polling and context handling; the added lines contain no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR changes only Go retry logic in helpers.go; no container/Kubernetes manifests or privilege settings were added.
No-Sensitive-Data-In-Logs ✅ Passed The existing voting-member-name log is unchanged; new logs report retry status and errors only, with no passwords, tokens, API keys, PII, or customer data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@IlanZuckerman

IlanZuckerman commented Jul 29, 2026

Copy link
Copy Markdown
Author

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error GetVotingMemberNames logs the full voting member list, and etcd member names are node names/internal hostnames. Redact the names or log only counts/opaque IDs; avoid printing the member-name list in framework.Logf.

Comment @coderabbitai help to get the list of available commands.

That log was already there before My PR. The same pattern is used all over these etcd helpers (EnsureVotingMembersCount, EnsureVotingMembersExcluding)

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="test/extended/etcd/helpers/helpers.go"

echo "== Relevant declarations =="
ast-grep outline "$file" --items all --type function --match 'GetVotingMemberNames|EnsureVotingMembersCount|EnsureVotingMembersExcluding' --view expanded || true

echo
echo "== Relevant log statements and function context on PR branch =="
rg -n -C 8 'func (GetVotingMemberNames|EnsureVotingMembersCount|EnsureVotingMembersExcluding)\b|framework\.Logf' "$file"

echo
echo "== PR merge base and changed hunks =="
base="$(git merge-base HEAD origin/master 2>/dev/null || git merge-base HEAD origin/main 2>/dev/null || true)"
if [ -z "$base" ]; then
  echo "Could not determine merge base against origin/master or origin/main." >&2
  exit 1
fi
echo "Merge base: $base"
git diff --unified=20 "$base"...HEAD -- "$file"

Length of output: 15246


@IlanZuckerman You’re right. I verified the diff against the merge base: Current voting etcd members: %v was already present before this PR and was only moved into the polling callback. The existing etcd helpers also log comparable member details.

This sensitive-log finding is out of scope for this change, so I’m withdrawing it.


✏️ Learnings added
Learnt from: IlanZuckerman
URL: https://github.com/openshift/origin/pull/31445

Timestamp: 2026-07-29T12:15:16.291Z
Learning: In `test/extended/etcd/helpers/helpers.go`, etcd test helpers such as `GetVotingMemberNames` and `EnsureVotingMembersExcluding` intentionally log voting-member names and related endpoint details for test diagnostics. When reviewing changes to these helpers, do not flag an existing logging pattern as newly introduced unless the PR adds or expands the sensitive output.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@IlanZuckerman You’re right—the logged voting-member list was pre-existing and this PR only relocates it into the retry loop. The same diagnostic pattern is already used across the etcd helpers, so this is not a newly introduced sensitive-data regression.

Withdrawing this finding.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@IlanZuckerman You’re right—the voting-member list log was present before this PR and is only relocated into the retry loop. Comparable diagnostic logging already exists in the other etcd helpers, so this change does not introduce or expand sensitive output.

Withdrawing this finding.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@IlanZuckerman

Copy link
Copy Markdown
Author

@IlanZuckerman: 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-fips fd9cc13 link true /test e2e-aws-ovn-fips
ci/prow/e2e-gcp-ovn fd9cc13 link true /test e2e-gcp-ovn
ci/prow/e2e-vsphere-ovn-upi fd9cc13 link true /test e2e-vsphere-ovn-upi
Full PR test history. Your PR dashboard.

Details

/retest

@IlanZuckerman

Copy link
Copy Markdown
Author

@IlanZuckerman: This pull request references Jira Issue OCPBUGS-98719, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

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.

Details

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 2, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@IlanZuckerman: This pull request references Jira Issue OCPBUGS-98719, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

@IlanZuckerman: This pull request references Jira Issue OCPBUGS-98719, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

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.

Details

/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.

@IlanZuckerman

Copy link
Copy Markdown
Author

This fix should be back ported to to 4.19 → 4.23. I will do so after the initial CR.

@ekuris-redhat ekuris-redhat left a comment

Copy link
Copy Markdown

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 Aug 2, 2026
@IlanZuckerman

Copy link
Copy Markdown
Author

/jira backport release-4.23,release-4.22,release-4.21,release-4.20,release-4.19

@openshift-ci-robot

Copy link
Copy Markdown

@IlanZuckerman: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.23
/cherrypick release-4.22
/cherrypick release-4.21
/cherrypick release-4.20
/cherrypick release-4.19

Details

In response to this:

/jira backport release-4.23,release-4.22,release-4.21,release-4.20,release-4.19

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-cherrypick-robot

Copy link
Copy Markdown

@openshift-ci-robot: once the present PR merges, I will cherry-pick it on top of release-4.19, release-4.20, release-4.21, release-4.22, release-4.23 in new PRs and assign them to you.

Details

In response to this:

@IlanZuckerman: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.23
/cherrypick release-4.22
/cherrypick release-4.21
/cherrypick release-4.20
/cherrypick release-4.19

In response to this:

/jira backport release-4.23,release-4.22,release-4.21,release-4.20,release-4.19

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.

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.

@IlanZuckerman

Copy link
Copy Markdown
Author

/assign @dusk125
@dusk125 PTAL for /approve — already has /lgtm and green CI.

Comment thread test/extended/etcd/helpers/helpers.go Outdated
for _, member := range memberList.Members {
if !member.IsLearner {
votingMemberNames = append(votingMemberNames, member.Name)
memberCtx, cancel := context.WithTimeout(ctx, 15*time.Second)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

parameter representing timeout in seconds probably should be defined as a variable just like waitPollTimeout, to be coherent with the call in line 453.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks @gryf , that makes sense. I added a new var memberListTimeout

@gryf gryf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly it is looking good, just one remark.

@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@IlanZuckerman: This pull request references Jira Issue OCPBUGS-98719, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

GetVotingMemberNames previously failed immediately when NewEtcdClient or MemberList errored, which is flaky during master replacement while etcd is restarting and port-forwards drop.
Poll and retry those transient errors instead of failing the CPMS OnDelete scaling test on the first attempt.

Summary by CodeRabbit

  • Bug Fixes
  • Improved reliability when retrieving etcd voting member information during transient connection failures or restarts.
  • Added polling and retry behavior so temporary port-forward or client errors no longer cause immediate failures.

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 added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Aug 3, 2026

@gryf gryf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ekuris-redhat, gryf, IlanZuckerman
Once this PR has been reviewed and has the lgtm label, please ask for approval from dusk125. For more information see the Code Review Process.

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

Details 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

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@IlanZuckerman

Copy link
Copy Markdown
Author

@IlanZuckerman: 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-microshift 4800f55 link true /test e2e-aws-ovn-microshift
ci/prow/e2e-gcp-ovn 4800f55 link true /test e2e-gcp-ovn
ci/prow/e2e-gcp-ovn-upgrade 4800f55 link true /test e2e-gcp-ovn-upgrade
Full PR test history. Your PR dashboard.

Details

/retest

@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@IlanZuckerman: all tests passed!

Full PR test history. Your PR dashboard.

Details

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid 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. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants