You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/11/09 01:11:41 UTC

[GitHub] [lucene-solr] madrob opened a new pull request #2606: SOLR-15762 Error on Join Query with sync cache

madrob opened a new pull request #2606:
URL: https://github.com/apache/lucene-solr/pull/2606


   When attempting to run a join query using a synchronous filtercache,
   throw an error early with a link to docs rather than a mysterious
   IllegalStateException.
   
   Co-Authored-By: Thomas Wöckinger <tw...@silbergrau.com>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] madrob merged pull request #2606: SOLR-15762 Error on Join Query with sync cache

Posted by GitBox <gi...@apache.org>.
madrob merged pull request #2606:
URL: https://github.com/apache/lucene-solr/pull/2606


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dsmiley commented on a change in pull request #2606: SOLR-15762 Error on Join Query with sync cache

Posted by GitBox <gi...@apache.org>.
dsmiley commented on a change in pull request #2606:
URL: https://github.com/apache/lucene-solr/pull/2606#discussion_r745234091



##########
File path: solr/core/src/java/org/apache/solr/search/SolrCache.java
##########
@@ -174,4 +174,12 @@ default void close() throws IOException {
    * only on implementations that support it, it's a no-op otherwise.
    */
   void setMaxRamMB(int maxRamMB);
+
+  /**
+   * Check if this SolrCache supports async queries - relevant when attempting to cache nested or recursive results.

Review comment:
       IMO just keep it simple; don't specify why you might want it.  That reason may become obsolete.
   Also that javadoc doesn't seem helpful for those not in-the-know.  I suggest calling this `isRecursionSupported()' and document it by pointing to ConcurrentHashMap.computeIfAbsent to say that it does *not* support it.

##########
File path: solr/core/src/test/org/apache/solr/search/join/InvalidConfigJoinQueryTest.java
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.search.join;
+
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
+import org.apache.solr.client.solrj.request.UpdateRequest;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class InvalidConfigJoinQueryTest extends SolrTestCaseJ4 {
+
+  @BeforeClass
+  public static void before() throws Exception {
+    System.setProperty("solr.filterCache.async", "false");
+    initCore("solrconfig.xml", "schema.xml");
+  }
+
+  @Test
+  public void testInvalidFilterConfig() throws Exception {
+    UpdateRequest req = new UpdateRequest();
+    req.add(new SolrInputDocument("id", "0", "type_s", "org", "locid_s", "1"));
+    req.add(new SolrInputDocument("id", "1", "type_s", "loc", "orgid_s", "0"));
+
+    SolrClient client = new EmbeddedSolrServer(h.getCore());
+    req.commit(client, null);
+
+    assertThrows(SolrException.class, () -> assertJQ(req("q", "{!join from=id to=locid_s v=$q1}", "q1", "type_s:loc", "fl", "id", "sort", "id asc")));

Review comment:
       great; simple & not flakey

##########
File path: solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
##########
@@ -588,6 +588,10 @@ public DocSet getDocSetEnumerate() throws IOException {
             // use the filterCache to get a DocSet
             if (toTermsEnum.docFreq() >= minDocFreqTo || resultBits == null) {
               // use filter cache
+              if (! toSearcher.getFilterCache().isAsync()) {

Review comment:
       filterCache can be null




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] madrob commented on pull request #2606: SOLR-15762 Error on Join Query with sync cache

Posted by GitBox <gi...@apache.org>.
madrob commented on pull request #2606:
URL: https://github.com/apache/lucene-solr/pull/2606#issuecomment-963721186


   @thomaswoeckinger Here's the alternative approach.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org