Apache Solr open-source search software
SOLR-11126: Reduce logging to debug, and remove the call to updateLiveNodes on every call
Anshum Gupta0dca964a5d9d
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/HealthCheckHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/HealthCheckHandler.javaindex 03c7bd47d1c..093524d2642 100644--- a/solr/core/src/java/org/apache/solr/handler/admin/HealthCheckHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/admin/HealthCheckHandler.java@@ -65,7 +65,7 @@ public class HealthCheckHandler extends RequestHandlerBase {@Overridepublic 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 instancesrsp.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);