You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "xiaoyekanren (via GitHub)" <gi...@apache.org> on 2026/04/28 06:54:18 UTC
[PR] Fix IPv6 address parsing in Ratis consensus Utils [iotdb]
xiaoyekanren opened a new pull request, #17567:
URL: https://github.com/apache/iotdb/pull/17567
## Problem
The address parsing methods in `Utils.java` use `split(":")` which cannot correctly handle IPv6 addresses like `[::1]:10710`. This causes:
- `NumberFormatException` when parsing empty string as port
- ConfigNode/DataNode startup failure when configured with IPv6 addresses
For IPv6 address `[::1]:10710`, `split(":")` produces:
- `items[0]` = `[`
- `items[1]` = `""` (empty string)
- `items[2]` = `1]`
- `items[3]` = `10710`
`Integer.parseInt("")` throws `NumberFormatException`.
## Solution
Modified three methods in `Utils.java`:
1. **`hostAddress()`** - Wrap IPv6 addresses in brackets `[ip]:port` format
2. **`fromRaftPeerAddressToTEndPoint()`** - Parse IPv6 format `[ipv6]:port` correctly
3. **`fromRaftPeerProtoToTEndPoint()`** - Parse IPv6 format correctly
## Test Plan
- Manual testing with IPv6 configuration (`cn_internal_address=::1`, `dn_rpc_address=::1`)
- Verify ConfigNode and DataNode can start successfully with IPv6 addresses
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE-xxxx] Fix IPv6 address parsing across server and client components [iotdb]
Posted by "Caideyipi (via GitHub)" <gi...@apache.org>.
Caideyipi commented on PR #17567:
URL: https://github.com/apache/iotdb/pull/17567#issuecomment-4610401444
Thanks for working on the IPv6 parsing fix. I found two issues that look worth addressing before merge:
1. Ratis still cannot read legacy unbracketed IPv6 peer addresses. `hostAddress()` now writes IPv6 as `[ip]:port`, but `fromRaftPeerAddressToTEndPoint()` and `fromRaftPeerProtoToTEndPoint()` still parse non-bracket addresses with `split(:)`. If a node has existing/persisted peer metadata from the previous format, e.g. `::1:10710`, recovery/redirect parsing will still hit the old `NumberFormatException`. It would be safer to parse the non-bracket path with the last colon as the port separator, or explicitly normalize legacy addresses during recovery.
2. The bracketed IPv6 branches do not verify that `]` is followed by `:`. Inputs such as `[::1]6667` are currently accepted and parsed as port `667` because the code blindly starts at `bracketEnd + 2`. This affects the Ratis utils, JDBC URL parser, and Python `Session.init_from_node_urls()`. Please validate the `]:` separator and reject empty/non-numeric ports.
Could you also add regression tests for `[::1]:port` plus malformed bracket inputs like `[::1]6667`, `[::1]:`, and missing `]`? JDBC already has URL parser tests, and Ratis `UtilsTest` would be a good place to lock down the server-side behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ISSUE-xxxx] Fix IPv6 address parsing across server and client components [iotdb]
Posted by "HTHou (via GitHub)" <gi...@apache.org>.
HTHou closed pull request #17567: [ISSUE-xxxx] Fix IPv6 address parsing across server and client components
URL: https://github.com/apache/iotdb/pull/17567
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org