[
https://issues.apache.org/jira/browse/HBASE-29377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tak-Lon (Stephen) Wu resolved HBASE-29377.
------------------------------------------
Resolution: Fixed
> ChaosService: Doesn't Support ZK Quorum Strings with Specified Ports
> --------------------------------------------------------------------
>
> Key: HBASE-29377
> URL: https://issues.apache.org/jira/browse/HBASE-29377
> Project: HBase
> Issue Type: Bug
> Components: integration tests
> Affects Versions: 4.0.0-alpha-1, 2.5.11, 2.6.2
> Reporter: Ronald Macmaster
> Assignee: Ronald Macmaster
> Priority: Minor
> Labels: easyfix, pull-request-available
> Fix For: 4.0.0-alpha-1, 2.7.0, 3.0.0-beta-2, 2.6.3
>
>
> The ChaosAgent doesn't support zookeeper quorum strings which specify custom
> ports. example
> {code:java}
> # hbase.zookeeper.quorum
> localhost:2181,localhost:2182,localhost:2183{code}
> When starting the chaosagent service, one will receive the following log
> messages. The ChaosAgent is setup with a modified zookeeper quorum string
> always appending hbase.zookeeper.property.clientPort (2181) to each quorum
> server - even though the original quorum prop already specifies a port.
> {code:java}
> bin/hbase chaosagent -c start
> 2025-06-04T19:27:39,932 INFO [main] zookeeper.ZooKeeper: Initiating client
> connection,
> connectString=localhost:2181:2181,localhost:2182:2181,localhost:2183:2181
> sessionTimeout=600000
> watcher=org.apache.hadoop.hbase.chaos.ChaosAgent@67389cb8
> 2025-06-04T21:42:38,698 INFO [main-EventThread] chaos.ChaosAgent: Processing
> event: WatchedEvent state:Closed type:None path:null
> 2025-06-04T21:42:38,697 ERROR [main-SendThread()] client.StaticHostProvider:
> Unable to resolve address: localhost:2181/<unresolved>:2181
> java.net.UnknownHostException: localhost:2181: invalid IPv6 address literal
> at
> java.net.InetAddress.invalidIPv6LiteralException(InetAddress.java:1693) ~[?:?]
> at java.net.InetAddress.getAllByName(InetAddress.java:1663) ~[?:?]
>
>
> at
> org.apache.zookeeper.client.StaticHostProvider$1.getAllByName(StaticHostProvider.java:88)
> ~[zookeeper-3.8.4.jar:3.8.4]
> at
> org.apache.zookeeper.client.StaticHostProvider.resolve(StaticHostProvider.java:141)
> ~[zookeeper-3.8.4.jar:3.8.4]
> at
> org.apache.zookeeper.client.StaticHostProvider.next(StaticHostProvider.java:368)
> ~[zookeeper-3.8.4.jar:3.8.4]
> at
> org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1204)
> ~[zookeeper-3.8.4.jar:3.8.4]{code}
> The behavior comes from the [getZKQuorum() method in the ChaosUtils
> class|https://github.com/apache/hbase/blob/d93102ccf631f11028d466acaa1ea3862c185b44/hbase-it/src/main/java/org/apache/hadoop/hbase/chaos/ChaosUtils.java#L36-L43]
> which is only used in the [ChaosService
> setup|https://github.com/apache/hbase/blob/d93102ccf631f11028d466acaa1ea3862c185b44/hbase-it/src/main/java/org/apache/hadoop/hbase/chaos/ChaosService.java#L79-L80].
> This approach deviates from the convention across other areas of the
> codebase that instead rely on the [ZKConfig helper
> methods|https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ReadOnlyZKClient.java#L136-L141]
> to fetch quorum strings.
> We should use the the ZKConfig methods instead which are used elsewhere and
> [account for the case where the port is already
> specified|https://github.com/apache/hbase/blob/d93102ccf631f11028d466acaa1ea3862c185b44/hbase-common/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKConfig.java#L165-L202]
> in configuration.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)