Solr
  1. Solr
  2. SOLR-5263

CloudSolrServer URL cache update race

    Details

      Description

      In CloudSolrServer.request, urlLists (and the like) is updated if lastClusterStateHashCode is different from the current hash code of clusterState. However, each time this happen, only the cache entry for the current collection being requested is updated. In the following condition this causes a race:

      query collection A so a cache entry exists
      update collection A
      query collection B, request method notices the hash code changed and update cache for collection B, updates lastClusterStateHashCode
      query collection A, since lastClusterStateHashCode has been updated, no update for cache for collection A even though it's stale

      Can fix one of two ways:
      1. Track lastClusterStateHashCode per collection and lazily update each entry
      2. Every time we notice lastClusterStateHashCode != clusterState.hashCode(),
      2a. rebuild the entire cache for all collections
      2b. clear all current cache for collections

      1. SOLR-5263.patch
        12 kB
        Mark Miller

        Activity

        Hide
        Mark Miller added a comment -

        It's probably time to drop that more complicated cache code - especially now that CloudSolrServer will usually not even take that path and route on it's own.

        Show
        Mark Miller added a comment - It's probably time to drop that more complicated cache code - especially now that CloudSolrServer will usually not even take that path and route on it's own.
        Hide
        Mark Miller added a comment -

        Here is a simple patch that removes the caching.

        Show
        Mark Miller added a comment - Here is a simple patch that removes the caching.
        Hide
        Mark Miller added a comment -

        If there are no objections, I'll commit this shortly.

        Show
        Mark Miller added a comment - If there are no objections, I'll commit this shortly.
        Hide
        ASF subversion and git services added a comment -

        Commit 1528457 from Mark Miller in branch 'dev/trunk'
        [ https://svn.apache.org/r1528457 ]

        SOLR-5263: Fix CloudSolrServer URL cache update race.

        Show
        ASF subversion and git services added a comment - Commit 1528457 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1528457 ] SOLR-5263 : Fix CloudSolrServer URL cache update race.
        Hide
        ASF subversion and git services added a comment -

        Commit 1528461 from Mark Miller in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1528461 ]

        SOLR-5263: Fix CloudSolrServer URL cache update race.

        Show
        ASF subversion and git services added a comment - Commit 1528461 from Mark Miller in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1528461 ] SOLR-5263 : Fix CloudSolrServer URL cache update race.
        Hide
        Mark Miller added a comment -

        Thanks Jessica!

        Show
        Mark Miller added a comment - 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:
            Mark Miller
            Reporter:
            Jessica Cheng Mallet
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development