mirror of https://github.com/apache/lucene.git
SOLR-10841: TestTlogReplica.testRecovery sometimes fails
This commit is contained in:
parent
d91273ddf0
commit
39256e8348
|
@ -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<Object> response = cloudClient.request(ureq);
|
||||
if ((Integer)((NamedList<Object>)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<IndexWriter> iwRef = solrCore.getUpdateHandler().getSolrCoreState().getIndexWriter(null);
|
||||
assertFalse("IndexWriter at replicas must not see updates ", iwRef.get().hasUncommittedChanges());
|
||||
|
|
Loading…
Reference in New Issue