Skip to content

OCPEDGE-2381: Validate no WAL corruption when both nodes shutdown gracefully#30925

Open
kasturinarra wants to merge 1 commit intoopenshift:mainfrom
kasturinarra:automate_case_86430
Open

OCPEDGE-2381: Validate no WAL corruption when both nodes shutdown gracefully#30925
kasturinarra wants to merge 1 commit intoopenshift:mainfrom
kasturinarra:automate_case_86430

Conversation

@kasturinarra
Copy link
Copy Markdown
Contributor

No description provided.

@openshift-ci-robot
Copy link
Copy Markdown

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 the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 24, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 24, 2026

@kasturinarra: This pull request references OCPEDGE-2381 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.22.0" version, but no target version was set.

Details

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Walkthrough

A new test case is added to the etcd recovery suite that triggers graceful reboots on both nodes, waits 90 seconds, validates etcd recovery state with expected member roles, and verifies the openshift-etcd container is running on both nodes.

Changes

Cohort / File(s) Summary
Etcd Recovery Testing
test/extended/two_node/tnf_recovery.go
Adds a Ginkgo test for simultaneous graceful shutdown of both nodes: triggers graceful reboots, waits 90s, calls validateEtcdRecoveryState(...) with expected started/survived voting member roles, verifies openshift-etcd container is running on both nodes, and adds strings import.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci bot requested review from jaypoulz and jeff-roche March 24, 2026 09:38
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/extended/two_node/tnf_recovery.go (1)

413-435: Avoid a second copy of this suite block.

