You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by cp...@apache.org on 2022/09/20 14:18:19 UTC

[solr] branch branch_9x updated (97e5483cb6b -> 8b78ea5d58f)

This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a change to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


    from 97e5483cb6b SOLR-16414: Race condition in PRS state updates (#1019)
     new 37f1a697394 SOLR-16413: shorten long Grouping.searchWithTimeLimiter warnings (#796)
     new 2f82431095a reduce array allocation in ExtendedDismaxQParser.UserFields (#1017)
     new 8b78ea5d58f remove deprecated RealTimeGetComponent methods (#1018)

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../handler/component/RealTimeGetComponent.java     | 21 ---------------------
 .../apache/solr/search/ExtendedDismaxQParser.java   |  8 +++++---
 .../src/java/org/apache/solr/search/Grouping.java   |  5 ++++-
 .../DocBasedVersionConstraintsProcessor.java        |  5 +++--
 4 files changed, 12 insertions(+), 27 deletions(-)


[solr] 03/03: remove deprecated RealTimeGetComponent methods (#1018)

Posted by cp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 8b78ea5d58f0337cce9ac20ea835fe1f9953d2c8
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Tue Sep 20 15:15:15 2022 +0100

    remove deprecated RealTimeGetComponent methods (#1018)
    
    (cherry picked from commit 500c74cfb686c3e8b2c88b22b9ee5a787c0c57d0)
---
 .../handler/component/RealTimeGetComponent.java     | 21 ---------------------
 .../DocBasedVersionConstraintsProcessor.java        |  5 +++--
 2 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
index e53b1b06985..070e0166b20 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
@@ -630,21 +630,6 @@ public class RealTimeGetComponent extends SearchComponent {
 
   public static SolrInputDocument DELETED = new SolrInputDocument();
 
-  @Deprecated // need Resolution
-  public static SolrInputDocument getInputDocumentFromTlog(
-      SolrCore core,
-      BytesRef idBytes,
-      AtomicLong versionReturned,
-      Set<String> onlyTheseNonStoredDVs,
-      boolean resolveFullDocument) {
-    return getInputDocumentFromTlog(
-        core,
-        idBytes,
-        versionReturned,
-        onlyTheseNonStoredDVs,
-        resolveFullDocument ? Resolution.DOC : Resolution.PARTIAL);
-  }
-
   /**
    * Specialized to pick out a child doc from a nested doc from the TLog.
    *
@@ -747,12 +732,6 @@ public class RealTimeGetComponent extends SearchComponent {
     return null;
   }
 
-  @Deprecated // easy to use wrong
-  public static SolrInputDocument getInputDocument(
-      SolrCore core, BytesRef idBytes, Resolution lookupStrategy) throws IOException {
-    return getInputDocument(core, idBytes, idBytes, null, null, lookupStrategy);
-  }
-
   /**
    * Obtains the latest document for a given id from the tlog or through the realtime searcher (if
    * not found in the tlog). Fields that are targets of copy-fields are excluded.
diff --git a/solr/core/src/java/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessor.java
index 521fcbd2558..7ca6b9e6572 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DocBasedVersionConstraintsProcessor.java
@@ -192,7 +192,8 @@ public class DocBasedVersionConstraintsProcessor extends UpdateRequestProcessor
   private DocFoundAndOldUserAndSolrVersions getOldUserVersionsFromFieldCache(
       BytesRef indexedDocId) {
     SolrInputDocument oldDoc =
-        RealTimeGetComponent.getInputDocumentFromTlog(core, indexedDocId, null, null, true);
+        RealTimeGetComponent.getInputDocumentFromTlog(
+            core, indexedDocId, null, null, RealTimeGetComponent.Resolution.DOC);
     if (oldDoc == RealTimeGetComponent.DELETED) {
       return DocFoundAndOldUserAndSolrVersions.NOT_FOUND;
     }
@@ -233,7 +234,7 @@ public class DocBasedVersionConstraintsProcessor extends UpdateRequestProcessor
     // stored fields only...
     SolrInputDocument oldDoc =
         RealTimeGetComponent.getInputDocument(
-            core, indexedDocId, RealTimeGetComponent.Resolution.DOC);
+            core, indexedDocId, indexedDocId, null, null, RealTimeGetComponent.Resolution.DOC);
     if (null == oldDoc) {
       return DocFoundAndOldUserAndSolrVersions.NOT_FOUND;
     } else {


[solr] 02/03: reduce array allocation in ExtendedDismaxQParser.UserFields (#1017)

Posted by cp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 2f82431095aea56cac4325667eea53b40676f4d8
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Tue Sep 20 15:14:28 2022 +0100

    reduce array allocation in ExtendedDismaxQParser.UserFields (#1017)
    
    (cherry picked from commit b35ccf8efa0b11bbb03b9e534b316af553288d6c)
---
 .../src/java/org/apache/solr/search/ExtendedDismaxQParser.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java b/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java
index a3d9bb66a6a..5e3ba654b25 100644
--- a/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java
+++ b/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java
@@ -21,7 +21,6 @@ import com.google.common.collect.Multimaps;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -1564,11 +1563,14 @@ public class ExtendedDismaxQParser extends QParser {
       if (!userFieldsMap.containsKey(MagicFieldName.QUERY.field)) {
         userFieldsMap.put("-" + MagicFieldName.QUERY.field, null);
       }
-      Collections.sort(dynUserFields);
       dynamicUserFields = dynUserFields.toArray(new DynamicField[dynUserFields.size()]);
-      Collections.sort(negDynUserFields);
+      Arrays.sort(dynamicUserFields);
+      // Avoid creating the array twice by converting to an array first and using Arrays.sort(),
+      // rather than Collections.sort() then converting to an array, since Collections.sort()
+      // copies to an array first, then sets each collection member from the array.
       negativeDynamicUserFields =
           negDynUserFields.toArray(new DynamicField[negDynUserFields.size()]);
+      Arrays.sort(negativeDynamicUserFields);
     }
 
     /**


[solr] 01/03: SOLR-16413: shorten long Grouping.searchWithTimeLimiter warnings (#796)

Posted by cp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 37f1a69739442ff61982b1b060a5cad2f8ca7b93
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Tue Sep 20 15:12:38 2022 +0100

    SOLR-16413: shorten long Grouping.searchWithTimeLimiter warnings (#796)
    
    (cherry picked from commit edf94abef30d207d19f56b642564d7274fca6d9b)
---
 solr/core/src/java/org/apache/solr/search/Grouping.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/solr/core/src/java/org/apache/solr/search/Grouping.java b/solr/core/src/java/org/apache/solr/search/Grouping.java
index 266cbdba196..0d28b7d4c6f 100644
--- a/solr/core/src/java/org/apache/solr/search/Grouping.java
+++ b/solr/core/src/java/org/apache/solr/search/Grouping.java
@@ -461,7 +461,10 @@ public class Grouping {
       searcher.search(QueryUtils.combineQueryAndFilter(query, filterQuery), collector);
     } catch (TimeLimitingCollector.TimeExceededException
         | ExitableDirectoryReader.ExitingReaderException x) {
-      log.warn("Query: {}; ", query, x);
+      // INFO log the (possibly quite long) query object separately
+      log.info("Query: {}; ", query);
+      // to make WARN logged exception content more visible
+      log.warn("Query: {}; ", query.getClass().getName(), x);
       qr.setPartialResults(true);
     }
   }