ESGF/esg-search

add endpoint URL which wraps /solr/ping

alaniwi opened this issue · 1 comments

It would be useful (for load balancers and Kubernetes) to have a URL which can test cheaply whether esg-search and solr are both up, but without performing a search. Solr has a URL /solr/<core-name>/admin/ping, so it would be good to have a corresponding ping endpoint in esg-search, which wraps this.

Perhaps the http response code should reflect the status of Solr, so that the client does not need to parse the response content to obtain a quick answer. I am not sure which code would be most appropriate in the case that Solr is down, but maybe a 502.

It might also be worth having a query option which can be used to specify that it should test whether all the shards specified in esgf_shards_static.xml are responding, not only localhost:8983/solr (or other default shard), because these would be needed to satisfy an actual search. I don't know whether there is a way to do a distributed ping with a single call to Solr, analogous to the shards parameter which is used with select when searching. The docs for Solr ping (https://lucene.apache.org/solr/guide/6_6/ping.html) have some reference to a distrib parameter, but I haven't investigated the details. If in fact that is not useful, then I guess that such an option could be implemented by having esg-search looping over the shards itself.

Adding @mkjpryor-stfc as an interested person.