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

Yago Riveiro commented on SOLR-8642:
------------------------------------

This can be use to learn something that I did with linux some time ago. When we 
releases and API, we release legacy, because people will develop a codebase 
using it (this include the wrong behaviours).

If the API is broken, people like me will be in troubles. This is the reason to 
see system calls with the same name and a number in the end and are deprecated 
like 10 years later.

Improvements are good, And I believe that this is doing for a good reason, but 
without tools that allow people to migrate from older behaviours are not useful.

Solr should have an LTS version, or at least don't introduce BC in a major 
release. It's not the first time that I pass for this situation, and every time 
that I need to explain to my boss that something is broken in our current 
version but we can't upgrade because other thing is broken in next version, I 
feel his assassin instinct :p 

Annoying level to 9997


> SOLR allows creation of collections with invalid names
> ------------------------------------------------------
>
>                 Key: SOLR-8642
>                 URL: https://issues.apache.org/jira/browse/SOLR-8642
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>    Affects Versions: master
>            Reporter: Jason Gerlowski
>            Assignee: Erick Erickson
>            Priority: Minor
>             Fix For: 5.5, master
>
>         Attachments: SOLR-8642.patch, SOLR-8642.patch, SOLR-8642.patch, 
> SOLR-8642.patch
>
>
> Some of my colleagues and I recently noticed that the CREATECOLLECTION API 
> will create a collection even when invalid characters are present in the name.
> For example, consider the following reproduction case, which involves 
> creating a collection with a space in its name:
> {code}
> $ <clean checkout of SOLR master/trunk>
> $ bin/solr start -e cloud -noprompt
>     ...
> $ curl -i -l -k -X GET 
> "http://localhost:8983/solr/admin/collections?action=CREATE&name=getting+started&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=gettingstarted";
> HTTP/1.1 200 OK
> Content-Type: application/xml; charset=UTF-8
> Transfer-Encoding: chunked
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int 
> name="QTime">299</int></lst><lst 
> name="failure"><str>org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error
>  from server at http://127.0.1.1:8983/solr: Error CREATEing SolrCore 'getting 
> started_shard2_replica2': Unable to create core [getting 
> started_shard2_replica2] Caused by: Invalid core name: 'getting 
> started_shard2_replica2' Names must consist entirely of periods, underscores 
> and 
> alphanumerics</str><str>org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error
>  from server at http://127.0.1.1:7574/solr: Error CREATEing SolrCore 'getting 
> started_shard2_replica1': Unable to create core [getting 
> started_shard2_replica1] Caused by: Invalid core name: 'getting 
> started_shard2_replica1' Names must consist entirely of periods, underscores 
> and 
> alphanumerics</str><str>org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error
>  from server at http://127.0.1.1:7574/solr: Error CREATEing SolrCore 'getting 
> started_shard1_replica1': Unable to create core [getting 
> started_shard1_replica1] Caused by: Invalid core name: 'getting 
> started_shard1_replica1' Names must consist entirely of periods, underscores 
> and 
> alphanumerics</str><str>org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error
>  from server at http://127.0.1.1:8983/solr: Error CREATEing SolrCore 'getting 
> started_shard1_replica2': Unable to create core [getting 
> started_shard1_replica2] Caused by: Invalid core name: 'getting 
> started_shard1_replica2' Names must consist entirely of periods, underscores 
> and alphanumerics</str></lst>
> </response>
> $ 
> $ curl -i -l -k -X GET 
> "http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS&wt=json&indent=true";
> HTTP/1.1 200 OK
> Content-Type: application/json; charset=UTF-8
> Transfer-Encoding: chunked
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":6},
>   "cluster":{
>     "collections":{
>      ...
>       "getting started":{
>         "replicationFactor":"2",
>         "shards":{
>           "shard1":{
>             "range":"80000000-ffffffff",
>             "state":"active",
>             "replicas":{}},
>           "shard2":{
>             "range":"0-7fffffff",
>             "state":"active",
>             "replicas":{}}},
>         "router":{"name":"compositeId"},
>         "maxShardsPerNode":"2",
>         "autoAddReplicas":"false",
>         "znodeVersion":1,
>         "configName":"gettingstarted"},
>     "live_nodes":["127.0.1.1:8983_solr",
>       "127.0.1.1:7574_solr"]}}
> {code}
> The commands/responses above suggest that Solr creates the collection without 
> checking the name.  It then goes on to create the cores for the collection, 
> which fails and returns the error seen above.
> I verified this by doing a {{curl -i -l -k 
> "http://localhost:8983/solr/admin/cores}}; as expected the cores were not 
> actually created.  (This is probably thanks to Erick's work on SOLR-8308).
> This bug is a problem because it will create collections which can never be 
> backed up with actual cores.
> Seems like the same name-verification that 8308 added to cores should also be 
> applied to collections.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to