Skip to content

feat(ipv6): support IPv6 and dual-stack pods for engine and replica#492

Merged
derekbit merged 2 commits into
longhorn:mainfrom
COLDTURNIP:10928-v2-engine-ipv6
Apr 24, 2026
Merged

feat(ipv6): support IPv6 and dual-stack pods for engine and replica#492
derekbit merged 2 commits into
longhorn:mainfrom
COLDTURNIP:10928-v2-engine-ipv6

Conversation

@COLDTURNIP
Copy link
Copy Markdown
Member

@COLDTURNIP COLDTURNIP commented Mar 30, 2026

Replace hardcoded IPv4 address family with dynamic detection using net.ParseIP across engine, replica, and util modules.

Which issue(s) this PR fixes:

Issue longhorn/longhorn#10928

What this PR does / why we need it:

To make v2 data engine supports IPv6. This change dependent to longhorn/go-spdk-helper#276

Special notes for your reviewer:

Additional documentation or context

@COLDTURNIP COLDTURNIP self-assigned this Mar 30, 2026
@derekbit
Copy link
Copy Markdown
Member

derekbit commented Apr 8, 2026

Hello @COLDTURNIP
You can continue the development. The engine separation PR is merged. Thanks.

@COLDTURNIP COLDTURNIP force-pushed the 10928-v2-engine-ipv6 branch from 0753a96 to 62773f3 Compare April 9, 2026 01:47
@COLDTURNIP COLDTURNIP force-pushed the 10928-v2-engine-ipv6 branch 2 times, most recently from f267ece to c11f4a9 Compare April 22, 2026 07:05
@COLDTURNIP COLDTURNIP requested a review from Copilot April 22, 2026 07:07
@COLDTURNIP COLDTURNIP marked this pull request as ready for review April 22, 2026 07:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to enable IPv6 and dual-stack pod support in the SPDK engine/replica path by removing IPv4-only assumptions and selecting NVMe/TCP address family dynamically.

Changes:

  • Use a detected NVMe-oF address family (IPv4 vs IPv6) when attaching NVMe controllers and setting listener ANA state.
  • Relax replica-side exposed-port detection and engine-side NVMe transport validation to no longer require IPv4.
  • Add unit tests for exposed port selection and address-family detection.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/spdk/util.go Uses detected address family for BdevNvmeAttachController instead of hardcoding IPv4.
pkg/spdk/engine.go Uses detected address family for ANA-state RPC + replica attach during restore; relaxes IPv4-only transport validation.
pkg/spdk/replica.go Stops filtering exposed ports by IPv4-only listeners (accepts IPv6).
pkg/spdk/util_test.go Adds test validating address-family detection behavior.
pkg/spdk/engine_test.go Adds tests for getExposedPort behavior across IPv4/IPv6 and non-TCP listeners.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/spdk/util.go
Comment thread pkg/spdk/engine.go
Comment thread pkg/spdk/engine.go
Comment thread pkg/spdk/util_test.go
Comment thread pkg/spdk/engine.go
Comment thread pkg/spdk/engine_test.go Outdated
@COLDTURNIP COLDTURNIP force-pushed the 10928-v2-engine-ipv6 branch 2 times, most recently from 0c69ac3 to 9b2bb45 Compare April 23, 2026 08:36
@derekbit
Copy link
Copy Markdown
Member

@COLDTURNIP CI failed,

@COLDTURNIP
Copy link
Copy Markdown
Member Author

@COLDTURNIP CI failed,

It seems to be the upstream package resolving issue. Zypper package systemd-presets-branding-SLE is resolved as systemd-presets-branding-SLE-15.1-160099.8.1.noarch, and the %posttrans is broken.

@COLDTURNIP
Copy link
Copy Markdown
Member Author

@COLDTURNIP CI failed,

It seems to be the upstream package resolving issue. Zypper package systemd-presets-branding-SLE is resolved as systemd-presets-branding-SLE-15.1-160099.8.1.noarch, and the %posttrans is broken.

Blocked by: longhorn/longhorn#12971

Signed-off-by: Raphanus Lo <yunchang.lo@suse.com>
longhorn-10928

Signed-off-by: Raphanus Lo <yunchang.lo@suse.com>
@derekbit derekbit force-pushed the 10928-v2-engine-ipv6 branch from 9b2bb45 to d665066 Compare April 24, 2026 10:27
Copy link
Copy Markdown
Member

@derekbit derekbit left a comment

Choose a reason for hiding this comment

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

LGTM

@derekbit derekbit merged commit e899814 into longhorn:main Apr 24, 2026
7 of 9 checks passed
@COLDTURNIP COLDTURNIP deleted the 10928-v2-engine-ipv6 branch May 5, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants