NCEAS / metacat

Data repository software that helps researchers preserve, share, and discover data
https://knb.ecoinformatics.org/software/metacat
GNU General Public License v2.0
28 stars 13 forks source link

Upgrading to solr 8.11 causes filterCache error on join queries #1561

Open vchendrix opened 2 years ago

vchendrix commented 2 years ago

I found the following issue on MetacatUI after upgrading Metacat Solr to 8.11

The following query on the portal metrics page returns a solr error.

https://data.ess-dive.lbl.gov/catalog/d1/mn/v2/query/solr/?q={!join%20from=resourceMap%20to=resourceMap}((siteText:%22SPRUCE%20Experiment%22))%20AND%20(-obsoletedBy:*%20AND%20*:*%20AND%20formatType:METADATA)&fq=formatType:DATA%20AND%20-obsoletedBy:*&stats=true&stats.field=size&facet=true&facet.field=formatId&facet.limit=-1&f.formatId.facet.mincount=1&f.formatId.facet.missing=false&f.dateUploaded.facet.missing=true&facet.range=dateUploaded&facet.range.start=1900-01-01T00:00:00.000Z&facet.range.end=2022-02-02T00:03:21.717Z&facet.range.gap=%2B1MONTH&rows=0&wt=json

Solr error

<error detailCode="Solr server error" errorCode="500" name="ServiceFailure">
<description>Error from server at http://db-solr:8983/solr/dataone: Using join queries with synchronous filterCache is not supported! Details can be found in Solr Reference Guide under 'query-settings-in-solrconfig'.</description>
</error>

More Information

I found this issue on the portal metrics tab https://data.ess-dive.lbl.gov/portals/SPRUCE_Experiment/Metrics

vchendrix commented 2 years ago

@taojing2002 I made the following changes to solrconfig.xml and reimported the index from backups. My guess is that I didn't need to reimport the index but I did anyway.

--- WEB-INF/classes/solr-home/conf/solrconfig.xml   2022-01-12 10:39:54.000000000 -0800
+++ solrconfig.xml  2022-02-02 09:05:39.000000000 -0800
@@ -376,11 +376,11 @@
     <!-- Solr Internal Query Caches

          There are two implementations of cache available for Solr,
-         LRUCache, based on a synchronized LinkedHashMap, and
-         FastLRUCache, based on a ConcurrentHashMap.
+         CaffeineCache, based on a synchronized LinkedHashMap, and
+         CaffeineCache, based on a ConcurrentHashMap.

-         FastLRUCache has faster gets and slower puts in single
-         threaded operation and thus is generally faster than LRUCache
+         CaffeineCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than CaffeineCache
          when the hit ratio of the cache is high (> 75%), and may be
          faster under other scenarios on multi-cpu systems.
     -->
@@ -392,19 +392,19 @@
          new searcher is opened, its caches may be prepopulated or
          "autowarmed" using data from caches in the old searcher.
          autowarmCount is the number of items to prepopulate.  For
-         LRUCache, the autowarmed items will be the most recently
+         CaffeineCache, the autowarmed items will be the most recently
          accessed items.

          Parameters:
-           class - the SolrCache implementation LRUCache or
-               (LRUCache or FastLRUCache)
+           class - the SolrCache implementation CaffeineCache or
+               (CaffeineCache or CaffeineCache)
            size - the maximum number of entries in the cache
            initialSize - the initial capacity (number of entries) of
                the cache.  (see java.util.HashMap)
            autowarmCount - the number of entries to prepopulate from
                and old cache.
       -->
-    <filterCache class="solr.FastLRUCache"
+    <filterCache class="solr.CaffeineCache"
                  size="512"
                  initialSize="512"
                  autowarmCount="0"/>
@@ -413,11 +413,11 @@

          Caches results of searches - ordered lists of document ids
          (DocList) based on a query, a sort, and the range of documents requested.
-         Additional supported parameter by LRUCache:
+         Additional supported parameter by CaffeineCache:
             maxRamMB - the maximum amount of RAM (in MB) that this cache is allowed
                        to occupy
       -->
-    <queryResultCache class="solr.LRUCache"
+    <queryResultCache class="solr.CaffeineCache"
                       size="512"
                       initialSize="512"
                       autowarmCount="0"/>
@@ -428,7 +428,7 @@
          document).  Since Lucene internal document ids are transient,
          this cache will not be autowarmed.
       -->
-    <documentCache class="solr.LRUCache"
+    <documentCache class="solr.CaffeineCache"
                    size="512"
                    initialSize="512"
                    autowarmCount="0"/>
@@ -440,7 +440,7 @@
          even if not configured here.
       -->
     <!--
-       <fieldValueCache class="solr.FastLRUCache"
+       <fieldValueCache class="solr.CaffeineCache"
                         size="512"
                         autowarmCount="128"
                         showItems="32" />
@@ -457,7 +457,7 @@
       -->
     <!--
        <cache name="myUserCache"
-              class="solr.LRUCache"
+              class="solr.CaffeineCache"
               size="4096"
               initialSize="1024"
               autowarmCount="1024"