Solr
  1. Solr
  2. SOLR-5255

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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.

        Activity

        Hide
        ASF subversion and git services added a comment -

        Commit 1529433 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1529433 ]

        SOLR-5255: Remove unnecessary call to fetch and watch live nodes in ZkStateReader cluster watcher

        Show
        ASF subversion and git services added a comment - Commit 1529433 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1529433 ] SOLR-5255 : Remove unnecessary call to fetch and watch live nodes in ZkStateReader cluster watcher
        Hide
        ASF subversion and git services added a comment -

        Commit 1529434 from shalin@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1529434 ]

        SOLR-5255: Remove unnecessary call to fetch and watch live nodes in ZkStateReader cluster watcher

        Show
        ASF subversion and git services added a comment - Commit 1529434 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1529434 ] SOLR-5255 : Remove unnecessary call to fetch and watch live nodes in ZkStateReader cluster watcher
        Hide
        Shalin Shekhar Mangar added a comment -

        This is fixed. Thanks Jessica!

        Show
        Shalin Shekhar Mangar added a comment - This is fixed. Thanks Jessica!
        Hide
        ASF subversion and git services added a comment -

        Commit 1530861 from shalin@apache.org in branch 'dev/branches/lucene_solr_4_5'
        [ https://svn.apache.org/r1530861 ]

        SOLR-4590, SOLR-5295, SOLR-5296, SOLR-5263, SOLR-5297, SOLR-5301, SOLR-5255, SOLR-5305, SOLR-5314: Merging r1526616, r1528433, r1528441, r1528461, r1528488, r1529341, r1529434, r1529503, r1530268 from branch_4x

        Show
        ASF subversion and git services added a comment - Commit 1530861 from shalin@apache.org in branch 'dev/branches/lucene_solr_4_5' [ https://svn.apache.org/r1530861 ] SOLR-4590 , SOLR-5295 , SOLR-5296 , SOLR-5263 , SOLR-5297 , SOLR-5301 , SOLR-5255 , SOLR-5305 , SOLR-5314 : Merging r1526616, r1528433, r1528441, r1528461, r1528488, r1529341, r1529434, r1529503, r1530268 from branch_4x

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development