This repeats the Describe/BeforeEach above, and the copy has already drifted by dropping [OCPFeatureGate:DualReplica]. Please add the new It to the existing suite instead so markers and setup stay in one place.

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/two_node/tnf_recovery.go` around lines 413 - 435, There is a
duplicated Describe/BeforeEach block for the "[sig-etcd] Two Node with Fencing
etcd recovery" suite; remove the second Describe block and instead add the new
test It into the original suite so setup and markers (including the
[OCPFeatureGate:DualReplica] tag) remain intact. Locate the duplicate
Describe(...) block that defines oc, etcdClientFactory, peerNode, targetNode and
its BeforeEach, delete that duplicated Describe/BeforeEach, and move the new It
test body into the existing Describe that already declares oc and uses
BeforeEach/etcdClientFactory so the markers and shared setup are not dropped.
Ensure the moved It references the same oc, etcdClientFactory, peerNode and
targetNode variables and keep all original markers on the suite.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/two_node/tnf_recovery.go`:
- Around line 449-463: The test currently calls
validateEtcdRecoveryState(targetNode, peerNode, ...) without first proving the
scheduled reboots actually happened; capture each node's pre-disruption boot-id
(e.g., via exutil.DebugNodeRetryWithOptionsAndChroot calling "cat
/proc/sys/kernel/random/boot_id") before issuing "shutdown -r 1", then poll both
nodes after the disruption and wait until their boot-id values have changed
(with a timeout) before calling validateEtcdRecoveryState; place this boot-id
capture and change-check around the existing shutdown/recovery logic and use the
same targetNode and peerNode identifiers so the test fails if a node never
rebooted.

---

Nitpick comments:
In `@test/extended/two_node/tnf_recovery.go`:
- Around line 413-435: There is a duplicated Describe/BeforeEach block for the
"[sig-etcd] Two Node with Fencing etcd recovery" suite; remove the second
Describe block and instead add the new test It into the original suite so setup
and markers (including the [OCPFeatureGate:DualReplica] tag) remain intact.
Locate the duplicate Describe(...) block that defines oc, etcdClientFactory,
peerNode, targetNode and its BeforeEach, delete that duplicated
Describe/BeforeEach, and move the new It test body into the existing Describe
that already declares oc and uses BeforeEach/etcdClientFactory so the markers
and shared setup are not dropped. Ensure the moved It references the same oc,
etcdClientFactory, peerNode and targetNode variables and keep all original
markers on the suite.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1c865daf-4792-4b5c-b9f9-dcd740484608

📥 Commits

Reviewing files that changed from the base of the PR and between 02f8514 and 011bd7f.

📒 Files selected for processing (1)
  • test/extended/two_node/tnf_recovery.go

@openshift-ci-robot
Copy link
Copy Markdown

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

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/retest

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-dualstack-recovery-techpreview

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Mar 24, 2026

@kasturinarra: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-dualstack-recovery-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/c7549270-27ad-11f1-9069-e5b6d1c3e863-0

Copy link
Copy Markdown
Contributor

@fonta-rh fonta-rh left a comment

Choose a reason for hiding this comment

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

Review: Minor structural suggestion

The test itself looks good — clean structure, correct use of validateEtcdRecoveryState, and the podman container check is a nice addition.

One suggestion: consider moving the It block into the existing Describe block (line 73) rather than creating a new one. The new Describe at line 413 duplicates the var declarations and BeforeEach setup, and drops the [OCPFeatureGate:DualReplica] label that every other test in this file carries.

Moving it in would:

  • Restore the [OCPFeatureGate:DualReplica] label (used by promotion tracking tooling)
  • Eliminate ~25 lines of duplicated setup code
  • Follow the same pattern as the other non-hypervisor tests (graceful, ungraceful, network disruption) which coexist in that block alongside [Requires:HypervisorSSHConfig] tests

Everything else (the 90s sleep, the sequential reboot triggering, the final-state-only validation) follows the established patterns in this file.

@fonta-rh
Copy link
Copy Markdown
Contributor

fonta-rh commented Apr 9, 2026

/hold to review comments

@fonta-rh
Copy link
Copy Markdown
Contributor

fonta-rh commented Apr 9, 2026

/lgtm

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 9, 2026
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2026
@kasturinarra kasturinarra force-pushed the automate_case_86430 branch from 011bd7f to ee9cd82 Compare April 9, 2026 11:48
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
test/extended/two_node/tnf_recovery.go (1)

427-431: ⚠️ Potential issue | 🟠 Major

Ensure both node reboots are observed before accepting recovery

Line 428 validates a steady-state membership shape (started && !learner) that can already be true before disruption. If a scheduled reboot is skipped/delayed, this test can still pass without exercising the double-reboot/WAL-recovery path.

Suggested fix
 		g.By("Waiting for graceful shutdown to take effect (shutdown -r 1 schedules reboot in 1 minute)")
 		time.Sleep(90 * time.Second)
 
+		g.By("Waiting for both nodes to report a reboot")
+		o.Eventually(func() error {
+			for _, node := range []*corev1.Node{&targetNode, &peerNode} {
+				rebooted, err := utils.HasNodeRebooted(oc, node)
+				if err != nil {
+					return err
+				}
+				if !rebooted {
+					return fmt.Errorf("node %s has not rebooted yet", node.Name)
+				}
+			}
+			return nil
+		}, membersHealthyAfterDoubleReboot, utils.FiveSecondPollInterval).ShouldNot(o.HaveOccurred())
+
 		g.By(fmt.Sprintf("Waiting for both etcd members to become healthy (timeout: %v)", membersHealthyAfterDoubleReboot))
 		validateEtcdRecoveryState(oc, etcdClientFactory,
 			&targetNode,

As per coding guidelines, "**: Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/two_node/tnf_recovery.go` around lines 427 - 431, Before
calling validateEtcdRecoveryState, explicitly wait and assert that both reboots
were actually observed for targetNode and peerNode (do not rely on the
steady-state check alone); add a pre-check that polls until each node shows the
expected reboot marker (e.g., incremented reboot count or the node/machine
status annotation you use to detect a reboot) with the same
membersHealthyAfterDoubleReboot timeout and utils.FiveSecondPollInterval, and
only then call validateEtcdRecoveryState(targetNode, peerNode, ...); this
ensures a skipped/delayed reboot cannot make the test pass.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@test/extended/two_node/tnf_recovery.go`:
- Around line 427-431: Before calling validateEtcdRecoveryState, explicitly wait
and assert that both reboots were actually observed for targetNode and peerNode
(do not rely on the steady-state check alone); add a pre-check that polls until
each node shows the expected reboot marker (e.g., incremented reboot count or
the node/machine status annotation you use to detect a reboot) with the same
membersHealthyAfterDoubleReboot timeout and utils.FiveSecondPollInterval, and
only then call validateEtcdRecoveryState(targetNode, peerNode, ...); this
ensures a skipped/delayed reboot cannot make the test pass.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 698c637b-2491-432b-9358-322ee4c957c2

📥 Commits

Reviewing files that changed from the base of the PR and between 011bd7f and ee9cd82.

📒 Files selected for processing (1)
  • test/extended/two_node/tnf_recovery.go

@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

@fonta-rh
Copy link
Copy Markdown
Contributor

fonta-rh commented Apr 9, 2026

/lgtm

@fonta-rh
Copy link
Copy Markdown
Contributor

fonta-rh commented Apr 9, 2026

/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 9, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 9, 2026

@kasturinarra: 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.

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-dualstack-recovery-techpreview

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 9, 2026

@kasturinarra: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-dualstack-recovery-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/11699ea0-343d-11f1-9e16-74cf6366d2af-0

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-techpreview

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 10, 2026

@kasturinarra: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/02c33f20-34ae-11f1-9767-26657c4e57f4-0

@kasturinarra
Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-techpreview

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 10, 2026

@kasturinarra: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/d62d7880-34c2-11f1-83fa-4c9c0491063f-0

@eggfoobar
Copy link
Copy Markdown
Contributor

/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eggfoobar, fonta-rh, kasturinarra

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

The pull request process is described 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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 10, 2026
@kasturinarra
Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-recovery-techpreview

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 10, 2026

@kasturinarra: trigger 3 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-recovery-techpreview-1of3
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-recovery-techpreview-2of3
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-two-node-fencing-recovery-techpreview-3of3

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/e48fc380-34e8-11f1-9174-b44e85eef264-0

@jaypoulz
Copy link
Copy Markdown
Contributor

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 10, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@jaypoulz: This PR has been marked as verified by https://github.com/openshift/origin/pull/30925#issuecomment-4224435191.

Details

In response to this:

/verified by #30925 (comment)
Specifically, this run:
https://prow.ci.openshift.org/view/gs/test-platform-results/logs/openshift-origin-30925-nightly-4.22-e2e-metal-ovn-two-node-fencing-recovery-techpreview-3of3/2042609546345582592

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants