You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jason Gerlowski (JIRA)" <ji...@apache.org> on 2017/10/23 23:11:00 UTC

[jira] [Commented] (SOLR-11526) CollectionAdminResponse.isSuccess() incorrect for most admin collections APIs

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

Jason Gerlowski commented on SOLR-11526:
----------------------------------------

I'd thought the "status" field would be enough to solve this, but it looks like it's 0 even on many failures:

{code}
{
  "responseHeader": {
    "status": 0,
    "QTime": 13058
  },
  "failure": {
    "127.0.0.1:45211_solr": "org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://127.0.0.1:45211/solr: Error CREATEing SolrCore 'foo_shard1_replica_n1': Unable to create core [foo_shard1_replica_n1] Caused by: access denied (\"java.io.FilePermission\" \"/some_invalid_dir/foo/tlog\" \"write\")"
  }
}
{code}

I feel like I'm misinterpreting the intent of the status field.  The few times I see it set as non-zero, it holds the HTTP status code from the request to Solr.  This seems like it could be used for success-determination, though maybe Solr doesn't use HTTP status codes consistently enough for this to be reliable.  I'll take a look at the logic used to set the status field for these APIs and see if using "status" is as reasonable as it appears at first blush.

> CollectionAdminResponse.isSuccess() incorrect for most admin collections APIs
> -----------------------------------------------------------------------------
>
>                 Key: SOLR-11526
>                 URL: https://issues.apache.org/jira/browse/SOLR-11526
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: SolrJ
>    Affects Versions: master (8.0)
>            Reporter: Jason Gerlowski
>            Priority: Minor
>
> {{CollectionAdminResponse}} has a boolean {{isSuccess}} method which reports whether the API was called successfully.  It returns true if it finds a non-null NamedList element called "success".  It returns false otherwise.
> Unfortunately, only a handful of the Collection-Admin APIs have this element.  APIs that don't contain this element in their response will always appear to have failed (according to {{isSuccess()}}).
> The current implementation is correct for:
> - CREATECOLLECTION
> - RELOAD
> - SPLITSHARD
> - DELETESHARD
> - DELETECOLLECTION
> - ADDREPLICA
> - MIGRATE
> The current implementation is incorrect for:
> - CREATESHARD
> - CREATEALIAS
> - DELETEALIAS
> - LISTALIASES
> - CLUSTERPROP
> - ADDROLE
> - REMOVEROLE
> - OVERSEERSTATUS
> - CLUSTERSTATUS
> - REQUESTSTATUS
> - DELETESTATUS
> - LIST
> - ADDREPLICAPROP
> - DELETEREPLICAPROP
> - BALANCESHARDUNIQUE
> - REBALANCELEADERS
> (these lists are incomplete)
> A trivial fix for this would be to change the implementation to check the "status" NamedList element (which is present in all Collection-Admin APIs).  My understanding is that the "status' field is set to 0 always on success.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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