Skip to content

Fix OVN-K Interconnect: Remove deprecated nexthop field - #4125

Merged
yboaron merged 2 commits into
submariner-io:develfrom
yboaron:fix-ovn-nexthop-deprecated-field
Aug 11, 2026
Merged

Fix OVN-K Interconnect: Remove deprecated nexthop field#4125
yboaron merged 2 commits into
submariner-io:develfrom
yboaron:fix-ovn-nexthop-deprecated-field

Conversation

@yboaron

@yboaron yboaron commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

OVN 26.03.3+ (OCP 4.21.27+, 4.22.6+) ignores Logical Router Policies that have the deprecated 'nexthop' (singular) field set, even when 'nexthops' (array) is correctly populated.

This causes RouteAgent health checks to fail because ovn-northd does not generate southbound flows for these policies, logging:
'policy uses deprecated column nexthop, this column is ignored'

Why not keep both fields?
Manual testing showed that when BOTH nexthop and nexthops are set, ovn-northd ignores the entire policy. Only when nexthop field is cleared (leaving only nexthops populated) does the southbound flow appear and RouteAgent health checks succeed.

Fixes: #4124

Summary by CodeRabbit

  • Bug Fixes
    • Improved logical router policy reconciliation for reliable next-hop handling.
    • Policy creation and updates now preserve next-hop information correctly.
    • Legacy policies with missing or outdated next-hop entries are detected and migrated automatically.
    • Improved route matching for different IP address families during gateway and non-gateway route reconciliation.
    • Enhanced migration handling to preserve routing behavior while removing outdated next-hop configurations.

OVN 26.03.3+ (OCP 4.21.27+, 4.22.6+) ignores Logical Router Policies
that have the deprecated 'nexthop' (singular) field set, even when
'nexthops' (array) is correctly populated.

This causes RouteAgent health checks to fail because ovn-northd does
not generate southbound flows for these policies, logging:
  'policy uses deprecated column nexthop, this column is ignored'

Why not keep both fields?
Manual testing showed that when BOTH nexthop and nexthops are set,
ovn-northd ignores the entire policy. Only when nexthop field is
cleared (leaving only nexthops populated) does the southbound flow
appear and RouteAgent health checks succeed.

Fixes: submariner-io#4124

Signed-off-by: Yossi Boaron <yboaron@redhat.com>
@submariner-bot

Copy link
Copy Markdown
Contributor

🤖 Created branch: z_pr4125/yboaron/fix-ovn-nexthop-deprecated-field
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Logical router policy reconciliation now uses the Nexthops slice. Legacy policies with deprecated Nexthop values are eligible for migration. Tests now validate IP-family-specific matches and next-hop migration.

Changes

Logical route policy reconciliation

Layer / File(s) Summary
Use Nexthops for policy reconciliation
pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go
Stale-policy validation detects legacy fields. Policy matching compares Nexthops. New policies set the next hop through Nexthops.
Validate legacy policy migration and IP-family matches
pkg/routeagent_driver/handlers/ovn/handler_test.go
Route policy tests use IP-family-specific matches and Nexthops. Migration coverage verifies that reconciliation clears deprecated Nexthop values while retaining the next hop.

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

Possibly related PRs

Suggested labels: release-note-needed

Suggested reviewers: tpantelis, vthapar, oats87

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: removing the deprecated OVN-K nexthop field.
Linked Issues check ✅ Passed The changes remove deprecated Nexthop usage, retain Nexthops, and add migration coverage for issue #4124.
Out of Scope Changes check ✅ Passed All production and test changes directly support the OVN nexthop migration objective in issue #4124.
Actionable Comments Resolved ✅ Passed The target commit explicitly addresses the CodeRabbit actionable comment; stale policies with deprecated Nexthop are migrated, and tests verify removal with Nexthops retained.

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.

