lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky (JIRA)" <>
Subject [jira] [Commented] (SOLR-6036) Can't create collection with replicationFactor=0
Date Thu, 01 May 2014 20:44:16 GMT


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:
>             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
> </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
>       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.
> 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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message