SOLR-11452: TestTlogReplica.testOnlyLeaderIndexes() failure

This commit is contained in:
Cao Manh Dat 2017-10-10 10:11:59 +07:00
parent 0673c57ecf
commit 5e1474dca4
1 changed files with 8 additions and 1 deletions

View File

@ -489,16 +489,23 @@ public class TestTlogReplica extends SolrCloudTestCase {
waitForNumDocsInAllActiveReplicas(2);
assertCopyOverOldUpdates(1, timeCopyOverPerCores);
boolean firstCommit = true;
// UpdateLog copy over old updates
for (int i = 15; i <= 150; i++) {
cloudClient.add(collectionName, sdoc("id",String.valueOf(i)));
if (random().nextInt(100) < 15 & i != 150) {
if (firstCommit) {
// because tlog replicas periodically ask leader for new segments,
// therefore the copy over old updates action must not be triggered until
// tlog replicas actually get new segments
assertCopyOverOldUpdates(1, timeCopyOverPerCores);
firstCommit = false;
}
cloudClient.commit(collectionName);
}
}
checkRTG(120,150, cluster.getJettySolrRunners());
waitForReplicasCatchUp(20);
assertCopyOverOldUpdates(2, timeCopyOverPerCores);
}
@SuppressWarnings("unchecked")