You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jack Krupansky (JIRA)" <ji...@apache.org> on 2014/05/01 22:44:16 UTC

[jira] [Commented] (SOLR-6036) Can't create collection with replicationFactor=0

    [ https://issues.apache.org/jira/browse/SOLR-6036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13986967#comment-13986967 ] 

Jack Krupansky commented on SOLR-6036:
--------------------------------------

But I can sympathize - the term "copies of the data" is ambiguous and vague, unless you have seriously taken the mantra "there is no master!" to heart and etched it into your arms with acid. Maybe "instances of the data" would be a little less ambiguous.

> Can't create collection with replicationFactor=0
> ------------------------------------------------
>
>                 Key: SOLR-6036
>                 URL: https://issues.apache.org/jira/browse/SOLR-6036
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>    Affects Versions: 4.3.1, 4.8
>            Reporter: John Wong
>            Priority: Trivial
>
> solrcloud$ curl 'http://localhost:8983/solr/admin/collections?action=CREATE&name=collection&numShards=2&replicationFactor=0'
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">400</int><int name="QTime">60052</int></lst><str name="Operation createcollection caused exception:">org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: replicationFactor must be greater than or equal to 0</str><lst name="exception"><str name="msg">replicationFactor must be greater than or equal to 0</str><int name="rspCode">400</int></lst><lst name="error"><str name="msg">replicationFactor must be greater than or equal to 0</str><int name="code">400</int></lst>
> </response>
> I am using solr 4.3.1, but I peeked into the source up to 4.8 and the problem still persists, but in 4.8, the exception message now is changed to be greater than 0.
> The code snippet in OverseerCollectionProcessor.java:
>       if (repFactor <= 0) {
>         throw new SolrException(ErrorCode.BAD_REQUEST, REPLICATION_FACTOR + " must be greater than 0");
>       }
> I believe the <= should just be < as it won't allow 0.  It may have been legacy from when replicationFactor of 1 included the leader/master copy, whereas in solr 4.x, replicationFactor is defined by additional replicas on top of the leader.
> http://wiki.apache.org/solr/SolrCloud
> replicationFactor: The number of copies of each document (or, the number of physical replicas to be created for each logical shard of the collection.) A replicationFactor of 3 means that there will be 3 replicas (one of which is normally designated to be the leader) for each logical shard. NOTE: in Solr 4.0, replicationFactor was the number of *additional* copies as opposed to the total number of copies. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org