You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Edward Ribeiro <ed...@gmail.com> on 2018/09/17 19:35:28 UTC

Collection creation via CLI sets maxShardsPerNode as -1

When using the CLI to create a collection on a single cloud node with the
following command:

$ bin/solr create -c test -shards 1 -replicationFactor 1

It creates the collection with maxShardsPerNode as -1 as seen here:
https://github.com/apache/lucene-solr/blob/c97f27b06c1d7c250e9596a9bc7bf5ca11ef6ad3/solr/core/src/java/org/apache/solr/util/SolrCLI.java#L1530-L1534

As we can see, it even allows the setting of maxShardsPerNode as a
parameter, but according to 7.4 documentation the default value would be 1
instead of -1 (see
https://lucene.apache.org/solr/guide/7_4/collections-api.html ). If I
create the collection directly via HTTP request

curl -X POST '
http://localhost:8983/solr/admin/collections?action=CREATE&name=test2&numShards=1&replicationFactor=1
'

It creates the collection with the default maxShardsPerNode of 1.

It seems that the fix is trivial (either code or docs), but I would like to
know if this is really a bug or not, that is, should I provide a fix or
leave it as-is?

PS: As a bit of context, I was bited by this when demo-ing Solr
backup/restore capabilities and it refused to recover a collection with
maxShardsPerNode == -1.

Best regards,
Edward

Re: Collection creation via CLI sets maxShardsPerNode as -1

Posted by Edward Ribeiro <ed...@gmail.com>.
Thanks Jan,

This comment pretty much summarised my issue:
https://issues.apache.org/jira/browse/SOLR-11807?focusedCommentId=16517943&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16517943

Edward

On Mon, Sep 17, 2018 at 5:29 PM, Jan Høydahl <ja...@cominvent.com> wrote:

> There is already several JIRAs on this bug, see SOLR-11807
> <https://issues.apache.org/jira/browse/SOLR-11807>, SOLR-11823
> <https://issues.apache.org/jira/browse/SOLR-11823>, SOLR-12489
> <https://issues.apache.org/jira/browse/SOLR-12489>, SOLR-11676
> <https://issues.apache.org/jira/browse/SOLR-11676>, and should be fixed
> with the upcoming 7.5 release.
>
> --
> Jan Høydahl, search solution architect
> Cominvent AS - www.cominvent.com
>
> 17. sep. 2018 kl. 22:25 skrev Edward Ribeiro <ed...@gmail.com>:
>
> Jeez, I should have posted this on user@ mailing list, sorry about that.
>
> On Mon, Sep 17, 2018 at 4:35 PM, Edward Ribeiro <ed...@gmail.com>
> wrote:
>
>> When using the CLI to create a collection on a single cloud node with the
>> following command:
>>
>> $ bin/solr create -c test -shards 1 -replicationFactor 1
>>
>> It creates the collection with maxShardsPerNode as -1 as seen here:
>> https://github.com/apache/lucene-solr/blob/c97f27b06c1d7c250
>> e9596a9bc7bf5ca11ef6ad3/solr/core/src/java/org/apache/solr/
>> util/SolrCLI.java#L1530-L1534
>>
>> As we can see, it even allows the setting of maxShardsPerNode as a
>> parameter, but according to 7.4 documentation the default value would be 1
>> instead of -1 (see https://lucene.apache.org/solr
>> /guide/7_4/collections-api.html ). If I create the collection directly
>> via HTTP request
>>
>> curl -X POST 'http://localhost:8983/solr/admin/collections?action=CREATE&
>> name=test2&numShards=1&replicationFactor=1'
>>
>> It creates the collection with the default maxShardsPerNode of 1.
>>
>> It seems that the fix is trivial (either code or docs), but I would like
>> to know if this is really a bug or not, that is, should I provide a fix or
>> leave it as-is?
>>
>> PS: As a bit of context, I was bited by this when demo-ing Solr
>> backup/restore capabilities and it refused to recover a collection with
>> maxShardsPerNode == -1.
>>
>> Best regards,
>> Edward
>>
>
>
>

Re: Collection creation via CLI sets maxShardsPerNode as -1

Posted by Jan Høydahl <ja...@cominvent.com>.
There is already several JIRAs on this bug, see SOLR-11807 <https://issues.apache.org/jira/browse/SOLR-11807>, SOLR-11823 <https://issues.apache.org/jira/browse/SOLR-11823>, SOLR-12489 <https://issues.apache.org/jira/browse/SOLR-12489>, SOLR-11676 <https://issues.apache.org/jira/browse/SOLR-11676>, and should be fixed with the upcoming 7.5 release.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

> 17. sep. 2018 kl. 22:25 skrev Edward Ribeiro <ed...@gmail.com>:
> 
> Jeez, I should have posted this on user@ mailing list, sorry about that.
> 
> On Mon, Sep 17, 2018 at 4:35 PM, Edward Ribeiro <edward.ribeiro@gmail.com <ma...@gmail.com>> wrote:
> When using the CLI to create a collection on a single cloud node with the following command:
> 
> $ bin/solr create -c test -shards 1 -replicationFactor 1
> 
> It creates the collection with maxShardsPerNode as -1 as seen here: https://github.com/apache/lucene-solr/blob/c97f27b06c1d7c250e9596a9bc7bf5ca11ef6ad3/solr/core/src/java/org/apache/solr/util/SolrCLI.java#L1530-L1534 <https://github.com/apache/lucene-solr/blob/c97f27b06c1d7c250e9596a9bc7bf5ca11ef6ad3/solr/core/src/java/org/apache/solr/util/SolrCLI.java#L1530-L1534>
> 
> As we can see, it even allows the setting of maxShardsPerNode as a parameter, but according to 7.4 documentation the default value would be 1 instead of -1 (see https://lucene.apache.org/solr/guide/7_4/collections-api.html <https://lucene.apache.org/solr/guide/7_4/collections-api.html> ). If I create the collection directly via HTTP request
> 
> curl -X POST 'http://localhost:8983/solr/admin/collections?action=CREATE&name=test2&numShards=1&replicationFactor=1 <http://localhost:8983/solr/admin/collections?action=CREATE&name=test2&numShards=1&replicationFactor=1>'
> 
> It creates the collection with the default maxShardsPerNode of 1.
> 
> It seems that the fix is trivial (either code or docs), but I would like to know if this is really a bug or not, that is, should I provide a fix or leave it as-is?
> 
> PS: As a bit of context, I was bited by this when demo-ing Solr backup/restore capabilities and it refused to recover a collection with maxShardsPerNode == -1.
> 
> Best regards,
> Edward
> 


Re: Collection creation via CLI sets maxShardsPerNode as -1

Posted by Edward Ribeiro <ed...@gmail.com>.
Jeez, I should have posted this on user@ mailing list, sorry about that.

On Mon, Sep 17, 2018 at 4:35 PM, Edward Ribeiro <ed...@gmail.com>
wrote:

> When using the CLI to create a collection on a single cloud node with the
> following command:
>
> $ bin/solr create -c test -shards 1 -replicationFactor 1
>
> It creates the collection with maxShardsPerNode as -1 as seen here:
> https://github.com/apache/lucene-solr/blob/c97f27b06c1d7c250e9596a9bc7bf5
> ca11ef6ad3/solr/core/src/java/org/apache/solr/util/SolrCLI.
> java#L1530-L1534
>
> As we can see, it even allows the setting of maxShardsPerNode as a
> parameter, but according to 7.4 documentation the default value would be 1
> instead of -1 (see https://lucene.apache.org/solr/guide/7_4/collections-
> api.html ). If I create the collection directly via HTTP request
>
> curl -X POST 'http://localhost:8983/solr/admin/collections?action=
> CREATE&name=test2&numShards=1&replicationFactor=1'
>
> It creates the collection with the default maxShardsPerNode of 1.
>
> It seems that the fix is trivial (either code or docs), but I would like
> to know if this is really a bug or not, that is, should I provide a fix or
> leave it as-is?
>
> PS: As a bit of context, I was bited by this when demo-ing Solr
> backup/restore capabilities and it refused to recover a collection with
> maxShardsPerNode == -1.
>
> Best regards,
> Edward
>