You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2019/03/07 11:25:37 UTC

[lucene-solr] branch master updated: SOLR-12313: Removing TestInjection#waitForInSyncWithLeader

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

datcm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new 4eb1c6f3c SOLR-12313: Removing TestInjection#waitForInSyncWithLeader
4eb1c6f3c is described below

commit 4eb1c6f3c672b301999c9ee9e3cfcc954e213b1b
Author: Cao Manh Dat <da...@apache.org>
AuthorDate: Thu Mar 7 11:25:32 2019 +0000

    SOLR-12313: Removing TestInjection#waitForInSyncWithLeader
---
 .../solr/update/processor/DistributedUpdateProcessor.java     |  3 ---
 solr/core/src/java/org/apache/solr/util/TestInjection.java    | 11 -----------
 .../cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java   |  1 -
 .../solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java |  1 -
 .../org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java    |  1 -
 solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java |  1 -
 .../org/apache/solr/cloud/TestPullReplicaErrorHandling.java   |  3 +--
 solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java |  3 +--
 8 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
index b01fd8a..a5d2898 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
@@ -1982,9 +1982,6 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
           long commitVersion = vinfo.getNewClock();
           cmd.setVersion(commitVersion);
           doLocalCommit(cmd);
-        } else {
-          assert TestInjection.waitForInSyncWithLeader(req.getCore(),
-              zkController, collection, cloudDesc.getShardId()) : "Core " + req.getCore() + " not in sync with leader";
         }
 
       } else if (replicaType == Replica.Type.PULL) {
diff --git a/solr/core/src/java/org/apache/solr/util/TestInjection.java b/solr/core/src/java/org/apache/solr/util/TestInjection.java
index 2f01a3e..4d49e7a 100644
--- a/solr/core/src/java/org/apache/solr/util/TestInjection.java
+++ b/solr/core/src/java/org/apache/solr/util/TestInjection.java
@@ -128,8 +128,6 @@ public class TestInjection {
 
   public volatile static CountDownLatch splitLatch = null;
 
-  public volatile static String waitForReplicasInSync = "true:60";
-
   public volatile static String failIndexFingerprintRequests = null;
 
   public volatile static String wrongIndexFingerprint = null;
@@ -162,7 +160,6 @@ public class TestInjection {
     splitLatch = null;
     prepRecoveryOpPauseForever = null;
     countPrepRecoveryOpPauseForever = new AtomicInteger(0);
-    waitForReplicasInSync = "true:60";
     failIndexFingerprintRequests = null;
     wrongIndexFingerprint = null;
     delayBeforeSlaveCommitRefresh = null;
@@ -428,14 +425,6 @@ public class TestInjection {
     return true;
   }
 
-  public static boolean waitForInSyncWithLeader(SolrCore core, ZkController zkController, String collection, String shardId) {
-    // NOTE: this method should do *NOTHING* unless LUCENE_TEST_CASE is non-null
-    
-    if (waitForReplicasInSync == null) return true;
-    
-    return true; // No-Op: see SOLR-12313
-  }
-  
   private static Pair<Boolean,Integer> parseValue(final String raw) {
     if (raw == null) return new Pair<>(false, 0);
     Matcher m = ENABLED_PERCENT.matcher(raw);
diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java
index a63dee3..4f3178c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java
@@ -69,7 +69,6 @@ public class ChaosMonkeyNothingIsSafeWithPullReplicasTest extends AbstractFullDi
     System.clearProperty("solr.httpclient.retries");
     System.clearProperty("solr.retries.on.forward");
     System.clearProperty("solr.retries.to.followers"); 
-    TestInjection.waitForReplicasInSync = null;
     setErrorHook();
   }
   
diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java
index 9055c10..0dfc2e9 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderWithPullReplicasTest.java
@@ -70,7 +70,6 @@ public class ChaosMonkeySafeLeaderWithPullReplicasTest extends AbstractFullDistr
     System.clearProperty("solr.httpclient.retries");
     System.clearProperty("solr.retries.on.forward");
     System.clearProperty("solr.retries.to.followers");
-    TestInjection.waitForReplicasInSync = null;
     setErrorHook();
   }
   
diff --git a/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java b/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java
index 74f55e9..4808a6e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/RecoveryAfterSoftCommitTest.java
@@ -52,7 +52,6 @@ public class RecoveryAfterSoftCommitTest extends AbstractFullDistribZkTestBase {
     System.setProperty("solr.ulog.numRecordsToKeep", String.valueOf(ULOG_NUM_RECORDS_TO_KEEP));
     // avoid creating too many files, see SOLR-7421
     System.setProperty("useCompoundFile", "true");
-    TestInjection.waitForReplicasInSync = null;
   }
 
   @AfterClass
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java
index bc58a46..da1b1af 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java
@@ -82,7 +82,6 @@ public class TestPullReplica extends SolrCloudTestCase {
 
   @BeforeClass
   public static void setupCluster() throws Exception {
-    TestInjection.waitForReplicasInSync = null; // We'll be explicit about this in this test
    //  cloudSolrClientMaxStaleRetries
    System.setProperty("cloudSolrClientMaxStaleRetries", "1");
    System.setProperty("zkReaderGetLeaderRetryTimeoutMs", "1000");
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestPullReplicaErrorHandling.java b/solr/core/src/test/org/apache/solr/cloud/TestPullReplicaErrorHandling.java
index 065796d..6a52e3f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestPullReplicaErrorHandling.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestPullReplicaErrorHandling.java
@@ -72,8 +72,7 @@ public class TestPullReplicaErrorHandling extends SolrCloudTestCase {
   public static void setupCluster() throws Exception {
     System.setProperty("solr.zkclienttimeout", "20000");
 
-    TestInjection.waitForReplicasInSync = null; // We'll be explicit about this in this test
-    configureCluster(4) 
+    configureCluster(4)
         .addConfig("conf", configset("cloud-minimal"))
         .configure();
     // Add proxies
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java
index d2ed996..2581fe429 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java
@@ -90,8 +90,7 @@ public class TestTlogReplica extends SolrCloudTestCase {
 
   @BeforeClass
   public static void setupCluster() throws Exception {
-    TestInjection.waitForReplicasInSync = null; // We'll be explicit about this in this test
-    configureCluster(2) // 2 + random().nextInt(3) 
+    configureCluster(2) // 2 + random().nextInt(3)
         .addConfig("conf", configset("cloud-minimal-inplace-updates"))
         .configure();
     Boolean useLegacyCloud = rarely();