You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2015/04/20 06:44:03 UTC

svn commit: r1674733 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java

Author: shalin
Date: Mon Apr 20 04:44:02 2015
New Revision: 1674733

URL: http://svn.apache.org/r1674733
Log:
SOLR-7421: RecoveryAfterSoftCommitTest fails frequently on Jenkins due to full index replication taking longer than 30 seconds

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1674733&r1=1674732&r2=1674733&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Apr 20 04:44:02 2015
@@ -176,6 +176,9 @@ Other Changes
 * SOLR-6886: Removed redundant size check and added missing calls to
   DelegatingCollection.finish inside Grouping code.  (Christine Poerschke via shalin)
 
+* SOLR-7421: RecoveryAfterSoftCommitTest fails frequently on Jenkins due to full index
+  replication taking longer than 30 seconds. (Timothy Potter, shalin)
+
 ==================  5.1.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

Modified: lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml?rev=1674733&r1=1674732&r2=1674733&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml (original)
+++ lucene/dev/trunk/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml Mon Apr 20 04:44:02 2015
@@ -49,6 +49,8 @@
   <updateHandler class="solr.DirectUpdateHandler2">
     <updateLog>
       <str name="dir">${solr.ulog.dir:}</str>
+      <str name="maxNumLogsToKeep">${solr.ulog.maxNumLogsToKeep:10}</str>
+      <str name="numRecordsToKeep">${solr.ulog.numRecordsToKeep:100}</str>
     </updateLog>
   </updateHandler>
 

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java?rev=1674733&r1=1674732&r2=1674733&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java Mon Apr 20 04:44:02 2015
@@ -33,8 +33,8 @@ import org.junit.Test;
 
 // See SOLR-6640
 @SolrTestCaseJ4.SuppressSSL
-@LuceneTestCase.BadApple(bugUrl = "https://issues.apache.org/jira/browse/SOLR-7421")
 public class RecoveryAfterSoftCommitTest extends AbstractFullDistribZkTestBase {
+  private static final int MAX_BUFFERED_DOCS = 2, ULOG_NUM_RECORDS_TO_KEEP = 2;
 
   public RecoveryAfterSoftCommitTest() {
     sliceCount = 1;
@@ -43,12 +43,20 @@ public class RecoveryAfterSoftCommitTest
 
   @BeforeClass
   public static void beforeTests() {
-    System.setProperty("solr.tests.maxBufferedDocs", "2");
+    System.setProperty("solr.tests.maxBufferedDocs", String.valueOf(MAX_BUFFERED_DOCS));
+    System.setProperty("solr.ulog.numRecordsToKeep", String.valueOf(ULOG_NUM_RECORDS_TO_KEEP));
+    // the default=7000ms artificially slows down recovery and is not needed for this test
+    System.setProperty("solr.cloud.wait-for-updates-with-stale-state-pause", "500");
+    // avoid creating too many files, see SOLR-7421
+    System.setProperty("useCompoundFile", "true");
   }
 
   @AfterClass
   public static void afterTest()  {
     System.clearProperty("solr.tests.maxBufferedDocs");
+    System.clearProperty("solr.ulog.numRecordsToKeep");
+    System.clearProperty("solr.cloud.wait-for-updates-with-stale-state-pause");
+    System.clearProperty("useCompoundFile");
   }
 
   /**
@@ -64,8 +72,10 @@ public class RecoveryAfterSoftCommitTest
 
   @Test
   public void test() throws Exception {
+    waitForRecoveriesToFinish(DEFAULT_COLLECTION, true);
     // flush twice
-    for (int i=0; i<4; i++) {
+    int i = 0;
+    for (; i<MAX_BUFFERED_DOCS + 1; i++) {
       SolrInputDocument document = new SolrInputDocument();
       document.addField("id", String.valueOf(i));
       document.addField("a_t", "text_" + i);
@@ -82,8 +92,9 @@ public class RecoveryAfterSoftCommitTest
 
     proxy.close();
 
-    // add more than 100 docs so that peer sync cannot be used for recovery
-    for (int i=5; i<115; i++) {
+    // add more than ULOG_NUM_RECORDS_TO_KEEP docs so that peer sync cannot be used for recovery
+    int MAX_DOCS = 2 + MAX_BUFFERED_DOCS + ULOG_NUM_RECORDS_TO_KEEP;
+    for (; i < MAX_DOCS; i++) {
       SolrInputDocument document = new SolrInputDocument();
       document.addField("id", String.valueOf(i));
       document.addField("a_t", "text_" + i);