mirror of https://github.com/apache/lucene.git
SOLR-10752: replicationFactor default is 0 if tlogReplicas > 0 is specified
This commit is contained in:
parent
4608e7d036
commit
c824b097b4
|
@ -198,6 +198,9 @@ Other Changes
|
|||
|
||||
* SOLR-10755: delete/refactor many solrj deprecations (hossman)
|
||||
|
||||
* SOLR-10752: replicationFactor (nrtReplicas) default is 0 if tlogReplicas is specified when creating a collection
|
||||
(Tomás Fernández Löbbe)
|
||||
|
||||
================== 6.7.0 ==================
|
||||
|
||||
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
||||
|
|
|
@ -95,9 +95,9 @@ public class CreateCollectionCmd implements Cmd {
|
|||
// look at the replication factor and see if it matches reality
|
||||
// if it does not, find best nodes to create more cores
|
||||
|
||||
int numNrtReplicas = message.getInt(NRT_REPLICAS, message.getInt(REPLICATION_FACTOR, 1));
|
||||
int numPullReplicas = message.getInt(PULL_REPLICAS, 0);
|
||||
int numTlogReplicas = message.getInt(TLOG_REPLICAS, 0);
|
||||
int numNrtReplicas = message.getInt(NRT_REPLICAS, message.getInt(REPLICATION_FACTOR, numTlogReplicas>0?0:1));
|
||||
int numPullReplicas = message.getInt(PULL_REPLICAS, 0);
|
||||
|
||||
ShardHandler shardHandler = ocmh.shardHandlerFactory.getShardHandler();
|
||||
final String async = message.getStr(ASYNC);
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.lucene.util.LuceneTestCase.Slow;
|
||||
import org.apache.solr.client.solrj.SolrQuery;
|
||||
import org.apache.solr.client.solrj.SolrServerException;
|
||||
|
@ -116,9 +117,22 @@ public class TestPullReplica extends SolrCloudTestCase {
|
|||
@Repeat(iterations=2) // 2 times to make sure cleanup is complete and we can create the same collection
|
||||
public void testCreateDelete() throws Exception {
|
||||
try {
|
||||
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 1, 0, 3)
|
||||
.setMaxShardsPerNode(100)
|
||||
.process(cluster.getSolrClient());
|
||||
if (random().nextBoolean()) {
|
||||
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 1, 0, 3)
|
||||
.setMaxShardsPerNode(100)
|
||||
.process(cluster.getSolrClient());
|
||||
} else {
|
||||
// Sometimes don't use SolrJ.
|
||||
String url = String.format(Locale.ROOT, "%s/admin/collections?action=CREATE&name=%s&numShards=%s&pullReplicas=%s&maxShardsPerNode=%s",
|
||||
cluster.getRandomJetty(random()).getBaseUrl(),
|
||||
collectionName,
|
||||
2, // numShards
|
||||
3, // pullReplicas
|
||||
100); // maxShardsPerNode
|
||||
url = url + pickRandom("", "&nrtReplicas=1", "&replicationFactor=1"); // These options should all mean the same
|
||||
HttpGet createCollectionRequest = new HttpGet(url);
|
||||
cluster.getSolrClient().getHttpClient().execute(createCollectionRequest);
|
||||
}
|
||||
boolean reloaded = false;
|
||||
while (true) {
|
||||
DocCollection docCollection = getCollectionState(collectionName);
|
||||
|
|
|
@ -30,6 +30,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
import org.apache.lucene.util.LuceneTestCase.Slow;
|
||||
import org.apache.solr.client.solrj.SolrClient;
|
||||
|
@ -144,9 +145,22 @@ public class TestTlogReplica extends SolrCloudTestCase {
|
|||
@Repeat(iterations=2) // 2 times to make sure cleanup is complete and we can create the same collection
|
||||
public void testCreateDelete() throws Exception {
|
||||
try {
|
||||
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 0, 4, 0)
|
||||
.setMaxShardsPerNode(100)
|
||||
.process(cluster.getSolrClient());
|
||||
if (random().nextBoolean()) {
|
||||
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 0, 4, 0)
|
||||
.setMaxShardsPerNode(100)
|
||||
.process(cluster.getSolrClient());
|
||||
} else {
|
||||
// Sometimes don't use SolrJ
|
||||
String url = String.format(Locale.ROOT, "%s/admin/collections?action=CREATE&name=%s&numShards=%s&tlogReplicas=%s&maxShardsPerNode=%s",
|
||||
cluster.getRandomJetty(random()).getBaseUrl(),
|
||||
collectionName,
|
||||
2, // numShards
|
||||
4, // tlogReplicas
|
||||
100); // maxShardsPerNode
|
||||
HttpGet createCollectionRequest = new HttpGet(url);
|
||||
cluster.getSolrClient().getHttpClient().execute(createCollectionRequest);
|
||||
}
|
||||
|
||||
boolean reloaded = false;
|
||||
while (true) {
|
||||
DocCollection docCollection = getCollectionState(collectionName);
|
||||
|
|
Loading…
Reference in New Issue