[
https://issues.apache.org/jira/browse/SOLR-16678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727592#comment-17727592
]
ASF subversion and git services commented on SOLR-16678:
--------------------------------------------------------
Commit 8a23f5798bcb0be42d854104a8ad0655cdca8e03 in solr's branch
refs/heads/branch_9x from Alex Deparvu
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=8a23f5798bc ]
SOLR-16678: Add test for user properties on v2 coll-creation requests
Functionality has was recently fixed but no test existed to prevent regression.
This commit safeguards us against future breaks by adding a test.
> Collection API v2 CREATE does not handle user-defined properties
> ----------------------------------------------------------------
>
> Key: SOLR-16678
> URL: https://issues.apache.org/jira/browse/SOLR-16678
> Project: Solr
> Issue Type: Bug
> Components: v2 API
> Affects Versions: 9.1
> Reporter: Julien Massiera
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> According to this documentation
> [https://solr.apache.org/guide/solr/latest/configuration-guide/property-substitution.html],
> we should be able with the Collection API v2 CREATE, to define custom core
> properties and use them in the solrconfig.xml file
> This is not working properly as, for example, if I try to define a "lib.path"
> property that I use in the solrconfig.xml of my collection, I get the
> following error:
> {code:java}
> curl -XPOST http://localhost:8983/api/collections -H 'Content-Type:
> application/json' -d '{"create": {"name": "MyCollection", "config": "Init",
> "numShards": 2, "replicationFactor":1, "property.lib.path":"/my/lib/path"}}'
> {
> "responseHeader":{
> "status":400,
> "QTime":738},
> "failure":{
>
> "127.0.0.1:8983_solr":"org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException:Error
> from server at null: Error CREATEing SolrCore
> 'MyCollection_shard1_replica_n3': Unable to create core
> [MyCollection_shard1_replica_n3] Caused by: No system property or default
> value specified for lib.path value:${lib.path}/Custom",
>
> "127.0.0.1:8983_solr":"org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException:Error
> from server at null: Error CREATEing SolrCore
> 'MyCollection_shard2_replica_n1': Unable to create core
> [MyCollection_shard2_replica_n1] Caused by: No system property or default
> value specified for lib.path value:${lib.path}/Custom"},
> "Operation create caused
> exception:":"org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
> Underlying core creation failed while creating collection: MyCollection",
> "exception":{
> "msg":"Underlying core creation failed while creating collection:
> MyCollection",
> "rspCode":400},
> "error":{
> "metadata":[
> "error-class","org.apache.solr.common.SolrException",
> "root-error-class","org.apache.solr.common.SolrException"],
> "msg":"Underlying core creation failed while creating collection:
> MyCollection",
> "code":400}}{code}
>
> Doing the same with the Collection API v1 properly works:
> {code:java}
> curl -XGET
> "http://localhost:8983/solr/admin/collections?action=CREATE&name=MyCollection&collection.configName=Init&numShards=2&maxShardsPerNode=2&replicationFactor=1&property.lib.path=/my/lib/path"
> {
> "responseHeader":{
> "status":0,
> "QTime":1419},
> "success":{
> "127.0.0.1:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1062},
> "core":"MyCollection_shard1_replica_n3"},
> "127.0.0.1:8983_solr":{
> "responseHeader":{
> "status":0,
> "QTime":1062},
> "core":"MyCollection_shard2_replica_n1"}}} {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]