Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-12313: Removing TestInjection#waitForInSyncWithLeader

Cao Manh Dat4eb1c6f3c672
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 b01fd8a9c46..a5d28985d2d 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 2f01a3e5d10..4d49e7a1e6b 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 a63dee36e5d..4f3178c2d38 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 9055c1047cc..0dfc2e93277 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 74f55e903b2..4808a6ebe0d 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 bc58a46ecbe..da1b1af6aa9 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 065796d0649..6a52e3fdd58 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 d2ed9963231..2581fe429ec 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();