You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by th...@apache.org on 2015/05/24 18:43:49 UTC

svn commit: r1681487 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/core/SolrCore.java solr/core/src/java/org/apache/solr/update/UpdateLog.java solr/core/src/java/org/apache/solr/update/VersionInfo.java

Author: thelabdude
Date: Sun May 24 16:43:48 2015
New Revision: 1681487

URL: http://svn.apache.org/r1681487
Log:
SOLR-7587: First attempt at fixing the dead-lock; moved call to UpdateLog.onFirstSearcher to end of the SolrCore constructor as it only needs to run once per core initialization

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/VersionInfo.java

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1681487&r1=1681486&r2=1681487&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java Sun May 24 16:43:48 2015
@@ -849,6 +849,18 @@ public final class SolrCore implements S
 
     this.ruleExpiryLock = new ReentrantLock();
     registerConfListener();
+
+    // seed version buckets with max from index during core initialization
+    if (this.updateHandler != null && this.updateHandler.getUpdateLog() != null) {
+      RefCounted<SolrIndexSearcher> newestSearcher = getRealtimeSearcher();
+      if (newestSearcher != null) {
+        try {
+          this.updateHandler.getUpdateLog().onFirstSearcher(newestSearcher.get());
+        } finally {
+          newestSearcher.decref();
+        }
+      }
+    }
   }
 
   /** Set UpdateLog to buffer updates if the slice is in construction. */
@@ -1806,10 +1818,6 @@ public final class SolrCore implements S
         }
 
         if (currSearcher == null) {
-          if (updateHandler != null && updateHandler.getUpdateLog() != null) {
-            updateHandler.getUpdateLog().onFirstSearcher(newSearcher);
-          }
-
           future = searcherExecutor.submit(new Callable() {
             @Override
             public Object call() throws Exception {

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java?rev=1681487&r1=1681486&r2=1681487&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/UpdateLog.java Sun May 24 16:43:48 2015
@@ -1578,7 +1578,7 @@ public class UpdateLog implements Plugin
       long maxVersion = Math.max(maxVersionFromIndex, maxVersionFromRecent);
       if (maxVersion == 0L) {
         maxVersion = versions.getNewClock();
-        log.warn("Could not find max version in index or recent updates, using new clock {}", maxVersion);
+        log.info("Could not find max version in index or recent updates, using new clock {}", maxVersion);
       }
 
       // seed all version buckets with the highest value from recent and index

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/VersionInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/VersionInfo.java?rev=1681487&r1=1681486&r2=1681487&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/VersionInfo.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/VersionInfo.java Sun May 24 16:43:48 2015
@@ -234,7 +234,7 @@ public class VersionInfo {
         maxVersionInIndex = NumericUtils.getMaxLong(versionTerms);
         log.info("Found MAX value {} from Terms for {} in index", maxVersionInIndex, versionFieldName);
       } else {
-        log.warn("No terms found for {}, cannot seed version bucket highest value from index", versionFieldName);
+        log.info("No terms found for {}, cannot seed version bucket highest value from index", versionFieldName);
       }
     } else {
       ValueSource vs = versionField.getType().getValueSource(versionField, null);