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

Steve Rowe commented on SOLR-12482:
-----------------------------------

Attached patch fixing the issue with tests for failures.  A couple of other 
changes:

* Fixed a couple of error formatting issues (missing interpolated values) in 
{{SolrConfigHandler.Command.applySetProps()}}.
* Solrj's {{TestV2Request}} had to be modified to handle a config api failure 
it didn't know about (since status was 0): a collection is created multiple 
times using the same configset, and a new requesthandler (same name each time) 
is added via the config api, then the collection is deleted.  But the config 
overlay was retaining the previous request handler definition, so any following 
attempts to create the request handler fail since it already exists.  I changed 
the test to choose random names for the new request handler, so that they won't 
clash in the config overlay.

Committing shortly.


> Config API returns status 0 for failed operations
> -------------------------------------------------
>
>                 Key: SOLR-12482
>                 URL: https://issues.apache.org/jira/browse/SOLR-12482
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Steve Rowe
>            Assignee: Steve Rowe
>            Priority: Major
>         Attachments: SOLR-12482.patch
>
>
> {{bin/solr config}} depends on the status from Config API calls to determine 
> whether the operation succeeded, but apparently the Config API can return 
> status 0 for failed operations.  As a result, {{bin/solr config}} will claim 
> success.  For example, after running {{bin/solr start -c}} and {{bin/solr 
> create -c mycoll}}:
> {noformat}
> $PROMPT$ bin/solr config -c mycoll -z localhost:9983 -property FOOBAR -value 
> BAZ
> [...]
> POSTing request to Config API: http://192.168.1.12:8983/solr/mycoll/config
> {"set-property":{"FOOBAR":"BAZ"}}
> Successfully set-property FOOBAR to BAZ
> {noformat}
> But the {{FOOBAR}} property cannot be set via {{set-property}}, because it is 
> not on the editable properties whitelist in 
> {{EditableSolrConfigAttributes.json}}.
> This is evident from the direct Config API call:
> {noformat}
> PROMPT$ curl -X POST -d '{set-property:{FOOBAR:BAZ}}'
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":1},
>   "errorMessages":[{
>       "set-property":{"FOOBAR":"BAZ"},
>       "errorMessages":["'FOOBAR' is not an editable property"]}],
>   "WARNING":"This response format is experimental.  It is likely to change in 
> the future."}
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to