smengcl opened a new pull request, #8957:
URL: https://github.com/apache/hadoop/pull/8957

   Generated-by: Claude Code (Opus 5.5)
   
   JIRA: https://issues.apache.org/jira/browse/HADOOP-20072
   
   ### Description of PR
   
   `CachedDNSToSwitchMapping` normalizes every name with 
`NetUtils.normalizeHostName`, which gives the full IPv6 form without zero 
compression (`2001:db8:0:0:0:0:0:10`). `TableMapping` then does an exact string 
lookup against the keys as written in the table file, so an entry in the usual 
compressed form (`2001:db8::10`) or with uppercase hex never matched, and the 
node fell back to `/default-rack`.
   
   `RawTableMapping#load` now rewrites keys that are IP literals to that same 
form with Guava `InetAddresses` (no DNS lookup). Host name keys are kept as 
written. IPv4 literals and lowercase full form IPv6 keys map to themselves, so 
tables that work today behave the same.
   
   ### How was this patch tested?
   
   - `TestTableMapping#testResolveIPv6` (new): compressed and uppercase IPv6 
entries resolve for both compressed and full form names, an IPv6 address not in 
the table gets `/default-rack`, and an IPv4 entry still resolves. Fails on 
trunk, passes with the fix.
   - `TestTableMapping`, `TestStaticMapping`, `TestScriptBasedMapping` and 
`TestScriptBasedMappingWithDependency` pass.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to