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

Andras Salamon commented on SOLR-14172:
---------------------------------------

A similar problem was fixed in this commit: 
[https://github.com/apache/lucene-solr/commit/5670d612e3f2512d85c972b5fc717586118a19d5#diff-992163d381222cc6d8640b791b030a0b]

> Collection metadata remains in zookeper if too many shards requested
> --------------------------------------------------------------------
>
>                 Key: SOLR-14172
>                 URL: https://issues.apache.org/jira/browse/SOLR-14172
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 8.3.1
>            Reporter: Andras Salamon
>            Priority: Major
>
> When I try to create a collection and request too many shards, collection 
> creation fails with the expected error message:
> {noformat}
> $ curl -i --retry 5 -s -L -k --negotiate -u : 
> 'http://asalamon-cdpd-rebase831-a-1.vpc.cloudera.com:8983/solr/admin/collections?action=CREATE&name=TooManyShardstest1&numShards=4&collection.configName=zk_init_too&maxShardsPerNode=1'
> HTTP/1.1 400 Bad Request
> Content-Type: application/json;charset=utf-8
> Content-Length: 1562
> {
>   "responseHeader":{
>     "status":400,
>     "QTime":122},
>   "Operation create caused 
> exception:":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
>  Cannot create collection TooManyShardstest1. Value of maxShardsPerNode is 1, 
> and the number of nodes currently live or live and part of your createNodeSet 
> is 3. This allows a maximum of 3 to be created. Value of numShards is 4, 
> value of nrtReplicas is 1, value of tlogReplicas is 0 and value of 
> pullReplicas is 0. This requires 4 shards to be created (higher than the 
> allowed number)",
>   "exception":{
>     "msg":"Cannot create collection TooManyShardstest1. Value of 
> maxShardsPerNode is 1, and the number of nodes currently live or live and 
> part of your createNodeSet is 3. This allows a maximum of 3 to be created. 
> Value of numShards is 4, value of nrtReplicas is 1, value of tlogReplicas is 
> 0 and value of pullReplicas is 0. This requires 4 shards to be created 
> (higher than the allowed number)",
>     "rspCode":400},
>   "error":{
>     "metadata":[
>       "error-class","org.apache.solr.common.SolrException",
>       "root-error-class","org.apache.solr.common.SolrException"],
>     "msg":"Cannot create collection TooManyShardstest1. Value of 
> maxShardsPerNode is 1, and the number of nodes currently live or live and 
> part of your createNodeSet is 3. This allows a maximum of 3 to be created. 
> Value of numShards is 4, value of nrtReplicas is 1, value of tlogReplicas is 
> 0 and value of pullReplicas is 0. This requires 4 shards to be created 
> (higher than the allowed number)",
>     "code":400}}
> {noformat}
> Although the collection creation was not successful if I list the collections 
> it shows the new collection:
> {noformat}
> $ solr  collection --list                                        
> TooManyShardstest1 (1) 
>  {noformat}
> Looks like metadata remains in Zookeper:
> {noformat}
> zkcli.sh -zkhost asalamon-cdpd-rebase831-a-1.vpc.cloudera.com:2181/solr -cmd 
> ls /collections
> INFO  - 2020-01-06 04:54:01.851; 
> org.apache.solr.common.cloud.ConnectionManager; Waiting for client to connect 
> to ZooKeeper
> INFO  - 2020-01-06 04:54:01.880; 
> org.apache.solr.common.cloud.ConnectionManager; zkClient has connected
> INFO  - 2020-01-06 04:54:01.881; 
> org.apache.solr.common.cloud.ConnectionManager; Client is connected to 
> ZooKeeper
> /collections (1)
>  /collections/TooManyShardstest1 (1)
>  DATA:
>      {"configName":"zk_init_too"}
>   /collections/TooManyShardstest1/state.json (0)
>   DATA:
>       {"TooManyShardstest1":{
>           "pullReplicas":"0",
>           "replicationFactor":"1",
>           "router":{"name":"compositeId"},
>           "maxShardsPerNode":"1",
>           "autoAddReplicas":"false",
>           "nrtReplicas":"1",
>           "tlogReplicas":"0",
>           "shards":{
>             "shard1":{
>               "range":"80000000-bfffffff",
>               "state":"active",
>               "replicas":{}},
>             "shard2":{
>               "range":"c0000000-ffffffff",
>               "state":"active",
>               "replicas":{}},
>             "shard3":{
>               "range":"0-3fffffff",
>               "state":"active",
>               "replicas":{}},
>             "shard4":{
>               "range":"40000000-7fffffff",
>               "state":"active",
>               "replicas":{}}}}}
> {noformat}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to