Siyao Meng created HDDS-17136:
---------------------------------
Summary: Match user-supplied IPv6 datanode addresses regardless of
their text form
Key: HDDS-17136
URL: https://issues.apache.org/jira/browse/HDDS-17136
Project: Apache Ozone
Issue Type: Bug
Reporter: Siyao Meng
SCM records a datanode's IP address with {{InetAddress.getHostAddress()}}. For
IPv6 the JDK returns the full form without zero compression, for example
{{2001:db8:0:0:0:0:0:1}}. Several commands and services compare a user-supplied
address with that stored string. An operator who types the usual compressed
form {{2001:db8::1}} silently matches nothing.
Affected comparisons:
* {{ozone admin datanode list --ip}}: {{ListInfoSubcommand}} compares strings
with {{compareToIgnoreCase}}.
* Decommission status by IP: {{DecommissionUtils.getDecommissioningNodesList}}.
* Container balancer include and exclude lists:
{{ContainerBalancerClusterAnalyzer.shouldExcludeDatanode}}, and
{{ContainerBalancer}} through {{SCMNodeManager.getNodesByAddress}}.
* {{ozone admin datanode usageinfo --address}}: {{SCMClientProtocolServer}} ->
{{SCMNodeManager.getNodesByAddress}}, an exact key lookup in {{dnsToDnIdMap}}.
Not affected:
* {{NodeDecommissionManager}} resolves the input with {{InetAddress.getByName}}
before the lookup, so the forms match.
* Internal callers that pass a JDK-formatted remote address, such as
{{SCMBlockProtocolServer}} and {{KeyManagerImpl.getClientNode}}, produce the
same full form.
h3. Decision needed
# Normalize at each comparison, for example with Guava
{{InetAddresses.forString}} when both values are IP literals. Stored and
displayed values stay unchanged.
# Store the RFC 5952 compressed form ({{InetAddresses.toAddrString}})
everywhere SCM and datanodes record an IP. This also improves display, but it
changes persisted and published values and the keys used by internal callers.
It needs a compatibility review.
Option 1 is smaller and has no compatibility impact.
Parent epic: HDDS-15763.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]