ESGF / esg-search

ESGF Search Component
http://esgf.org/esg-search/
Other
8 stars 14 forks source link

add endpoint URL which wraps /solr/ping #136

Open alaniwi opened 5 years ago

alaniwi commented 5 years ago

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.

alaniwi commented 5 years ago

Adding @mkjpryor-stfc as an interested person.