You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zmuxuny (via GitHub)" <gi...@apache.org> on 2026/09/17 12:12:46 UTC

[PR] fix(nameserver): preserve IPv6 zone identifier case [rocketmq-dashboard]

zmuxuny opened a new pull request, #4523:
URL: https://github.com/apache/rocketmq-dashboard/pull/4523

   ### Which Issue(s) This PR Fixes
   
   - Fixes #4520
   
   ### Brief Description
   
   `NamesrvAddrParser.normalize` lowercased an entire bracketed IPv6 literal. For a scoped address such as `[FE80::1%ProdNIC]:9876`, that correctly normalized the hexadecimal address but also rewrote the named zone identifier to `prodnic`.
   
   Named IPv6 zone identifiers are interface identifiers rather than DNS names, so their spelling must be preserved. This change lowercases only the IPv6 address portion before `%` and keeps the zone identifier unchanged.
   
   Existing DNS host normalization, unscoped IPv6 normalization, numeric scope ids, separators, ports, and validation semantics remain unchanged.
   
   ### Red / Green Verification
   
   Baseline: `master@987b748e8f4f421c5cd3c4c4e51a064cc7e59f18`.
   
   Fail-before, Java 21:
   - Added the named-zone parser regression to the unmodified baseline.
   - `NamesrvAddrParserTest`: **18 tests, exactly 1 failure**.
   - Expected `[fe80::1%ProdNIC]:9876`, but current master produced `[fe80::1%prodnic]:9876`.
   
   Green, Java 21:
   - `NamesrvAddrParserTest,NameserverRegistryServiceTest`: **40/40 passed**, 0 failures/errors.
   - Parser coverage includes named zones and numeric scope ids.
   - Registry coverage verifies both create and update preserve named-zone casing before persistence.
   - Checkstyle: **0 violations**.
   - `mvn -B -ntp -DskipTests package`: **BUILD SUCCESS**.
   - `git diff --check`: clean.
   
   ### Compatibility / Risk
   
   Only characters after the IPv6 `%` scope separator stop being lowercased. Unscoped IPv6 addresses continue to normalize to lowercase, numeric scope ids are unchanged, and non-IPv6 host normalization is untouched.
   
   No API, schema, dependency, or frontend changes.
   
   AI-assisted source audit, implementation and regression authoring; fail-before and green verification were executed locally against the stated baseline.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(nameserver): preserve IPv6 zone identifier case [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #4523:
URL: https://github.com/apache/rocketmq-dashboard/pull/4523#issuecomment-5761156513

   Thanks — the defect is real and your diagnosis of it is correct.
   
   `NamesrvAddrParser.normalize` lowercased the whole bracketed IPv6 literal, so `[FE80::1%ProdNIC]:9876` was persisted as `%prodnic`. A named zone identifier is an interface name and is case-sensitive: the JDK's scoped-address resolution matches it against `NetworkInterface.getName()`, so folding its case can point at a different interface or at none. The precondition also holds — `commons-validator` 1.10.0, which `server/pom.xml` pins, explicitly strips the zone before validating (`isValidInet6Address` splits on `%` and checks the zone against `[^\s/%]+`), so a mixed-case zone passes validation and then reaches the lowercasing line. Extracting `normalizeIpv6Literal` was a tidy way to express it, your four new tests are mutation-sensitive, and leaving the DNS-hostname branch lowercased is correct since hostnames are case-insensitive.
   
   We are closing this as a duplicate of #4522, which fixes the same line the same way and has now been merged. #4522 was opened 22 minutes before this PR (11:50 UTC against 12:12 UTC on 2026-09-17), so this is a straightforward first-come call rather than a quality judgement — the two patches are semantically equivalent, differing only in that #4522 inlines the split while this one extracts a helper. #4522 also converted the two existing `NameserverRegistryServiceTest` cases to `@ParameterizedTest`, and its parser case asserts zone preservation, multi-separator normalization and DNS lowercasing in one pass.
   
   Only one implementation of the zone split can live in `NamesrvAddrParser`, so we are keeping the one that landed.
   
   Your issue #4520 and the registry-level tests you added were useful independent corroboration of the same bug — thank you for that. Please do take a look at #4522 as merged; if you spot anything it misses, a follow-up is welcome.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(nameserver): preserve IPv6 zone identifier case [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #4523: fix(nameserver): preserve IPv6 zone identifier case
URL: https://github.com/apache/rocketmq-dashboard/pull/4523


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org