lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1155964 - in /lucene/dev/trunk/solr/core/src: java/org/apache/solr/update/DirectUpdateHandler2.java test/org/apache/solr/search/TestRealTimeGet.java
Date Tue, 09 Aug 2011 22:59:31 GMT
Author: yonik
Date: Tue Aug  9 22:59:30 2011
New Revision: 1155964

URL: http://svn.apache.org/viewvc?rev=1155964&view=rev
Log:
SOLR-2565: fix update handler reopen race

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRealTimeGet.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java?rev=1155964&r1=1155963&r2=1155964&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java Tue
Aug  9 22:59:30 2011
@@ -290,7 +290,7 @@ public class DirectUpdateHandler2 extend
       } else if (cmd.expungeDeletes) {
         writer.expungeDeletes();
       }
-      
+
       if (!cmd.softCommit) {
         writer.commit();
         numDocsPending.set(0);
@@ -304,10 +304,13 @@ public class DirectUpdateHandler2 extend
         callPostOptimizeCallbacks();
       }
 
-      if (cmd.softCommit) {
-        core.getSearcher(true,false,waitSearcher, true);
-      } else {
-        core.getSearcher(true,false,waitSearcher);
+
+      synchronized (this) {
+        if (cmd.softCommit) {
+          core.getSearcher(true,false,waitSearcher, true);
+        } else {
+          core.getSearcher(true,false,waitSearcher);
+        }
       }
 
       // reset commit tracking

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRealTimeGet.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRealTimeGet.java?rev=1155964&r1=1155963&r2=1155964&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRealTimeGet.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/search/TestRealTimeGet.java Tue Aug
 9 22:59:30 2011
@@ -77,10 +77,6 @@ public class TestRealTimeGet extends Sol
   final String field = "val_l";
   Object[] syncArr;
 
-
-  final ConcurrentHashMap<Integer,Long> sanityModel = new ConcurrentHashMap<Integer,Long>();
-
-
   private void initModel(int ndocs) {
     snapshotCount = 0;
     committedModelClock = 0;
@@ -105,11 +101,12 @@ public class TestRealTimeGet extends Sol
     final int deleteByQueryPercent = 4;
     final int ndocs = 100;
     int nWriteThreads = 10;
-    final int maxConcurrentCommits = 2;   // number of committers at a time... needed if
we want to avoid commit errors due to exceeding the max
+
+    final int maxConcurrentCommits = nWriteThreads;   // number of committers at a time...
it should be <= maxWarmingSearchers
 
     // query variables
     final int percentRealtimeQuery = 0;   // realtime get is not implemented yet
-    final AtomicLong operations = new AtomicLong(1000);  // number of query operations to
perform in total       // TODO: once lucene level passes, we can move on to the solr level
+    final AtomicLong operations = new AtomicLong(atLeast(10000));  // number of query operations
to perform in total
     int nReadThreads = 10;
 
     initModel(ndocs);



Mime
View raw message