mirror of https://github.com/apache/lucene.git
SOLR-11126: Reduce logging to debug, and remove the call to updateLiveNodes on every call
This commit is contained in:
parent
bf168ad37e
commit
0dca964a5d
|
@ -65,7 +65,7 @@ public class HealthCheckHandler extends RequestHandlerBase {
|
|||
@Override
|
||||
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception {
|
||||
|
||||
log.info("Invoked HealthCheckHandler on [{}]", coreContainer.getZkController().getNodeName());
|
||||
log.debug("Invoked HealthCheckHandler on [{}]", coreContainer.getZkController().getNodeName());
|
||||
CoreContainer cores = getCoreContainer();
|
||||
|
||||
if(cores == null) {
|
||||
|
@ -73,6 +73,7 @@ public class HealthCheckHandler extends RequestHandlerBase {
|
|||
return;
|
||||
}
|
||||
if(!cores.isZooKeeperAware()) {
|
||||
//TODO: Support standalone instances
|
||||
rsp.setException(new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Health check is only available when running in SolrCloud mode"));
|
||||
return;
|
||||
}
|
||||
|
@ -85,19 +86,12 @@ public class HealthCheckHandler extends RequestHandlerBase {
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
zkStateReader.updateLiveNodes();
|
||||
|
||||
// Set status to true if this node is in live_nodes
|
||||
if (clusterState.getLiveNodes().contains(cores.getZkController().getNodeName())) {
|
||||
rsp.add(STATUS, OK);
|
||||
} else {
|
||||
rsp.add(STATUS, FAILURE);
|
||||
rsp.setException(new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Host Unavailable: Not in live nodes as per zk"));
|
||||
}
|
||||
} catch (KeeperException e) {
|
||||
// Set status to true if this node is in live_nodes
|
||||
if (clusterState.getLiveNodes().contains(cores.getZkController().getNodeName())) {
|
||||
rsp.add(STATUS, OK);
|
||||
} else {
|
||||
rsp.add(STATUS, FAILURE);
|
||||
rsp.setException(new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Host Unavailable: Not connected to zk"));
|
||||
rsp.setException(new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Host Unavailable: Not in live nodes as per zk"));
|
||||
}
|
||||
|
||||
rsp.setHttpCaching(false);
|
||||
|
|
Loading…
Reference in New Issue