Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-551

Curator client always call updateServerList with original serverList value, not the ones updated by EnsembleTracker

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.2.0
    • 4.3.0
    • Client
    • None

    Description

      Whenever ConnectionState.handleNewConnectionString is triggered, the value of  newConnectionString is always the value used to construct the FixedEnsembleProvider

       

      in ConnectionState:

      String newConnectionString = zooKeeper.getNewConnectionString();
      if ( newConnectionString != null ) {
          handleNewConnectionString(newConnectionString);
      }
      
      ...
      
      if ( ensembleProvider.updateServerListEnabled() ) {
          zooKeeper.updateServerList(newConnectionString);
      } else {
          reset();
      }

       

      in HandleHolder:

      String getNewConnectionString() {
          String helperConnectionString = (helper != null) ? helper.getConnectionString() : null;
          return ((helperConnectionString != null) && !ensembleProvider.getConnectionString().equals(helperConnectionString)) ? helperConnectionString : null;
      }

      code above shows that the newConnectionString is provided by helper.getConnectionString(), which only instantiated on first call of getZookeeper:

      @Override
      public ZooKeeper getZooKeeper() throws Exception
      {
          synchronized(this)
          {
              if ( zooKeeperHandle == null )
              {
                  connectionString = ensembleProvider.getConnectionString();
                  zooKeeperHandle = zookeeperFactory.newZooKeeper(connectionString, sessionTimeout, watcher, canBeReadOnly);
              }
      ...

       

      As a result, when I reconfig zookeeper serverList, curator client always call updateServerList with the initial value, not the ones I just reconfigured

      Attachments

        Issue Links

          Activity

            People

              randgalt Jordan Zimmerman
              kelgonwu kelgon wu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h
                  3h