Apache Lucene 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.javaindex 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.javaindex 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.javaindex 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 AbstractFullDiSystem.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.javaindex 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 AbstractFullDistrSystem.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.javaindex 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-7421System.setProperty("useCompoundFile", "true");- TestInjection.waitForReplicasInSync = null;}@AfterClassdiff --git a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.javaindex 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 {@BeforeClasspublic static void setupCluster() throws Exception {- TestInjection.waitForReplicasInSync = null; // We'll be explicit about this in this test// cloudSolrClientMaxStaleRetriesSystem.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.javaindex 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 proxiesdiff --git a/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.javaindex 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 {@BeforeClasspublic 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();