[
https://issues.apache.org/jira/browse/HBASE-29377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17956204#comment-17956204
]
Ronald Macmaster commented on HBASE-29377:
------------------------------------------
after the patch:
NOTE: I'm redacting our internal hostnames and replacing them with `localhost`
in the examples
{code:java}
bin/hbase chaosagent -c start
2025-06-04T22:35:57,097 INFO [main] chaos.ChaosService: arguments : [-c, start]
2025-06-04T22:35:57,102 INFO [main] chaos.ChaosService: [[[ option: c
chaosagent [ARG] :: expecting a start/stop argument :: class java.lang.String
], [ option: D GENERIC [ARG] :: generic D param :: class java.lang.String ]]]
2025-06-04T22:35:57,107 INFO [main] chaos.ChaosService: Starting the
ChaosAgent with hostname: localhost, quorum:
localhost:2181,localhost:2182,localhost:2183
2025-06-04T22:35:57,114 INFO [main] zookeeper.ZooKeeper: Client
environment:zookeeper.version=3.8.4-9316c2a7a97e1666d8f4593f34dd6fc36ecc436c,
built on 2024-02-12 22:16 UTC
2025-06-04T22:35:57,114 INFO [main] zookeeper.ZooKeeper: Client
environment:host.name=localhost
2025-06-04T22:35:57,114 INFO [main] zookeeper.ZooKeeper: Client
environment:java.version=21.0.6
2025-06-04T22:35:57,114 INFO [main] zookeeper.ZooKeeper: Client
environment:java.vendor=Eclipse Adoptium
2025-06-04T22:35:57,114 INFO [main] zookeeper.ZooKeeper: Client
environment:java.home=/java{code}
> ChaosService: Doesn't Support ZK Quorum Strings with Ports
> ----------------------------------------------------------
>
> Key: HBASE-29377
> URL: https://issues.apache.org/jira/browse/HBASE-29377
> Project: HBase
> Issue Type: Bug
> Components: integration tests
> Affects Versions: 2.5.11, 2.6.2
> Reporter: Ronald Macmaster
> Priority: Minor
> Labels: easyfix, pull-request-available
>
> 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)