You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "Jordan Zimmerman (Jira)" <ji...@apache.org> on 2020/02/12 22:09:00 UTC

[jira] [Resolved] (CURATOR-551) Curator client always call updateServerList with original serverList value, not the ones updated by EnsembleTracker

     [ https://issues.apache.org/jira/browse/CURATOR-551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jordan Zimmerman resolved CURATOR-551.
--------------------------------------
    Fix Version/s: 4.3.0
       Resolution: Fixed

> Curator client always call updateServerList with original serverList value, not the ones updated by EnsembleTracker
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: CURATOR-551
>                 URL: https://issues.apache.org/jira/browse/CURATOR-551
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Client
>    Affects Versions: 4.2.0
>            Reporter: kelgon wu
>            Assignee: Jordan Zimmerman
>            Priority: Major
>             Fix For: 4.3.0
>
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> Whenever ConnectionState.handleNewConnectionString is triggered, the value of  newConnectionString is always the value used to construct the FixedEnsembleProvider
>  
> in ConnectionState:
> {code:java}
> String newConnectionString = zooKeeper.getNewConnectionString();
> if ( newConnectionString != null ) {
>     handleNewConnectionString(newConnectionString);
> }
> ...
> if ( ensembleProvider.updateServerListEnabled() ) {
>     zooKeeper.updateServerList(newConnectionString);
> } else {
>     reset();
> }{code}
>  
> in HandleHolder:
> {code:java}
> String getNewConnectionString() {
>     String helperConnectionString = (helper != null) ? helper.getConnectionString() : null;
>     return ((helperConnectionString != null) && !ensembleProvider.getConnectionString().equals(helperConnectionString)) ? helperConnectionString : null;
> }{code}
> code above shows that the newConnectionString is provided by helper.getConnectionString(), which only instantiated on first call of getZookeeper:
> {code:java}
> @Override
> public ZooKeeper getZooKeeper() throws Exception
> {
>     synchronized(this)
>     {
>         if ( zooKeeperHandle == null )
>         {
>             connectionString = ensembleProvider.getConnectionString();
>             zooKeeperHandle = zookeeperFactory.newZooKeeper(connectionString, sessionTimeout, watcher, canBeReadOnly);
>         }
> ...{code}
>  
> As a result, when I reconfig zookeeper serverList, curator client always call updateServerList with the initial value, not the ones I just reconfigured



--
This message was sent by Atlassian Jira
(v8.3.4#803005)