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

[jira] [Work logged] (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?focusedWorklogId=381208&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-381208 ]

ASF GitHub Bot logged work on CURATOR-551:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Feb/20 22:15
            Start Date: 03/Feb/20 22:15
    Worklog Time Spent: 10m 
      Work Description: Randgalt commented on pull request #345: [CURATOR-551] Fix Handle Holder new connection string
URL: https://github.com/apache/curator/pull/345
 
 
   Commit 26364c6186fc7c09a9462557b1ca791e9aa70006 (Sat Sep 26 13:13:02 2015) changed HandleHolder.getNewConnectionString() was changed to return the new connection string instead of just a boolean. I believe the value returned should have been ensembleProvider.getConnectionString() not helper.getConnectionString(). TBH I no longer remember the genesis of this change but I can't make the current implementation make sense.
   
   Additionally, a change was made to optionally call zooKeeper.updateServerList(). When this path is taken the handle holder's connection needs to be updated as well or we'll get an infinite loop of changes. The path that runs when ensembleProvider.updateServerListEnabled() is false ends up setting handle holder's connection to ensembleProvider.getConnectionString().
   
   I'm loathe to make such low level changes in code that's existed for a long time. But, my investigation shows that this is how it should be. Hopefully, users can do testing.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 381208)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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
>          Time Spent: 10m
>  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)