You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Yago Riveiro (JIRA)" <ji...@apache.org> on 2016/03/28 16:52:25 UTC

[jira] [Commented] (SOLR-8642) SOLR allows creation of collections with invalid names

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

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

Hi,

I can believe that I can't use a hyphen to create my collections ... I have thousand of collection with hyphens and basically I have a automatic system that creates the collections on the fly, and codebase that relay in collection names.

Sorry but this change can't be done without a API that allow rename a collection.

I can't upgrade to 5.5 because I can't create collections. This can of changes can't go in the middle of a major release. This enforcing should be optional.

In 4.x someone decides that DocValues in disk doesn't make sense and deprecated it in the middle of a major release, 10T of data to optimize to wipe the Disk format to use de "default" and 3 month to do it without downtime. Now I can create collections because someone "decides" that hyphens are not allowed. (I use Solr since 3.x, no problems with hyphens).

Sorry but this is annoying level 9999.

> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org