@yboaron yboaron added backport This change requires a backport to eligible release branches bug Something isn't working ready-to-test When a PR is ready for full E2E testing labels Aug 10, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go`:
- Around line 116-118: The stale-policy predicate in the OVN logical route
reconciliation must also match policies whose legacy Nexthop field is non-nil,
even when Nexthops equals []string{nextHop}; update the condition around the
existing remoteSubnets and Nexthops checks to include that legacy-field state,
and add a regression test covering a managed policy with both Nexthop and
Nexthops populated.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e395212-0ec3-439c-abb8-3d5f19bcc0a2

📥 Commits

Reviewing files that changed from the base of the PR and between 7cb77d4 and 074ff3b.

📒 Files selected for processing (1)
  • pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go

Comment thread pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go Outdated
yboaron added a commit to yboaron/submariner that referenced this pull request Aug 10, 2026
Enhance stale policy detection to also match policies with the deprecated
Nexthop field set, even when Nexthops is correctly populated. This ensures
complete migration from old Submariner versions.

Add regression test that verifies:
- Old policies with both Nexthop (deprecated) and Nexthops (correct) set
- Are detected as stale and replaced during reconciliation
- New policies have only Nexthops field (Nexthop is nil)

Addresses: CodeRabbit actionable comment on PR submariner-io#4125
Signed-off-by: Yossi Boaron <yboaron@redhat.com>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/routeagent_driver/handlers/ovn/handler_test.go`:
- Around line 638-651: Update the reconciliation test around the existing policy
assertions to save the original oldPolicy.Nexthop pointer before reconciliation,
then call AwaitNoModel with the matching policy and deprecated Nexthop value to
verify the legacy policy is removed. Keep the existing assertions confirming the
replacement policy has Nexthops populated and Nexthop nil.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5e5fb236-fb34-423b-8ca4-912b4f196773

📥 Commits

Reviewing files that changed from the base of the PR and between 074ff3b and d843a6d.

📒 Files selected for processing (2)
  • pkg/routeagent_driver/handlers/ovn/handler_test.go
  • pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go

Comment thread pkg/routeagent_driver/handlers/ovn/handler_test.go Outdated
yboaron added a commit to yboaron/submariner that referenced this pull request Aug 10, 2026
Enhance stale policy detection to also match policies with the deprecated
Nexthop field set, even when Nexthops is correctly populated. This ensures
complete migration from old Submariner versions.

Add regression test that verifies:
- Old policies with both Nexthop (deprecated) and Nexthops (correct) set
- Are detected as stale and replaced during reconciliation
- New policies have only Nexthops field (Nexthop is nil)

Addresses: CodeRabbit actionable comment on PR submariner-io#4125
Signed-off-by: Yossi Boaron <yboaron@redhat.com>
@yboaron
yboaron force-pushed the fix-ovn-nexthop-deprecated-field branch from d843a6d to d756ecc Compare August 10, 2026 19:22
yboaron added a commit to yboaron/submariner that referenced this pull request Aug 10, 2026
Enhance stale policy detection to also match policies with the deprecated
Nexthop field set, even when Nexthops is correctly populated. This ensures
complete migration from old Submariner versions.

Add regression test that verifies:
- Old policies with both Nexthop (deprecated) and Nexthops (correct) set
- Are detected as stale and replaced during reconciliation
- New policies have only Nexthops field (Nexthop is nil)

Addresses: CodeRabbit actionable comment on PR submariner-io#4125
Signed-off-by: Yossi Boaron <yboaron@redhat.com>
@yboaron
yboaron force-pushed the fix-ovn-nexthop-deprecated-field branch from d756ecc to 7b3c173 Compare August 10, 2026 19:40

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/routeagent_driver/handlers/ovn/handler_test.go`:
- Around line 691-695: The fake OVN client’s logical router policy matching
ignores the expected Nexthops field, allowing replacement policies to match
incorrectly. Update hasModel and GetModel to reuse one shared matcher that
compares Nexthops when the expected model specifies it, while treating
unspecified fields as wildcards to preserve existing match-only lookups.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ce1f7be3-c300-49e8-96e6-fe063aa83540

📥 Commits

Reviewing files that changed from the base of the PR and between d756ecc and 7b3c173.

