You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Kezhu Wang (Jira)" <ji...@apache.org> on 2022/07/19 10:21:00 UTC

[jira] [Commented] (CURATOR-593) EnsembleTracker "configToConnectionString" method doesn't include zookeeper chroot

    [ https://issues.apache.org/jira/browse/CURATOR-593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17568454#comment-17568454 ] 

Kezhu Wang commented on CURATOR-593:
------------------------------------

Duplicated by CURATOR-611 which tagged affects version "5.1.0". The situation got worse in 5.2.0 which updated zookeeper to 3.6.3 where ZOOKEEPER-4565 was introduced. So, basically we have to fix both ZOOKEEPER-4565 and this to fix this issue.

> EnsembleTracker  "configToConnectionString" method doesn't include zookeeper chroot
> -----------------------------------------------------------------------------------
>
>                 Key: CURATOR-593
>                 URL: https://issues.apache.org/jira/browse/CURATOR-593
>             Project: Apache Curator
>          Issue Type: Bug
>            Reporter: Yang
>            Assignee: Jordan Zimmerman
>            Priority: Major
>
> The bug was found on curator 4.2 version and it's still in the master branch.
> It can be reproduced by running a zookeeper quorum 
> If you have a zookeeper connection string *localhost:2181/foobar* and using curator library. 
> [EnsembleTracker.configToConnectionString|https://github.com/apache/curator/blob/master/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java#L168] will try to re-build the zookeeper connection string by using all the hosts in the quorum into the connection string(*127.0.0.1:2181,127.0.0.1:2182/*), but doesn't include zookeeper zk_chroot when reconstructing connection string. 
> It's normally fine because it's not in-used, but when there is a session timeout trigger zookeeper watcher [expire|https://github.com/apache/curator/blob/master/curator-client/src/main/java/org/apache/curator/ConnectionState.java#L255]  ConnectionState class will try to reset the connection by using [HandleHolder.getZooKeepe|https://github.com/Honglun/curator/blob/master/curator-client/src/main/java/org/apache/curator/HandleHolder.java#L87]r , the new connection string generated by above [EnsembleTracker.configToConnectionString|https://github.com/apache/curator/blob/master/curator-framework/src/main/java/org/apache/curator/framework/imps/EnsembleTracker.java#L168]  method will be in-use during the reconnect.
> so it will try to connect to *127.0.0.1:2181,127.0.0.1:2182 (without /foobar zh_chroot)* 
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)