apache / apache/doris

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

Open
#66,701 0 comments 0 reactions 0 assignees View on GitHub
kind/feature
Dominant language
Java
Stars
15.9k
Forks
3.9k
Avg merge
2d 23h
Merged PRs (30d)
520

Description

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.

### Description

PR #14063 added IPv6 support to BE and FE, but the cloud component (doris_cloud / Meta Service) was not updated. The cloud component's network code in cloud/src/common/network_util.cpp is IPv4-only:

1. CIDR class uses uint32_t (32-bit) and inet_aton (IPv4 only) — cannot parse IPv6 addresses
2. InetAddress uses sockaddr_in (IPv4 only) — no sockaddr_in6 support
3. get_hosts_v4() only collects AF_INET addresses — ignores AF_INET6
4. BRPC server binds to 0.0.0.0 (IPv4) — no way to bind to [::] (IPv6)

Setting priority_networks with an IPv6 CIDR (e.g. ::/0 or fd00:b4c4::/32) causes a crash:
`F... network_util.cpp:187] wrong cidr format. cidr_str=::/0`

The fix is to port the IPv6 changes from be/src/util/cidr.cpp and be/src/service/backend_options.cpp (PR #14063) to the cloud component:
1. Update CIDR class — use inet_pton with AF_INET6, std::array for address storage
2. Update InetAddress — support sockaddr_in6 / sockaddr_storage
3. Update get_hosts_v4 — also collect AF_INET6 addresses
4. Update BRPC server initialization — bind to [::0] when priority_networks matches IPv6

### Use case

Deploying Doris in storage-compute separation mode in IPv6-only environments. The Meta Service (doris_cloud) only binds to 0.0.0.0 (IPv4), making it unreachable via IPv6. Without IPv6 support, we have to use dual-stack networking (IPv4+IPv6) as a workaround, which is not always available.

### Related issues

PR #14063 — [Feature](ipv6) Support IPV6 (added IPv6 to BE and FE, but not cloud)

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Research direction

Start with cloud/src/common/network_util.cpp and compare its CIDR and address handling with be/src/util/cidr.cpp and be/src/service/backend_options.cpp from PR #14063. Trace the BRPC server initialization and verify that IPv6 CIDRs parse correctly, IPv6 addresses are discovered, and doris_cloud binds successfully to IPv6 in an IPv6-only environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, cloud, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.