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 0ea9d0355a1..87cdf0b26d4 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java @@ -593,14 +593,26 @@ public class TestTlogReplica extends SolrCloudTestCase { } ChaosMonkey.start(solrRunner); waitingForReplay.acquire(); + // If I add the doc immediately, the leader fails to communicate with the follower with broken pipe. + // Options are, wait or retry... + for (int i = 0; i < 3; i++) { + UpdateRequest ureq = new UpdateRequest().add(sdoc("id", "8")); + ureq.setParam("collection", collectionName); + ureq.setParam(UpdateRequest.MIN_REPFACT, "2"); + NamedList response = cloudClient.request(ureq); + if ((Integer)((NamedList)response.get("responseHeader")).get(UpdateRequest.REPFACT) >= 2) { + break; + } + LOG.info("Min RF not achieved yet. retrying"); + } new UpdateRequest() - .add(sdoc("id", "8")) .add(sdoc("id", "9")) + .add(sdoc("id", "10")) .process(cloudClient, collectionName); waitingForBufferUpdates.release(); RecoveryStrategy.testing_beforeReplayBufferingUpdates = null; waitForState("Replica didn't recover", collectionName, activeReplicaCount(0,2,0)); - checkRTG(3,9, cluster.getJettySolrRunners()); + checkRTG(3,10, cluster.getJettySolrRunners()); for (SolrCore solrCore : getSolrCore(false)) { RefCounted iwRef = solrCore.getUpdateHandler().getSolrCoreState().getIndexWriter(null); assertFalse("IndexWriter at replicas must not see updates ", iwRef.get().hasUncommittedChanges());