Skip to content

[feature](cloud) Support IPv6 binding in meta-service - #70572

Open
yackushevas wants to merge 1 commit into
apache:masterfrom
yackushevas:feature/cloud-ipv6
Open

yackushevas wants to merge 1 commit into
apache:masterfrom
yackushevas:feature/cloud-ipv6

Conversation

@yackushevas

@yackushevas yackushevas commented Nov 13, 2026 •

Copy link
Copy Markdown

feature Support IPv6 binding in meta-service

Background

doris_cloud networking is IPv4-only: inet_aton/uint32_t CIDR, sockaddr_in, AF_INET-only interface enumeration, and the brpc server binds 0.0.0.0.

What problem does this PR solve?

Issue Number: close #66701
Related PR: #14063 (IPv6 for BE/FE, cloud left out)
PR Type: Feature

Problem Summary: an IPv6 priority_networks (e.g. ::/0) crashes doris_cloud at startup, and even with a valid config the meta service cannot bind IPv6, forcing dual-stack in IPv6-only environments. Port the BE IPv6 implementation to cloud; IPv4 behavior unchanged.

Details

  • Scope: doris_cloud only (meta service, recycler).
  • Design: CIDR, InetAddress and get_host_port are ported from be/src/util; get_local_ip() follows BE BackendOptions semantics (the CIDR family selects IPv4/IPv6); the brpc starter binds get_service_bind_address() via butil::str2endpoint, as BE does; registry endpoints bracket IPv6 literals.
  • Usage: priority_networks = fd00::/64
  • Default behavior: unchanged for empty priority_networks (my_ip_cstr, 0.0.0.0).
  • Compatibility: loopback fallback stays 127.0.0.1 on dual-stack hosts; ::1 counts as loopback for enable_loopback_address_for_ms; the /0 mask is accepted (BE behavior).

Testing

  • New GetLocalHostIPv6Test in cloud/test/network_util_test.cpp.
  • The modified network_util.cpp, compiled standalone, ran against live dual-stack interfaces (::1, fe80::, a real fd00::/64 ULA): 12/12 selection/bind/format cases and 8/8 CIDR edge cases pass; ::/0 no longer crashes.
  • run-cloud-ut.sh on a Linux stand: in progress (stand toolchain issues, unrelated to this change); CI validates.

Notes for Reviewers

A loopback address can now be selected directly by a CIDR (BE semantics; the returned string is unchanged, e.g. 127.0.0.1/8). str2endpoint("[::0]", port) is valid in brpc 1.4.0: ExtendedEndPoint::create parses the bracketed form before the IPv4-only str2ip path. In a mixed-version window, an old binary reading a new IPv6 registry entry dials "fd00::1:5000" (no brackets) and skips that best-effort peer refresh; non-fatal and self-healing after the rolling upgrade.

Release note

doris_cloud supports IPv6 priority_networks and binds [::0] when IPv6 is selected, enabling IPv6-only storage-compute deployments without dual-stack workarounds.

Check List (For Author)

  • Behavior changed: Yes (see Details).
  • Does this need documentation: No (priority_networks semantics match the BE documentation).
  • Pre-submission status: Partially verified: standalone runtime checks passed; cloud UT running on a stand and in CI.

AI Disclosure

  • Tool: OpenCode (GLM-5.3).
  • Generated: Code, tests and this description.
  • Human review: Diff reviewed by the author across multiple review passes.

### Background

doris_cloud networking is IPv4-only: inet_aton/uint32_t CIDR, sockaddr_in, AF_INET-only interface enumeration, and the brpc server binds 0.0.0.0.

### What problem does this PR solve?

Issue Number: close apache#66701
Related PR: apache#14063 (IPv6 for BE/FE, cloud left out)
PR Type: Feature

Problem Summary: an IPv6 priority_networks (e.g. ::/0) crashes doris_cloud at startup, and even with a valid config the meta service cannot bind IPv6, forcing dual-stack in IPv6-only environments. Port the BE IPv6 implementation to cloud; IPv4 behavior unchanged.

### Details

- **Scope:** doris_cloud only (meta service, recycler).
- **Design:** CIDR, InetAddress and get_host_port are ported from be/src/util; get_local_ip() follows BE BackendOptions semantics (the CIDR family selects IPv4/IPv6); the brpc starter binds get_service_bind_address() via butil::str2endpoint, as BE does; registry endpoints bracket IPv6 literals.
- **Usage:** priority_networks = fd00::/64
- **Default behavior:** unchanged for empty priority_networks (my_ip_cstr, 0.0.0.0).
- **Compatibility:** loopback fallback stays 127.0.0.1 on dual-stack hosts; ::1 counts as loopback for enable_loopback_address_for_ms; the /0 mask is accepted (BE behavior).

### Testing

- New GetLocalHostIPv6Test in cloud/test/network_util_test.cpp.
- The modified network_util.cpp, compiled standalone, ran against live dual-stack interfaces (::1, fe80::, a real fd00::/64 ULA): 12/12 selection/bind/format cases and 8/8 CIDR edge cases pass; ::/0 no longer crashes.
- run-cloud-ut.sh on a Linux stand: in progress (stand toolchain issues, unrelated to this change); CI validates.

### Notes for Reviewers

A loopback address can now be selected directly by a CIDR (BE semantics; the returned string is unchanged, e.g. 127.0.0.1/8). str2endpoint("[::0]", port) is valid in brpc 1.4.0: ExtendedEndPoint::create parses the bracketed form before the IPv4-only str2ip path.

### Release note

doris_cloud supports IPv6 priority_networks and binds [::0] when IPv6 is selected, enabling IPv6-only storage-compute deployments without dual-stack workarounds.

### Check List (For Author)

- Behavior changed: Yes (see Details).
- Does this need documentation: No (priority_networks semantics match the BE documentation).
- Pre-submission status: Partially verified: standalone runtime checks passed; cloud UT running on a stand and in CI.

### AI Disclosure

- Tool: OpenCode (GLM-5.3).
- Generated: Code, tests and this description.
- Human review: Diff reviewed by the author across multiple review passes.
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.

[Feature] Support IPv6 binding in cloud/meta-service (doris_cloud)

1 participant