📒 Files selected for processing (1)
  • pkg/routeagent_driver/handlers/ovn/handler_test.go

Comment thread pkg/routeagent_driver/handlers/ovn/handler_test.go
yboaron added a commit to yboaron/submariner that referenced this pull request Aug 10, 2026
Enhance stale policy detection to also match policies with the deprecated
Nexthop field set, even when Nexthops is correctly populated. This ensures
complete migration from old Submariner versions.

Add regression test that verifies:
- Old policies with both Nexthop (deprecated) and Nexthops (correct) set
- Are detected as stale and replaced during reconciliation
- New policies have only Nexthops field (Nexthop is nil)

Addresses: CodeRabbit actionable comment on PR submariner-io#4125
Signed-off-by: Yossi Boaron <yboaron@redhat.com>
@yboaron
yboaron force-pushed the fix-ovn-nexthop-deprecated-field branch from 7b3c173 to 3bd8555 Compare August 10, 2026 20:02
yboaron added a commit to yboaron/submariner that referenced this pull request Aug 10, 2026
Enhance stale policy detection to also match policies with the deprecated
Nexthop field set, even when Nexthops is correctly populated. This ensures
complete migration from old Submariner versions.

Add regression test that verifies:
- Old policies with both Nexthop (deprecated) and Nexthops (correct) set
- Are detected as stale and replaced during reconciliation
- New policies have only Nexthops field (Nexthop is nil)

Addresses: CodeRabbit actionable comment on PR submariner-io#4125
Signed-off-by: Yossi Boaron <yboaron@redhat.com>
@yboaron
yboaron force-pushed the fix-ovn-nexthop-deprecated-field branch from 3bd8555 to 188961b Compare August 10, 2026 20:53
Enhance stale policy detection to also match policies with the deprecated
Nexthop field set, even when Nexthops is correctly populated. This ensures
complete migration from old Submariner versions.

Add regression test that verifies:
- Old policies with both Nexthop (deprecated) and Nexthops (correct) set
- Are detected as stale and replaced during reconciliation
- New policies have only Nexthops field (Nexthop is nil)

Addresses: CodeRabbit actionable comment on PR submariner-io#4125
Signed-off-by: Yossi Boaron <yboaron@redhat.com>
@yboaron
yboaron force-pushed the fix-ovn-nexthop-deprecated-field branch from 188961b to 5d667c9 Compare August 11, 2026 04:17
@yboaron
yboaron merged commit 14af23d into submariner-io:devel Aug 11, 2026
53 checks passed
@submariner-bot

Copy link
Copy Markdown
Contributor

🤖 Closed branches: [z_pr4125/yboaron/fix-ovn-nexthop-deprecated-field]

tpantelis pushed a commit that referenced this pull request Aug 11, 2026
Enhance stale policy detection to also match policies with the deprecated
Nexthop field set, even when Nexthops is correctly populated. This ensures
complete migration from old Submariner versions.

Add regression test that verifies:
- Old policies with both Nexthop (deprecated) and Nexthops (correct) set
- Are detected as stale and replaced during reconciliation
- New policies have only Nexthops field (Nexthop is nil)

Addresses: CodeRabbit actionable comment on PR #4125
Signed-off-by: Yossi Boaron <yboaron@redhat.com>
tpantelis pushed a commit that referenced this pull request Aug 17, 2026
Enhance stale policy detection to also match policies with the deprecated
Nexthop field set, even when Nexthops is correctly populated. This ensures
complete migration from old Submariner versions.

Add regression test that verifies:
- Old policies with both Nexthop (deprecated) and Nexthops (correct) set
- Are detected as stale and replaced during reconciliation
- New policies have only Nexthops field (Nexthop is nil)

Addresses: CodeRabbit actionable comment on PR #4125
Signed-off-by: Yossi Boaron <yboaron@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This change requires a backport to eligible release branches backport-handled bug Something isn't working ready-to-test When a PR is ready for full E2E testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OVN-K Interconnect: RouteAgent health checks fail on OCP 4.22.8+ due to deprecated nexthop field

3 participants