Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5255

Extraneous zookeeper call in ZkStateReader cluster state watcher and setting wrong watcher

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.4, 4.5, 6.0
    • Fix Version/s: 4.5.1, 4.6, 6.0
    • Component/s: SolrCloud
    • Labels:

      Description

      In ZkStateReader.createClusterStateWatchersAndUpdate, in the watcher for the call to watch CLUSTER_STATE:

      List<String> liveNodes = zkClient.getChildren(
      LIVE_NODES_ZKNODE, this, true);

      Set<String> liveNodesSet = new HashSet<String>();
      liveNodesSet.addAll(liveNodes);

      The liveNodesSet set is never used in subsequent code, since the new cluster state is made from the live node set from the existing cluster state:

      Set<String> ln = ZkStateReader.this.clusterState.getLiveNodes();
      ClusterState clusterState = ClusterState.load(stat.getVersion(), data, ln);

      ...which is as it should since this is a watcher for cluster state (if live nodes changes, the watcher for live nodes will be invoked).

      Due to the above extraneous call, however, now the cluster state watcher (this) is also set on the LIVE_NODES_ZKNODE path, which is unnecessary to fire when live nodes changed.

        Attachments

          Activity

            People

            • Assignee:
              shalinmangar Shalin Shekhar Mangar
              Reporter:
              mewmewball Jessica Cheng Mallet
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: