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

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

For CreateShard (and the other collection APIs I classified in the 
description), I was judging them based on their example output for each API in 
the ref-guide.  (Example: 
[CreateShard|https://lucene.apache.org/solr/guide/6_6/collections-api.html#CollectionsAPI-createshard]
 has no "success" tag).  So I guess maybe some of these doc snippets are just 
outdated?  I should have double checked, sorry for the confusion. I'll check 
the APIs and correct the list tomorrow.

So to summarize some of the outstanding questions/concerns mentioned so far:
1. Many but not all error cases set the "status" field with an HTTP status 
code.  It's unclear whether this is intentional.
2. Some but not all collection-APIs include a "success" field flag.  It's 
unclear whether all of them should, or there's some rationale behind having 
some APIs use the flag but not others.
3. The implementation of {{CollectionAdminResponse.isSuccess()}} currently has 
issues because of (2).
4. Some of the API output examples for the Collections API don't match what 
those APIs currently return.

(Just trying to keep track of things)

Looking forward to seeing if Mark can shed any light on things!

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to