diff --git a/changelog/unreleased/SOLR-18417-remove-pingrequesthandler.yml b/changelog/unreleased/SOLR-18417-remove-pingrequesthandler.yml new file mode 100644 index 000000000000..ef4ced16ab18 --- /dev/null +++ b/changelog/unreleased/SOLR-18417-remove-pingrequesthandler.yml @@ -0,0 +1,8 @@ +type: removed +title: Remove the deprecated `/admin/ping` endpoint and SolrJ ping APIs. Use `HealthCheckRequest` for node health or `QueryRequest` to test searches. +authors: + - name: Jason Gerlowski + - name: Eric Pugh +links: + - name: SOLR-18417 + url: https://issues.apache.org/jira/browse/SOLR-18417 diff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java index 38a0d8a0d1e4..75e804a44677 100644 --- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java +++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java @@ -38,6 +38,7 @@ import org.apache.solr.client.solrj.jetty.HttpJettySolrClient; import org.apache.solr.client.solrj.request.AbstractUpdateRequest; import org.apache.solr.client.solrj.request.CoreAdminRequest.WaitForState; +import org.apache.solr.client.solrj.request.HealthCheckRequest; import org.apache.solr.client.solrj.request.UpdateRequest; import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException.ErrorCode; @@ -869,7 +870,7 @@ private Replica pingLeader(String ourUrl, CoreDescriptor coreDesc, boolean mayPu try (SolrClient httpSolrClient = recoverySolrClientBuilder(leaderReplica.getBaseUrl(), leaderReplica.getCoreName()) .build()) { - httpSolrClient.ping(); + new HealthCheckRequest().process(httpSolrClient); return leaderReplica; } catch (IOException e) { log.error("Failed to connect leader {} on recovery, try again", leaderReplica.getBaseUrl()); diff --git a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java deleted file mode 100644 index 62bba673b21b..000000000000 --- a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.solr.handler; - -import static org.apache.solr.common.params.CommonParams.ACTION; -import static org.apache.solr.common.params.CommonParams.DISABLE; -import static org.apache.solr.common.params.CommonParams.DISTRIB; -import static org.apache.solr.common.params.CommonParams.ENABLE; - -import java.io.IOException; -import java.lang.invoke.MethodHandles; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.time.Instant; -import java.util.Locale; -import org.apache.solr.common.SolrException; -import org.apache.solr.common.params.CommonParams; -import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.solr.common.params.ShardParams; -import org.apache.solr.common.params.SolrParams; -import org.apache.solr.common.util.NamedList; -import org.apache.solr.core.SolrCore; -import org.apache.solr.request.SolrQueryRequest; -import org.apache.solr.request.SolrRequestHandler; -import org.apache.solr.response.SolrQueryResponse; -import org.apache.solr.security.AuthorizationContext; -import org.apache.solr.util.plugin.SolrCoreAware; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Ping Request Handler for reporting SolrCore health to a Load Balancer. - * - *

This handler is designed to be used as the endpoint for an HTTP Load-Balancer to use when - * checking the "health" or "up status" of a Solr server. - * - *

In its simplest form, the PingRequestHandler should be configured with some defaults - * indicating a request that should be executed. If the request succeeds, then the - * PingRequestHandler will respond back with a simple "OK" status. If the request fails, then the - * PingRequestHandler will respond back with the corresponding HTTP Error code. Clients (such as - * load balancers) can be configured to poll the PingRequestHandler monitoring for these types of - * responses (or for a simple connection failure) to know if there is a problem with the Solr - * server. - * - *

Note in case isShard=true, PingRequestHandler respond back with what the delegated handler - * returns (by default it's /select handler). - * - *

- * <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
- *   <lst name="invariants">
- *     <str name="qt">/search</str><!-- handler to delegate to -->
- *     <str name="q">some test query</str>
- *   </lst>
- * </requestHandler>
- * 
- * - *

A more advanced option available, is to configure the handler with a "healthcheckFile" which - * can be used to enable/disable the PingRequestHandler. - * - *

- * <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
- *   <!-- relative paths are resolved against the data dir -->
- *   <str name="healthcheckFile">server-enabled.txt</str>
- *   <lst name="invariants">
- *     <str name="qt">/search</str><!-- handler to delegate to -->
- *     <str name="q">some test query</str>
- *   </lst>
- * </requestHandler>
- * 
- * - * - * - *

This health check file feature can be used as a way to indicate to some Load Balancers that - * the server should be "removed from rotation" for maintenance, or upgrades, or whatever reason you - * may wish. - * - *

The health check file may be created/deleted by any external system, or the PingRequestHandler - * itself can be used to create/delete the file by specifying an "action" param in a request: - * - *

- * - * @deprecated This handler is deprecated and will be removed in a future release. For load balancer - * or orchestration health checks, use {@link org.apache.solr.handler.admin.HealthCheckHandler} - * instead. instead. - * @since solr 1.3 - */ -@Deprecated(since = "10.1") -public class PingRequestHandler extends RequestHandlerBase implements SolrCoreAware { - private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - public static final String HEALTHCHECK_FILE_PARAM = "healthcheckFile"; - - @Override - public Name getPermissionName(AuthorizationContext request) { - String action = request.getParams().get(ACTION, "").strip().toLowerCase(Locale.ROOT); - // Modifying the health check file requires more permission than just doing a ping - switch (action) { - case ENABLE: - case DISABLE: - return Name.CONFIG_EDIT_PERM; - default: - return Name.HEALTH_PERM; - } - } - - protected enum ACTIONS { - STATUS, - ENABLE, - DISABLE, - PING - }; - - private String healthFileName = null; - private Path healthcheck = null; - - @Override - public void init(NamedList args) { - super.init(args); - Object tmp = args.get(HEALTHCHECK_FILE_PARAM); - healthFileName = (null == tmp ? null : tmp.toString()); - } - - @Override - public void inform(SolrCore core) { - if (null != healthFileName) { - healthcheck = Path.of(healthFileName); - if (!healthcheck.isAbsolute()) { - healthcheck = Path.of(core.getDataDir(), healthFileName); - healthcheck = healthcheck.toAbsolutePath(); - } - - if (!Files.isWritable(healthcheck.getParent())) { - // this is not fatal, users may not care about enable/disable via - // solr request, file might be touched/deleted by an external system - log.warn( - "Directory for configured healthcheck file is not writable by solr, PingRequestHandler will not be able to control enable/disable: {}", - healthcheck.getParent().toAbsolutePath()); - } - } - } - - /** - * Returns true if the healthcheck flag-file is enabled but does not exist, otherwise (no file - * configured, or file configured and exists) returns false. - */ - public boolean isPingDisabled() { - return (null != healthcheck && !Files.exists(healthcheck)); - } - - @Override - public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { - - SolrParams params = req.getParams(); - - // in this case, we want to default distrib to false so - // we only ping the single node - Boolean distrib = params.getBool(DISTRIB); - if (distrib == null) { - ModifiableSolrParams mparams = new ModifiableSolrParams(params); - mparams.set(DISTRIB, false); - req.setParams(mparams); - } - - String actionParam = params.get("action"); - ACTIONS action = null; - if (actionParam == null) { - action = ACTIONS.PING; - } else { - try { - action = ACTIONS.valueOf(actionParam.toUpperCase(Locale.ROOT)); - } catch (IllegalArgumentException iae) { - throw new SolrException( - SolrException.ErrorCode.BAD_REQUEST, "Unknown action: " + actionParam); - } - } - switch (action) { - case PING: - if (isPingDisabled()) { - SolrException e = - new SolrException(SolrException.ErrorCode.SERVICE_UNAVAILABLE, "Service disabled"); - rsp.setException(e); - return; - } - handlePing(req, rsp); - break; - case ENABLE: - handleEnable(true); - break; - case DISABLE: - handleEnable(false); - break; - case STATUS: - if (healthcheck == null) { - rsp.add("status", "not_configured"); - } else { - rsp.add("status", isPingDisabled() ? "disabled" : "enabled"); - } - } - } - - protected void handlePing(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { - - SolrParams params = req.getParams(); - SolrCore core = req.getCore(); - - // Get the RequestHandler - String qt = params.get(CommonParams.QT); // optional; you get the default otherwise - SolrRequestHandler handler = core.getRequestHandler(qt); - if (handler == null) { - throw new SolrException( - SolrException.ErrorCode.BAD_REQUEST, "Unknown RequestHandler (qt): " + qt); - } - - if (handler instanceof PingRequestHandler) { - // In case it's a query for shard, use default handler - if (params.getBool(ShardParams.IS_SHARD, false)) { - handler = core.getRequestHandler(null); - ModifiableSolrParams wparams = new ModifiableSolrParams(params); - wparams.remove(CommonParams.QT); - req.setParams(wparams); - } else { - throw new SolrException( - SolrException.ErrorCode.BAD_REQUEST, - "Cannot execute the PingRequestHandler recursively"); - } - } - - // Execute the ping query and catch any possible exception - Throwable ex = null; - - // In case it's a query for shard, return the result from delegated handler for distributed - // query to merge result - if (params.getBool(ShardParams.IS_SHARD, false)) { - try { - core.execute(handler, req, rsp); - ex = rsp.getException(); - } catch (Exception e) { - ex = e; - } - // Send an error or return - if (ex != null) { - throw new SolrException( - SolrException.ErrorCode.SERVER_ERROR, - "Ping query caused exception: " + ex.getMessage(), - ex); - } - } else { - try { - SolrQueryResponse pingrsp = new SolrQueryResponse(); - core.execute(handler, req, pingrsp); - ex = pingrsp.getException(); - NamedList headers = rsp.getResponseHeader(); - if (headers != null) { - headers.add("zkConnected", pingrsp.getResponseHeader().get("zkConnected")); - } - - } catch (Exception e) { - ex = e; - } - - // Send an error or an 'OK' message (response code will be 200) - if (ex != null) { - throw new SolrException( - SolrException.ErrorCode.SERVER_ERROR, - "Ping query caused exception: " + ex.getMessage(), - ex); - } - - rsp.add("status", "OK"); - } - } - - protected void handleEnable(boolean enable) throws SolrException { - if (healthcheck == null) { - throw new SolrException( - SolrException.ErrorCode.SERVICE_UNAVAILABLE, "No healthcheck file defined."); - } - if (enable) { - try { - // write out when the file was created - Files.write(healthcheck, Instant.now().toString().getBytes(StandardCharsets.UTF_8)); - } catch (IOException e) { - throw new SolrException( - SolrException.ErrorCode.SERVER_ERROR, "Unable to write healthcheck flag file", e); - } - } else { - try { - Files.deleteIfExists(healthcheck); - } catch (Throwable cause) { - throw new SolrException( - SolrException.ErrorCode.NOT_FOUND, - "Did not successfully delete healthcheck file: " + healthcheck.toAbsolutePath(), - cause); - } - } - } - - //////////////////////// SolrInfoMBeans methods ////////////////////// - - @Override - public String getDescription() { - return "Reports application health to a load-balancer"; - } - - @Override - public Boolean registerV2() { - return Boolean.TRUE; - } - - @Override - public Category getCategory() { - return Category.ADMIN; - } -} diff --git a/solr/core/src/java/org/apache/solr/metrics/SolrMetricInfo.java b/solr/core/src/java/org/apache/solr/metrics/SolrMetricInfo.java index d01dd8f8b31d..2d27780ddbf6 100644 --- a/solr/core/src/java/org/apache/solr/metrics/SolrMetricInfo.java +++ b/solr/core/src/java/org/apache/solr/metrics/SolrMetricInfo.java @@ -29,7 +29,7 @@ public final class SolrMetricInfo { * Creates a new instance of {@link SolrMetricInfo}. * * @param category the category of the metric (e.g. `QUERY`) - * @param scope the scope of the metric (e.g. `/admin/ping`) + * @param scope the scope of the metric (e.g. `/admin/segments`) * @param name the name of the metric (e.g. `Requests`) */ public SolrMetricInfo(SolrInfoBean.Category category, String scope, String name) { diff --git a/solr/core/src/resources/ImplicitPlugins.json b/solr/core/src/resources/ImplicitPlugins.json index 8bb2019695a7..4cb1bff2b2a1 100644 --- a/solr/core/src/resources/ImplicitPlugins.json +++ b/solr/core/src/resources/ImplicitPlugins.json @@ -57,14 +57,6 @@ "omitHeader": true } }, - "/admin/ping": { - "class": "solr.PingRequestHandler", - "useParams":"_ADMIN_PING", - "invariants": { - "echoParams": "all", - "q": "{!lucene}*:*" - } - }, "/admin/segments": { "class": "solr.SegmentsInfoRequestHandler", "useParams":"_ADMIN_SEGMENTS" diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-sql.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-sql.xml index d9efb26fa811..d36eb39cc3bf 100644 --- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-sql.xml +++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-sql.xml @@ -53,14 +53,4 @@ - - - *:* - - - all - - server-enabled.txt - - diff --git a/solr/core/src/test/org/apache/solr/core/SolrCoreTest.java b/solr/core/src/test/org/apache/solr/core/SolrCoreTest.java index 7da04f095e65..a86413a01079 100644 --- a/solr/core/src/test/org/apache/solr/core/SolrCoreTest.java +++ b/solr/core/src/test/org/apache/solr/core/SolrCoreTest.java @@ -97,8 +97,6 @@ public void testImplicitPlugins() { ++ihCount; assertEquals(pathToClassMap.get("/admin/luke"), "solr.LukeRequestHandler"); ++ihCount; - assertEquals(pathToClassMap.get("/admin/ping"), "solr.PingRequestHandler"); - ++ihCount; assertEquals(pathToClassMap.get("/admin/segments"), "solr.SegmentsInfoRequestHandler"); ++ihCount; assertEquals(pathToClassMap.get("/admin/info"), "solr.CoreInfoHandler"); diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java b/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java index 525eb36d673b..fe6aa5377784 100644 --- a/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java +++ b/solr/core/src/test/org/apache/solr/core/TestSolrConfigHandler.java @@ -125,7 +125,6 @@ public void testProperty() throws Exception { assertNotNull(confMap._get(asList("config", requestHandlerKey, "/admin/luke"), null)); assertNotNull(confMap._get(asList("config", requestHandlerKey, "/admin/info"), null)); assertNotNull(confMap._get(asList("config", requestHandlerKey, "/admin/file"), null)); - assertNotNull(confMap._get(asList("config", requestHandlerKey, "/admin/ping"), null)); String payload = "{\n" diff --git a/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java deleted file mode 100644 index 4180be913579..000000000000 --- a/solr/core/src/test/org/apache/solr/handler/PingRequestHandlerTest.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.solr.handler; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import org.apache.solr.SolrTestCaseJ4; -import org.apache.solr.client.solrj.impl.CloudSolrClient; -import org.apache.solr.client.solrj.request.CollectionAdminRequest; -import org.apache.solr.client.solrj.request.SolrPing; -import org.apache.solr.client.solrj.response.SolrPingResponse; -import org.apache.solr.cloud.MiniSolrCloudCluster; -import org.apache.solr.cloud.SolrCloudTestCase; -import org.apache.solr.common.SolrException; -import org.apache.solr.common.util.NamedList; -import org.apache.solr.embedded.JettyConfig; -import org.apache.solr.embedded.JettySolrRunner; -import org.apache.solr.request.SolrQueryRequest; -import org.apache.solr.response.SolrQueryResponse; -import org.junit.Before; -import org.junit.BeforeClass; - -public class PingRequestHandlerTest extends SolrTestCaseJ4 { - protected int NUM_SERVERS = 5; - protected int NUM_SHARDS = 2; - protected int REPLICATION_FACTOR = 2; - - private final String fileName = this.getClass().getName() + ".server-enabled"; - private Path healthcheckFile = null; - private PingRequestHandler handler = null; - - @BeforeClass - public static void beforeClass() throws Exception { - initCore("solrconfig.xml", "schema.xml"); - } - - @Before - public void before() throws IOException { - // by default, use relative file in dataDir - healthcheckFile = initAndGetDataDir().resolve(fileName); - String fileNameParam = fileName; - - // sometimes randomly use an absolute File path instead - if (random().nextBoolean()) { - fileNameParam = healthcheckFile.toString(); - } - - if (Files.exists(healthcheckFile)) Files.delete(healthcheckFile); - - handler = new PingRequestHandler(); - NamedList initParams = new NamedList<>(); - initParams.add(PingRequestHandler.HEALTHCHECK_FILE_PARAM, fileNameParam); - handler.init(initParams); - handler.inform(h.getCore()); - } - - public void testPingWithNoHealthCheck() throws Exception { - - // for this test, we don't want any healthcheck file configured at all - handler = new PingRequestHandler(); - handler.init(new NamedList<>()); - handler.inform(h.getCore()); - - SolrQueryResponse rsp = null; - - rsp = makeRequest(handler, req()); - assertEquals("OK", rsp.getValues().get("status")); - - rsp = makeRequest(handler, req("action", "ping")); - assertEquals("OK", rsp.getValues().get("status")); - - rsp = makeRequest(handler, req("action", "status")); - assertEquals("not_configured", rsp.getValues().get("status")); - assertNull(rsp.getException()); - } - - public void testEnablingServer() throws Exception { - - assertFalse(Files.exists(healthcheckFile)); - - // first make sure that ping responds back that the service is disabled - SolrQueryResponse sqr = makeRequest(handler, req()); - SolrException se = (SolrException) sqr.getException(); - assertEquals( - "Response should have been replaced with a 503 SolrException.", - se.code(), - SolrException.ErrorCode.SERVICE_UNAVAILABLE.code); - - // now enable - - makeRequest(handler, req("action", "enable")); - - assertTrue(Files.exists(healthcheckFile)); - assertNotNull(Files.readString(healthcheckFile, StandardCharsets.UTF_8)); - - // now verify that the handler response with success - - SolrQueryResponse rsp = makeRequest(handler, req()); - assertEquals("OK", rsp.getValues().get("status")); - - // enable when already enabled shouldn't cause any problems - makeRequest(handler, req("action", "enable")); - assertTrue(Files.exists(healthcheckFile)); - } - - public void testDisablingServer() throws Exception { - - assertFalse(Files.exists(healthcheckFile)); - - Files.createFile(healthcheckFile); - - // first make sure that ping responds back that the service is enabled - - SolrQueryResponse rsp = makeRequest(handler, req()); - assertEquals("OK", rsp.getValues().get("status")); - - // now disable - - makeRequest(handler, req("action", "disable")); - - assertFalse(Files.exists(healthcheckFile)); - - // now make sure that ping responds back that the service is disabled - SolrQueryResponse sqr = makeRequest(handler, req()); - SolrException se = (SolrException) sqr.getException(); - assertEquals( - "Response should have been replaced with a 503 SolrException.", - se.code(), - SolrException.ErrorCode.SERVICE_UNAVAILABLE.code); - - // disable when already disabled shouldn't cause any problems - makeRequest(handler, req("action", "disable")); - assertFalse(Files.exists(healthcheckFile)); - } - - public void testGettingStatus() throws Exception { - SolrQueryResponse rsp = null; - - handler.handleEnable(true); - - rsp = makeRequest(handler, req("action", "status")); - assertEquals("enabled", rsp.getValues().get("status")); - - handler.handleEnable(false); - - rsp = makeRequest(handler, req("action", "status")); - assertEquals("disabled", rsp.getValues().get("status")); - } - - public void testBadActionRaisesException() { - SolrException se = - expectThrows(SolrException.class, () -> makeRequest(handler, req("action", "badaction"))); - assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, se.code()); - } - - public void testPingInClusterWithNoHealthCheck() throws Exception { - - MiniSolrCloudCluster miniCluster = - new MiniSolrCloudCluster(NUM_SERVERS, createTempDir(), JettyConfig.builder().build()); - - final CloudSolrClient cloudSolrClient = miniCluster.getSolrClient(); - - try { - assertNotNull(miniCluster.getZkServer()); - List jettys = miniCluster.getJettySolrRunners(); - assertEquals(NUM_SERVERS, jettys.size()); - for (JettySolrRunner jetty : jettys) { - assertTrue(jetty.isRunning()); - } - - // create collection - String collectionName = "testSolrCloudCollection"; - String configName = "solrCloudCollectionConfig"; - miniCluster.uploadConfigSet( - SolrTestCaseJ4.TEST_PATH().resolve("collection1").resolve("conf"), configName); - CollectionAdminRequest.createCollection( - collectionName, configName, NUM_SHARDS, REPLICATION_FACTOR) - .setPerReplicaState(SolrCloudTestCase.isPRS()) - .process(miniCluster.getSolrClient()); - - // Send distributed and non-distributed ping query - SolrPingWithDistrib reqDistrib = new SolrPingWithDistrib(); - reqDistrib.setDistrib(true); - SolrPingResponse rsp = reqDistrib.process(cloudSolrClient, collectionName); - assertEquals(0, rsp.getStatus()); - assertTrue(rsp.getResponseHeader().getBooleanArg(("zkConnected"))); - - SolrPing reqNonDistrib = new SolrPing(); - rsp = reqNonDistrib.process(cloudSolrClient, collectionName); - assertEquals(0, rsp.getStatus()); - assertTrue(rsp.getResponseHeader().getBooleanArg(("zkConnected"))); - - } finally { - miniCluster.shutdown(); - } - } - - /** - * Helper Method: Executes the request against the handler, returns the response, and closes the - * request. - */ - private SolrQueryResponse makeRequest(PingRequestHandler handler, SolrQueryRequest req) - throws Exception { - - SolrQueryResponse rsp = new SolrQueryResponse(); - try { - handler.handleRequestBody(req, rsp); - } finally { - req.close(); - } - return rsp; - } - - static class SolrPingWithDistrib extends SolrPing { - public SolrPing setDistrib(boolean distrib) { - getParams().add("distrib", distrib ? "true" : "false"); - return this; - } - } -} diff --git a/solr/core/src/test/org/apache/solr/handler/TestHttpRequestId.java b/solr/core/src/test/org/apache/solr/handler/TestHttpRequestId.java index ef0f486fa30e..aecffaec0f9b 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestHttpRequestId.java +++ b/solr/core/src/test/org/apache/solr/handler/TestHttpRequestId.java @@ -28,7 +28,7 @@ import org.apache.logging.log4j.core.LogEvent; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.jetty.HttpJettySolrClient; -import org.apache.solr.client.solrj.request.SolrPing; +import org.apache.solr.client.solrj.request.HealthCheckRequest; import org.apache.solr.common.util.ExecutorUtil; import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.SolrNamedThreadFactory; @@ -106,7 +106,7 @@ private void setupClientAndRun( MDC.put(key, value); cf = client - .requestAsync(new SolrPing(), null) + .requestAsync(new HealthCheckRequest(), null) .whenComplete((nl, e) -> assertEquals(value, MDC.get(key))); } finally { ExecutorUtil.shutdownAndAwaitTermination(commExecutor); diff --git a/solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java b/solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java index 6b84fba189a2..7a3758e1ebbd 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/TestApiFramework.java @@ -58,7 +58,6 @@ import org.apache.solr.common.util.ValidatingJsonMap; import org.apache.solr.core.CoreContainer; import org.apache.solr.core.PluginBag; -import org.apache.solr.handler.PingRequestHandler; import org.apache.solr.handler.SchemaHandler; import org.apache.solr.handler.SolrConfigHandler; import org.apache.solr.request.SolrQueryRequest; @@ -91,7 +90,6 @@ public void testFramework() { new PluginBag<>(SolrRequestHandler.class, null, false); coreHandlers.put("/schema", new SchemaHandler()); coreHandlers.put("/config", new SolrConfigHandler()); - coreHandlers.put("/admin/ping", new PingRequestHandler()); Map parts = new HashMap<>(); String fullPath = "/collections/hello"; diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigSolrCloudTest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigSolrCloudTest.java index 8ae8b63afbf4..1f60df8f5bea 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigSolrCloudTest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigSolrCloudTest.java @@ -128,7 +128,7 @@ public void testGetRequestHandlersFromCollection() throws Exception { Map configSection = (Map) response.config.get(REQUEST_HANDLERS); assertNotNull(configSection); assertTrue(configSection.containsKey("/select")); - assertTrue(configSection.containsKey("/admin/ping")); + assertTrue(configSection.containsKey("/admin/luke")); assertTrue(configSection.containsKey("/graph")); } @@ -158,7 +158,7 @@ public void testGetRequestHandlersFilteredByNameFromCollection() throws Exceptio @SuppressWarnings("unchecked") public void testGetRequestHandlersExpandParamsTrue() throws Exception { var request = new ConfigApi.GetRequestHandler(IndexType.COLLECTION, COLLECTION_NAME); - request.setComponentName("/admin/ping"); + request.setComponentName("/admin/luke"); request.setExpandParams(true); var response = request.process(cluster.getSolrClient()); @@ -169,25 +169,25 @@ public void testGetRequestHandlersExpandParamsTrue() throws Exception { Map configSection = (Map) response.config.get(REQUEST_HANDLERS); - Map pingRHSection = (Map) configSection.get("/admin/ping"); - assertTrue(pingRHSection.containsKey("_useParamsExpanded_")); - assertNotNull(pingRHSection.get("_useParamsExpanded_")); - Map expandedPingRHSection = - (Map) pingRHSection.get("_useParamsExpanded_"); - assertEquals("[NOT AVAILABLE]", expandedPingRHSection.get("_ADMIN_PING")); + Map lukeRHSection = (Map) configSection.get("/admin/luke"); + assertTrue(lukeRHSection.containsKey("_useParamsExpanded_")); + assertNotNull(lukeRHSection.get("_useParamsExpanded_")); + Map expandedLukeRHSection = + (Map) lukeRHSection.get("_useParamsExpanded_"); + assertEquals("[NOT AVAILABLE]", expandedLukeRHSection.get("_ADMIN_LUKE")); } @Test @SuppressWarnings("unchecked") public void testGetRequestHandlersOmitsExpandedParamsByDefault() throws Exception { var request = new ConfigApi.GetRequestHandler(IndexType.COLLECTION, COLLECTION_NAME); - request.setComponentName("/admin/ping"); + request.setComponentName("/admin/luke"); var response = request.process(cluster.getSolrClient()); Map configSection = (Map) response.config.get(REQUEST_HANDLERS); - Map pingRHSection = (Map) configSection.get("/admin/ping"); - assertFalse(pingRHSection.containsKey("_useParamsExpanded_")); + Map lukeRHSection = (Map) configSection.get("/admin/luke"); + assertFalse(lukeRHSection.containsKey("_useParamsExpanded_")); } @Test diff --git a/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigTest.java b/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigTest.java index 73ebc01530cd..13982b6acb57 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigTest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/api/GetConfigTest.java @@ -105,7 +105,7 @@ public void testGetRequestHandlersFromCore() throws Exception { Map configSection = (Map) response.config.get(REQUEST_HANDLERS); assertNotNull(configSection); assertTrue(configSection.containsKey("/select")); - assertTrue(configSection.containsKey("/admin/ping")); + assertTrue(configSection.containsKey("/admin/luke")); assertTrue(configSection.containsKey("/spell")); } @@ -135,7 +135,7 @@ public void testGetRequestHandlersFilteredByNameFromCore() throws Exception { @SuppressWarnings("unchecked") public void testGetRequestHandlersExpandParamsTrue() throws Exception { var request = new ConfigApi.GetRequestHandler(IndexType.CORE, CORE_NAME); - request.setComponentName("/admin/ping"); + request.setComponentName("/admin/luke"); request.setExpandParams(true); var response = request.process(solrTestRule.getSolrClient(CORE_NAME)); @@ -146,25 +146,25 @@ public void testGetRequestHandlersExpandParamsTrue() throws Exception { Map configSection = (Map) response.config.get(REQUEST_HANDLERS); - Map pingRHSection = (Map) configSection.get("/admin/ping"); - assertTrue(pingRHSection.containsKey("_useParamsExpanded_")); - assertNotNull(pingRHSection.get("_useParamsExpanded_")); - Map expandedPingRHSection = - (Map) pingRHSection.get("_useParamsExpanded_"); - assertEquals("[NOT AVAILABLE]", expandedPingRHSection.get("_ADMIN_PING")); + Map lukeRHSection = (Map) configSection.get("/admin/luke"); + assertTrue(lukeRHSection.containsKey("_useParamsExpanded_")); + assertNotNull(lukeRHSection.get("_useParamsExpanded_")); + Map expandedLukeRHSection = + (Map) lukeRHSection.get("_useParamsExpanded_"); + assertEquals("[NOT AVAILABLE]", expandedLukeRHSection.get("_ADMIN_LUKE")); } @Test @SuppressWarnings("unchecked") public void testGetRequestHandlersOmitsExpandedParamsByDefault() throws Exception { var request = new ConfigApi.GetRequestHandler(IndexType.CORE, CORE_NAME); - request.setComponentName("/admin/ping"); + request.setComponentName("/admin/luke"); var response = request.process(solrTestRule.getSolrClient(CORE_NAME)); Map configSection = (Map) response.config.get(REQUEST_HANDLERS); - Map pingRHSection = (Map) configSection.get("/admin/ping"); - assertFalse(pingRHSection.containsKey("_useParamsExpanded_")); + Map lukeRHSection = (Map) configSection.get("/admin/luke"); + assertFalse(lukeRHSection.containsKey("_useParamsExpanded_")); } @Test diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/implicit-requesthandlers.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/implicit-requesthandlers.adoc index 03780b6f1d1c..72ada4441a77 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/implicit-requesthandlers.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/implicit-requesthandlers.adoc @@ -21,7 +21,7 @@ Solr ships with many out-of-the-box request handlers, which are called implicit because they do not need to be configured in `solrconfig.xml` before you are able to use them. Each implicit handler ships with a named bundle of default, invariant, and appended parameters - a _paramset_ - equivalent to the ``, ``, and `` blocks you'd normally write into a `` definition in `solrconfig.xml`. -Because implicit handlers have no entry in `solrconfig.xml` to edit directly, their paramset (shown for each handler below, e.g. `_ADMIN_PING` for the Ping handler) is the only way to override their parameters - see <> and <> below. +Because implicit handlers have no entry in `solrconfig.xml` to edit directly, their paramset (shown for each handler below, e.g. `_ADMIN_LUKE` for the Luke handler) is the only way to override their parameters - see <> and <> below. == Available Implicit Endpoints @@ -113,20 +113,6 @@ solr//admin/luke + Paramset: `_ADMIN_LUKE` -Ping:: Health check designed for use by a load balancer. -This handler must have a collection name in the path to the endpoint. -+ -CAUTION: `PingRequestHandler` is deprecated and will be removed in a future release. Use the `Health` endpoint above instead. -+ -*Documentation*: xref:deployment-guide:ping.adoc[] -+ -[source,bash] ----- -solr//admin/ping ----- -+ -Paramset: `_ADMIN_PING` - System Properties:: Return JRE system properties. Secret values are redacted. + diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/requesthandlers-searchcomponents.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/requesthandlers-searchcomponents.adoc index a5c03a96b327..4114f20c0218 100644 --- a/solr/solr-ref-guide/modules/configuration-guide/pages/requesthandlers-searchcomponents.adoc +++ b/solr/solr-ref-guide/modules/configuration-guide/pages/requesthandlers-searchcomponents.adoc @@ -19,7 +19,7 @@ After the `` section of `solrconfig.xml`, request handlers and search components are configured. A _request handler_ processes requests coming to Solr. -These might be query requests, index update requests or specialized interactions such as xref:deployment-guide:ping.adoc[]. +These might be queries, index updates, or other admin operations. Not all handlers are defined explicitly in `solrconfig.xml`, many are defined implicitly. See xref:implicit-requesthandlers.adoc[] for details. diff --git a/solr/solr-ref-guide/modules/deployment-guide/deployment-nav.adoc b/solr/solr-ref-guide/modules/deployment-guide/deployment-nav.adoc index e28b229f77a0..8685e34205c1 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/deployment-nav.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/deployment-nav.adoc @@ -102,7 +102,6 @@ *** xref:user-managed-distributed-search.adoc[] * Monitoring Solr -** xref:ping.adoc[] ** xref:healthcheck.adoc[] ** xref:configuring-logging.adoc[] ** xref:opentelemetry.adoc[] diff --git a/solr/solr-ref-guide/modules/deployment-guide/examples/UsingPingRefGuideExamplesTest.java b/solr/solr-ref-guide/modules/deployment-guide/examples/UsingPingRefGuideExamplesTest.java deleted file mode 100644 index 71e3f7b25866..000000000000 --- a/solr/solr-ref-guide/modules/deployment-guide/examples/UsingPingRefGuideExamplesTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -import org.apache.solr.client.solrj.SolrClient; -import org.apache.solr.client.solrj.request.CollectionAdminRequest; -import org.apache.solr.client.solrj.request.SolrPing; -import org.apache.solr.client.solrj.response.SolrPingResponse; -import org.apache.solr.cloud.SolrCloudTestCase; -import org.apache.solr.util.ExternalPaths; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Example Ping usage. - * - *

Snippets surrounded by "tag" and "end" comments are extracted and used in the Solr Reference - * Guide. - */ -public class UsingPingRefGuideExamplesTest extends SolrCloudTestCase { - - private static final int NUM_LIVE_NODES = 1; - - @BeforeClass - public static void setUpCluster() throws Exception { - configureCluster(NUM_LIVE_NODES) - .addConfig("conf", ExternalPaths.TECHPRODUCTS_CONFIGSET) - .configure(); - - CollectionAdminRequest.createCollection("techproducts", "conf", 1, 1) - .process(cluster.getSolrClient()); - cluster.waitForActiveCollection("techproducts", 1, 1); - } - - private SolrClient getSolrClient() { - return cluster.getSolrClient(); - } - - @Test - public void solrJExampleWithSolrPing() throws Exception { - - final SolrClient solrClient = getSolrClient(); - String collectionName = "techproducts"; - - // tag::solrj-example-with-solrping[] - SolrPing ping = new SolrPing(); - ping.getParams() - .add("distrib", "true"); // To make it a distributed request against a collection - SolrPingResponse rsp = ping.process(solrClient, collectionName); - String status = (String) rsp.getResponse().get("status"); - // end::solrj-example-with-solrping[] - - assertEquals("OK", status); - } - - @Test - public void solrJExampleWithSolrClient() throws Exception { - - String collectionName = "techproducts"; - - // tag::solrj-example-with-solrclient[] - final SolrClient solrClient = getSolrClient(); - SolrPingResponse pingResponse = solrClient.ping(collectionName); - String status = (String) pingResponse.getResponse().get("status"); - // end::solrj-example-with-solrclient[] - - assertEquals("OK", status); - } -} diff --git a/solr/solr-ref-guide/modules/deployment-guide/images/ping/ping.png b/solr/solr-ref-guide/modules/deployment-guide/images/ping/ping.png deleted file mode 100644 index 055b344546de..000000000000 Binary files a/solr/solr-ref-guide/modules/deployment-guide/images/ping/ping.png and /dev/null differ diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/ping.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/ping.adoc deleted file mode 100644 index 5edd0ae4efc6..000000000000 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/ping.adoc +++ /dev/null @@ -1,128 +0,0 @@ -= Ping -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -[WARNING] -==== -The `/admin/ping` endpoint (`PingRequestHandler`) is deprecated and will be removed in a future release. -For load balancer or orchestration health checks, use the `solr/admin/info/health` (v1) or `api/node/health` (v2) endpoint, documented in the "Health" section of xref:configuration-guide:implicit-requesthandlers.adoc[], instead. -==== - -Choosing Ping under a core name issues a `ping` request to check whether the core is up and responding to requests. - -.Ping Option in Core Dropdown -image::ping/ping.png[image,width=171,height=195] - -The search executed by a Ping is configured with the xref:configuration-guide:request-parameters-api.adoc[]. -See xref:configuration-guide:implicit-requesthandlers.adoc[] for the paramset to use for the `/admin/ping` endpoint. - -== Configuring Ping - -`PingRequestHandler` delegates to a configured query, set via `qt`/`q` invariants, and responds `OK` if that query succeeds, or with the delegated handler's error if it doesn't: - -[source,xml] ----- - - - /search - some test query - - ----- - -You can also configure a `healthcheckFile` to enable or disable the handler independent of whether Solr itself is healthy - useful for pulling a node out of load balancer rotation for maintenance: - -[source,xml] ----- - - - server-enabled.txt - - /search - - ----- - -With `healthcheckFile` configured, an `action` request parameter controls it: - -* `action=enable` - creates the health check file if it doesn't already exist -* `action=disable` - deletes the health check file if it exists -* `action=status` - reports `enabled`, `disabled`, or `not_configured` - -If the file is configured but missing, Ping returns an HTTP error even if the server is otherwise healthy. - -The Ping option doesn't open a page, but the status of the request can be seen on the core overview page shown when clicking on a collection name. -The length of time the request has taken is displayed next to the Ping option, in milliseconds. - -== Ping API Examples - -While the UI screen makes it easy to see the ping response time, the underlying ping command can be more useful when executed by remote monitoring tools: - -*Input* - -[source,bash] ----- -http://localhost:8983/solr//admin/ping ----- - -This command will ping the core name for a response. - -*Input* - -[source,bash] ----- -http://localhost:8983/solr//admin/ping?distrib=true&wt=xml ----- - -This command will ping all replicas of the given collection name for a response: - -*Sample Output* - -[source,xml] ----- - - - 0 - 13 - - {!lucene}*:* - false - _text_ - 10 - all - - - OK - ----- - -Both API calls have the same output. -A status=OK indicates that the nodes are responding. - -*SolrJ Example with SolrPing* - -[source,java,indent=0] ----- -include::example$UsingPingRefGuideExamplesTest.java[tag=solrj-example-with-solrping] ----- - -*SolrJ Example with SolrClient* - -[source,java,indent=0] ----- -include::example$UsingPingRefGuideExamplesTest.java[tag=solrj-example-with-solrclient] ----- diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/rule-based-authorization-plugin.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/rule-based-authorization-plugin.adoc index 0d1e0f5c4820..fb9461f37b41 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/rule-based-authorization-plugin.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/rule-based-authorization-plugin.adoc @@ -395,7 +395,7 @@ If edit permissions should only be applied to specific collections, a custom per Note that this allows configuration read permissions for _all_ collections. If read permissions should only be applied to specific collections, a custom permission would need to be created. * *metrics-read*: this permission allows access to Solr's xref:metrics-reporting.adoc#metrics-api[Metrics API], some xref:configuration-guide:implicit-requesthandlers.adoc#admin-handlers[implicit admin handlers] such as `solr//admin/mbeans` and `solr//admin/segments`, as well as other admin APIs exposing metrics. -* *health*: this permission allows access to Solr's xref:configuration-guide:implicit-requesthandlers.adoc#admin-handlers[Health Check and Ping] endpoints, typically used to monitor whether a node or core is healthy. +* *health*: this permission allows access to Solr's xref:healthcheck.adoc[Health Check] endpoint, typically used to monitor whether a node is healthy. * *core-admin-edit*: Core admin commands that can mutate the system state. * *core-admin-read*: Read operations on the core admin API * *collection-admin-edit*: this permission is allowed to edit a collection's configuration using the xref:configuration-guide:collections-api.adoc[]. diff --git a/solr/solr-ref-guide/modules/getting-started/pages/solr-admin-ui.adoc b/solr/solr-ref-guide/modules/getting-started/pages/solr-admin-ui.adoc index 0ff1885be0e5..459cd5b064fc 100644 --- a/solr/solr-ref-guide/modules/getting-started/pages/solr-admin-ui.adoc +++ b/solr/solr-ref-guide/modules/getting-started/pages/solr-admin-ui.adoc @@ -181,7 +181,6 @@ Here are sections throughout the Guide describing each screen of the Admin UI: // tag::ui-core-tools[] [cols="1,1",frame=none,grid=none,stripes=none] |=== -| xref:deployment-guide:ping.adoc[]: Ping a named core to determine whether it is active. | xref:deployment-guide:plugins-stats-screen.adoc[]: Statistics for request handlers, search components, plugins, and other installed components. | xref:deployment-guide:user-managed-index-replication.adoc#replication-screen[Replication Screen]: Enable replication for a core and view current replication status. | xref:configuration-guide:index-segments-merging.adoc#segments-info-screen[Segments Info Screen]: Visualization of the underlying Lucene index segments. diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-11.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-11.adoc index 184aee185213..ab966421e05e 100644 --- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-11.adoc +++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-11.adoc @@ -27,6 +27,17 @@ For example, if you are currently using Solr 10.1, you should review changes mad == Removed Features +=== Ping Request Handler and SolrJ Ping APIs + +`PingRequestHandler` and its `/admin/ping` endpoint, deprecated in Solr 10.1, have been removed. +Remove any explicit `PingRequestHandler` declarations from `solrconfig.xml` before upgrading; otherwise the core cannot load the removed class. +Update monitoring probes to use `/api/node/health` (V2) or `/solr/admin/info/health` (V1) for node health. +These endpoints do not execute a query; use a query request when you need to verify that a core or collection can serve searches. +See xref:deployment-guide:healthcheck.adoc[] for the available health checks. + +`SolrPing`, `SolrPingResponse`, and both `SolrClient.ping()` overloads have also been removed. +SolrJ applications should use `HealthCheckRequest` for node health or `QueryRequest` for a query check. + === Overseer Roles API The `ADDROLE` and `REMOVEROLE` Collections API commands have been removed, together with their V2 `add-role` and `remove-role` counterparts, the `CollectionAdminRequest.addRole` and `CollectionAdminRequest.removeRole` SolrJ methods, and the `roles` section of the `CLUSTERSTATUS` response. diff --git a/solr/solrj-jetty/src/test/org/apache/solr/client/solrj/jetty/HttpJettySolrClientTest.java b/solr/solrj-jetty/src/test/org/apache/solr/client/solrj/jetty/HttpJettySolrClientTest.java index 365f9a2b098d..8fb0b71abce8 100644 --- a/solr/solrj-jetty/src/test/org/apache/solr/client/solrj/jetty/HttpJettySolrClientTest.java +++ b/solr/solrj-jetty/src/test/org/apache/solr/client/solrj/jetty/HttpJettySolrClientTest.java @@ -41,10 +41,10 @@ import org.apache.solr.client.solrj.impl.HttpSolrClient; import org.apache.solr.client.solrj.impl.HttpSolrClientTestBase; import org.apache.solr.client.solrj.request.ContentWriterUpdateRequest; +import org.apache.solr.client.solrj.request.HealthCheckRequest; import org.apache.solr.client.solrj.request.JavaBinRequestWriter; import org.apache.solr.client.solrj.request.QueryRequest; import org.apache.solr.client.solrj.request.RequestWriter; -import org.apache.solr.client.solrj.request.SolrPing; import org.apache.solr.client.solrj.request.SolrQuery; import org.apache.solr.client.solrj.request.XMLRequestWriter; import org.apache.solr.client.solrj.response.InputStreamResponseParser; @@ -187,7 +187,9 @@ public void testSolrExceptionWithNullBaseurl() throws IOException, SolrServerExc try { // if client base url is null, request url will be used in exception message client.requestWithBaseUrl( - solrTestRule.getBaseUrl() + DEBUG_SERVLET_PATH, new SolrPing(), DEFAULT_COLLECTION); + solrTestRule.getBaseUrl() + DEBUG_SERVLET_PATH, + new HealthCheckRequest(), + DEFAULT_COLLECTION); fail("Didn't get excepted exception from oversided request"); } catch (SolrException e) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java index fbc5ef6df2b6..6d67b742cc7a 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java @@ -26,12 +26,10 @@ import org.apache.solr.client.solrj.SolrRequest.METHOD; import org.apache.solr.client.solrj.beans.DocumentObjectBinder; import org.apache.solr.client.solrj.request.QueryRequest; -import org.apache.solr.client.solrj.request.SolrPing; import org.apache.solr.client.solrj.request.UpdateRequest; import org.apache.solr.client.solrj.response.FastStreamingDocsCallback; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.client.solrj.response.ResponseParser; -import org.apache.solr.client.solrj.response.SolrPingResponse; import org.apache.solr.client.solrj.response.StreamingJavaBinResponseParser; import org.apache.solr.client.solrj.response.StreamingResponseCallback; import org.apache.solr.client.solrj.response.UpdateResponse; @@ -887,35 +885,6 @@ public UpdateResponse deleteByQuery(String query, int commitWithinMs) return deleteByQuery(null, query, commitWithinMs); } - /** - * Issues a ping request to check if the collection's replicas are alive - * - * @param collection collection to ping - * @return a {@link org.apache.solr.client.solrj.response.SolrPingResponse} containing the - * response from the server - * @throws IOException If there is a low-level I/O error. - * @throws SolrServerException if there is an error on the server - * @deprecated This method is deprecated and will be removed in a future release. - */ - @Deprecated(since = "10.1") - public SolrPingResponse ping(String collection) throws SolrServerException, IOException { - return new SolrPing().process(this, collection); - } - - /** - * Issues a ping request to check if the server is alive - * - * @return a {@link org.apache.solr.client.solrj.response.SolrPingResponse} containing the - * response from the server - * @throws IOException If there is a low-level I/O error. - * @throws SolrServerException if there is an error on the server - * @deprecated This method is deprecated and will be removed in a future release. - */ - @Deprecated(since = "10.1") - public SolrPingResponse ping() throws SolrServerException, IOException { - return new SolrPing().process(this, null); - } - /** * Performs a query to the Solr server * diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/SolrPing.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/SolrPing.java deleted file mode 100644 index a08d9c89ec1f..000000000000 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/SolrPing.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.solr.client.solrj.request; - -import org.apache.solr.client.solrj.response.SolrPingResponse; -import org.apache.solr.common.params.CommonParams; -import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.solr.common.util.NamedList; - -/** - * Verify that there is a working Solr core at the URL of a {@link - * org.apache.solr.client.solrj.SolrClient}. To use this class, the solrconfig.xml for the relevant - * core must include the request handler for /admin/ping. - * - * @deprecated PingRequestHandler (the /admin/ping endpoint) is deprecated - * and will be removed in a future release. Use {@link HealthCheckRequest} instead. - * @since solr 1.3 - */ -@Deprecated(since = "10.1") -public class SolrPing extends CollectionRequiringSolrRequest { - - /** serialVersionUID. */ - private static final long serialVersionUID = 5828246236669090017L; - - /** Request parameters. */ - private final ModifiableSolrParams params; - - /** Create a new SolrPing object. */ - public SolrPing() { - super(METHOD.GET, CommonParams.PING_HANDLER, SolrRequestType.ADMIN); - params = new ModifiableSolrParams(); - } - - @Override - protected SolrPingResponse createResponse(NamedList namedList) { - return new SolrPingResponse(); - } - - @Override - public ModifiableSolrParams getParams() { - return params; - } - - /** - * Remove the action parameter from this request. This will result in the same behavior as {@code - * SolrPing#setActionPing()}. For Solr server version 4.0 and later. - * - * @return this - */ - public SolrPing removeAction() { - params.remove(CommonParams.ACTION); - return this; - } - - /** - * Set the action parameter on this request to enable. This will delete the health-check file for - * the Solr core. For Solr server version 4.0 and later. - * - * @return this - */ - public SolrPing setActionDisable() { - params.set(CommonParams.ACTION, CommonParams.DISABLE); - return this; - } - - /** - * Set the action parameter on this request to enable. This will create the health-check file for - * the Solr core. For Solr server version 4.0 and later. - * - * @return this - */ - public SolrPing setActionEnable() { - params.set(CommonParams.ACTION, CommonParams.ENABLE); - return this; - } - - /** - * Set the action parameter on this request to ping. This is the same as not including the action - * at all. For Solr server version 4.0 and later. - * - * @return this - */ - public SolrPing setActionPing() { - params.set(CommonParams.ACTION, CommonParams.PING); - return this; - } -} diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/SolrPingResponse.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/SolrPingResponse.java deleted file mode 100644 index 6c0d8940712b..000000000000 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/SolrPingResponse.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.solr.client.solrj.response; - -/** - * @deprecated This class is deprecated and will be removed in a future release. - * @since solr 1.3 - */ -@Deprecated(since = "10.1") -public class SolrPingResponse extends SolrResponseBase { - // nothing special now... -} diff --git a/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java b/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java index 31ad4a1e5d76..86d7db3c8f94 100644 --- a/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java +++ b/solr/solrj/src/java/org/apache/solr/common/params/CommonParams.java @@ -74,30 +74,9 @@ public interface CommonParams { String INDENT = "indent"; - // SOLR-4228 start - /** - * handler value for SolrPing - * - * @deprecated PingRequestHandler (the /admin/ping endpoint) is - * deprecated and will be removed in a future release. - */ - @Deprecated(since = "10.1") - String PING_HANDLER = "/admin/ping"; - - /** "action" parameter for SolrPing */ + /** "action" parameter name, used by several admin/collection-management APIs */ String ACTION = "action"; - /** "disable" value for SolrPing action */ - String DISABLE = "disable"; - - /** "enable" value for SolrPing action */ - String ENABLE = "enable"; - - /** "ping" value for SolrPing action */ - String PING = "ping"; - - // SOLR-4228 end - /** query and init param for field list */ String FL = "fl"; diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-sql.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-sql.xml index 5877db808885..cad80102cf44 100644 --- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-sql.xml +++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig-sql.xml @@ -53,14 +53,4 @@ - - - *:* - - - all - - server-enabled.txt - - diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml index bce00fec07ab..40b0b626b0ec 100644 --- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml +++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/solrconfig.xml @@ -41,14 +41,4 @@ - - - *:* - - - all - - server-enabled.txt - - diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java index a84449977d2e..ec6b322472c6 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java @@ -1154,15 +1154,6 @@ public void testStatistics() throws Exception { assertEquals("they have the same distribution", inStockF.getStddev(), inStockT.getStddev()); } - @Test - @SuppressWarnings("deprecation") // covers the deprecated ping() - public void testPingHandler() throws Exception { - SolrClient client = getSolrClient(); - - // should be ok - client.ping(); - } - @Test public void testFaceting() throws Exception { SolrClient client = getSolrClient(); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java index 1981c46332b3..f56051a7b7db 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java @@ -51,7 +51,6 @@ import org.apache.solr.client.solrj.request.V2Request; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.client.solrj.response.RequestStatusState; -import org.apache.solr.client.solrj.response.SolrPingResponse; import org.apache.solr.client.solrj.response.UpdateResponse; import org.apache.solr.cloud.AbstractFullDistribZkTestBase; import org.apache.solr.cloud.SolrCloudTestCase; @@ -1283,21 +1282,6 @@ private void queryWithPreferReplicaTypes( } } - @Test - @SuppressWarnings("deprecation") // covers the deprecated ping() - public void testPing() throws Exception { - final String testCollection = "ping_test"; - CollectionAdminRequest.createCollection(testCollection, "conf", 2, 1) - .process(cluster.getSolrClient()); - cluster.waitForActiveCollection(testCollection, 2, 2); - final SolrClient clientUnderTest = getRandomClient(); - - final SolrPingResponse response = clientUnderTest.ping(testCollection); - - assertEquals("This should be OK", 0, response.getStatus()); - } - - @SuppressWarnings("deprecation") // covers the deprecated ping() public void testPerReplicaStateCollection() throws Exception { String collection = getSaferTestName(); @@ -1313,7 +1297,7 @@ public void testPerReplicaStateCollection() throws Exception { .process(cluster.getSolrClient()); cluster.waitForActiveCollection(testCollection, 2, 4); final SolrClient clientUnderTest = getRandomClient(); - final SolrPingResponse response = clientUnderTest.ping(testCollection); + final QueryResponse response = clientUnderTest.query(testCollection, new SolrQuery("*:*")); assertEquals("This should be OK", 0, response.getStatus()); DocCollection c = cluster.getZkStateReader().getCollection(testCollection); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java index abfb6b2d123f..c18277bed2b0 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java @@ -51,7 +51,6 @@ import org.apache.solr.client.solrj.request.json.JsonQueryRequest; import org.apache.solr.client.solrj.response.JavaBinResponseParser; import org.apache.solr.client.solrj.response.ResponseParser; -import org.apache.solr.client.solrj.response.SolrPingResponse; import org.apache.solr.client.solrj.response.XMLResponseParser; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.MapSolrParams; @@ -614,16 +613,6 @@ public void testCookieHandlerSettingHonored() throws Exception { } } - @Test - @SuppressWarnings("deprecation") // covers the deprecated ping() - public void testPing() throws Exception { - try (HttpJdkSolrClient client = builder(solrTestRule.getBaseUrl()).build()) { - SolrPingResponse spr = client.ping("collection1"); - assertEquals(0, spr.getStatus()); - assertNull(spr.getException()); - } - } - @Test public void testMaybeTryHeadRequestHasContentType() throws Exception { DebugServlet.clear(); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java deleted file mode 100644 index a7757a3a2be5..000000000000 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.solr.client.solrj.request; - -import java.nio.file.Path; -import org.apache.solr.SolrTestCase; -import org.apache.solr.SolrTestCaseJ4; -import org.apache.solr.client.solrj.response.SolrPingResponse; -import org.apache.solr.common.SolrException; -import org.apache.solr.common.SolrInputDocument; -import org.apache.solr.util.EmbeddedSolrServerTestRule; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; - -/** Test SolrPing in Solrj */ -@SuppressWarnings("deprecation") // this suite exists to cover the deprecated SolrPing -public class SolrPingTest extends SolrTestCase { - - @ClassRule - public static final EmbeddedSolrServerTestRule solrTestRule = new EmbeddedSolrServerTestRule(); - - @BeforeClass - public static void beforeClass() throws Exception { - Path solrHome = SolrTestCaseJ4.getFile("solrj/solr"); - solrTestRule.startSolr(solrHome); - - SolrTestCaseJ4.newRandomConfig(); - solrTestRule.newCollection().withConfigSet(solrHome.resolve("collection1")).create(); - } - - @Before - @Override - public void setUp() throws Exception { - super.setUp(); - solrTestRule.clearIndex(); - - SolrInputDocument doc = new SolrInputDocument(); - doc.setField("id", 1); - doc.setField("terms_s", "samsung"); - solrTestRule.getSolrClient().add(doc); - solrTestRule.getSolrClient().commit(true, true); - } - - @Test - public void testEnabledSolrPing() throws Exception { - SolrPing ping = new SolrPing(); - SolrPingResponse rsp = null; - ping.setActionEnable(); - ping.process(solrTestRule.getSolrClient()); - ping.removeAction(); - rsp = ping.process(solrTestRule.getSolrClient()); - assertNotNull(rsp); - } - - @Test(expected = SolrException.class) - public void testDisabledSolrPing() throws Exception { - SolrPing ping = new SolrPing(); - SolrPingResponse rsp = null; - ping.setActionDisable(); - try { - ping.process(solrTestRule.getSolrClient()); - } catch (Exception e) { - throw new Exception("disable action failed!"); - } - ping.setActionPing(); - rsp = ping.process(solrTestRule.getSolrClient()); - // the above line should fail with a 503 SolrException. - assertNotNull(rsp); - } -} diff --git a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java index f3ccd7f2b1ee..51ef301b2e22 100644 --- a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java +++ b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java @@ -27,9 +27,10 @@ import org.apache.lucene.tests.util.LuceneTestCase.Nightly; import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.request.CollectionAdminRequest; +import org.apache.solr.client.solrj.request.SolrQuery; import org.apache.solr.client.solrj.request.V2Request; import org.apache.solr.client.solrj.response.CollectionAdminResponse; -import org.apache.solr.client.solrj.response.SolrPingResponse; +import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.cloud.MiniSolrCloudCluster; import org.apache.solr.cloud.SolrCloudTestCase; import org.apache.solr.common.NavigableObject; @@ -56,7 +57,6 @@ public class PerReplicaStatesIntegrationTest extends SolrCloudTestCase { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - @SuppressWarnings("deprecation") // covers the deprecated ping() public void testPerReplicaStateCollection() throws Exception { String testCollection = "perReplicaState_test"; @@ -79,7 +79,7 @@ public void testPerReplicaStateCollection() throws Exception { .process(cluster.getSolrClient()); cluster.waitForActiveCollection(testCollection, 2, 4); final SolrClient clientUnderTest = cluster.getSolrClient(); - final SolrPingResponse response = clientUnderTest.ping(testCollection); + final QueryResponse response = clientUnderTest.query(testCollection, new SolrQuery("*:*")); assertEquals("This should be OK", 0, response.getStatus()); DocCollection c = cluster.getZkStateReader().getCollection(testCollection); c.forEachReplica((s, replica) -> assertNotNull(replica.getReplicaState())); diff --git a/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCollectionScreensTest.java b/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCollectionScreensTest.java index b4e82fb54578..274288f5879f 100644 --- a/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCollectionScreensTest.java +++ b/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCollectionScreensTest.java @@ -101,7 +101,6 @@ public void testCoreOverviewShowsStats() { openPage(coreName + "/core-overview", By.id("dashboard")); waitForPageContains("Num Docs"); waitForPageContains(Integer.toString(NUM_DOCS)); - waitForPageContains("Ping request handler is not configured with a healthcheck file."); assertNoSevereConsoleErrors(); } } diff --git a/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCoreAdminStandaloneTest.java b/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCoreAdminStandaloneTest.java index ac59fea2b167..3ed57bdfe42a 100644 --- a/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCoreAdminStandaloneTest.java +++ b/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCoreAdminStandaloneTest.java @@ -66,7 +66,6 @@ public void testStandaloneMenus() { openPage("swapa/core-overview", By.id("dashboard")); waitFor(By.cssSelector("#core-menu .query")); waitFor(By.cssSelector("#core-menu .replication")); - waitForPageContains("Ping request handler is not configured with a healthcheck file."); assertNoSevereConsoleErrors(); } diff --git a/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCoreOverviewReplicationErrorsTest.java b/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCoreOverviewReplicationErrorsTest.java index fe2c4a1a0c9d..88ef11647a61 100644 --- a/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCoreOverviewReplicationErrorsTest.java +++ b/solr/webapp/src/test/org/apache/solr/webapp/AdminUiCoreOverviewReplicationErrorsTest.java @@ -78,7 +78,7 @@ public void testGenericReplicationFailureShowsInlineMessage() { public void testReplicationForbiddenDoesNotShowConfigurationMessage() throws Exception { // Not asserting #authz-failures itself: app.js's httpInterceptor clears // $rootScope.showAuthzFailures on every successful v1 call, and core-overview fires several - // of those (Luke, CoreInfo, Ping) alongside this one, so the banner isn't reliably still up + // of those (Luke, CoreInfo) alongside this one, so the banner isn't reliably still up // by the time we'd check it. This test only guards the message text below. forcedReplicationStatus = HttpServletResponse.SC_FORBIDDEN; openPage(CORE + "/core-overview", By.id("dashboard")); diff --git a/solr/webapp/web/css/angular/dashboard.css b/solr/webapp/web/css/angular/dashboard.css index 1ffe0b6c0a17..a3e247c5ae5d 100644 --- a/solr/webapp/web/css/angular/dashboard.css +++ b/solr/webapp/web/css/angular/dashboard.css @@ -123,24 +123,6 @@ limitations under the License. margin-top: 10px; } -#content #dashboard #healthcheck -{ - float: right; -} - -#content #dashboard #healthcheck .ico -{ - background-image: url( ../../img/ico/slash.png ); - height: 20px; - padding-left: 20px; - width: 60%; -} - -#content #dashboard #healthcheck .ico.ico-1 -{ - background-image: url( ../../img/ico/tick.png ); -} - #content #dashboard #system h2 { background-image: url( ../../img/ico/server.png ); } #content #dashboard #statistics h2 { background-image: url( ../../img/ico/chart.png ); } #content #dashboard #replication h2 { background-image: url( ../../img/ico/node.png ); } diff --git a/solr/webapp/web/css/angular/menu.css b/solr/webapp/web/css/angular/menu.css index 0e00222f08f6..fa893b6f8e42 100644 --- a/solr/webapp/web/css/angular/menu.css +++ b/solr/webapp/web/css/angular/menu.css @@ -281,11 +281,6 @@ limitations under the License. background-image: url( ../../img/ico/status.png ); } -#menu .ping small -{ - color: #000 -} - #menu li { border-bottom: 1px solid #f0f0f0; @@ -394,15 +389,6 @@ limitations under the License. #menu #security.global p a, #menu #security-standalone.global p a { background-image: url( ../../img/ico/users.png ); } -.sub-menu .ping.error a -{ - - background-color: #ffcccc; - background-image: url( ../../img/ico/system-monitor--exclamation.png ); - border-color: #ffcccc; - cursor: help; -} - .sub-menu .overview a { background-image: url( ../../img/ico/home.png ); } .sub-menu .query a { background-image: url( ../../img/ico/magnifier.png ); } .sub-menu .sqlquery a { background-image: url( ../../img/ico/sql.png ); } @@ -414,7 +400,6 @@ limitations under the License. .sub-menu .schema a { background-image: url( ../../img/ico/book-open-text.png ); } .sub-menu .replication a { background-image: url( ../../img/ico/node.png ); } .sub-menu .distribution a { background-image: url( ../../img/ico/node-select.png ); } -.sub-menu .ping a { background-image: url( ../../img/ico/system-monitor.png ); } .sub-menu .logging a { background-image: url( ../../img/ico/inbox-document-text.png ); } .sub-menu .plugins a { background-image: url( ../../img/ico/block.png ); } .sub-menu .segments a { background-image: url( ../../img/ico/construction.png ); } diff --git a/solr/webapp/web/index.html b/solr/webapp/web/index.html index c4bf32a659c0..ad3986822265 100644 --- a/solr/webapp/web/index.html +++ b/solr/webapp/web/index.html @@ -280,7 +280,6 @@

Select a node

  • Documents
  • Paramsets
  • Files
  • -
  • Ping ({{pingMS}}ms)
  • Plugins / Stats
  • Query
  • Replication
  • diff --git a/solr/webapp/web/js/angular/app.js b/solr/webapp/web/js/angular/app.js index aabe50a0c8ee..9dfa6086d3d8 100644 --- a/solr/webapp/web/js/angular/app.js +++ b/solr/webapp/web/js/angular/app.js @@ -513,7 +513,7 @@ solrAdminApp.config([ }; }); -solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $location, $timeout, CoresV2, CollectionsV2, AliasesV2, SystemV2, ClusterV2, Ping, Constants, SchemaDesigner, ApiErrorHandler, NodeTarget) { +solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $location, $timeout, CoresV2, CollectionsV2, AliasesV2, SystemV2, ClusterV2, Constants, SchemaDesigner, ApiErrorHandler, NodeTarget) { $rootScope.exceptions={}; var cloudLandingDone = false; @@ -793,14 +793,6 @@ solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $ return selectedColl && selectedColl.type === 'alias' && selectedColl.collections.includes(','); }; - $scope.ping = function() { - Ping.ping({core: $scope.currentCore.name}, function(data) { - $scope.showPing = true; - $scope.pingMS = data.responseHeader.QTime; - }); - // @todo .attr( 'title', '/admin/ping is not configured (' + xhr.status + ': ' + error_thrown + ')' ); - }; - $scope.dumpCloud = function() { $scope.$broadcast("cloud-dump"); } diff --git a/solr/webapp/web/js/angular/controllers/core-overview.js b/solr/webapp/web/js/angular/controllers/core-overview.js index d71eeed49a80..189cfde8e805 100644 --- a/solr/webapp/web/js/angular/controllers/core-overview.js +++ b/solr/webapp/web/js/angular/controllers/core-overview.js @@ -23,7 +23,7 @@ var isTruthy = function(value) { }; solrAdminApp.controller('CoreOverviewController', -function($scope, $rootScope, $routeParams, $timeout, Luke, CoreInfo, Update, ReplicationV2, Ping, Constants, ApiErrorHandler) { +function($scope, $rootScope, $routeParams, $timeout, Luke, CoreInfo, Update, ReplicationV2, Constants, ApiErrorHandler) { $scope.resetMenu("overview", Constants.IS_CORE_PAGE); $scope.refreshIndex = function() { Luke.index({core: $routeParams.core}, @@ -70,49 +70,10 @@ function($scope, $rootScope, $routeParams, $timeout, Luke, CoreInfo, Update, Rep ); }; - $scope.refreshPing = function() { - Ping.status({core: $routeParams.core}, function(data) { - // Three states, and they are not interchangeable. "enabled" and "disabled" both mean a - // healthcheck file is configured, so toggleHealthcheck() works and the widget shows the - // lit / unlit control. "not_configured" means there is no healthcheck file at all, and - // enable/disable would answer 503 - so set a message, which hides the toggle rather than - // offering a control that cannot work. - delete $scope.healthcheckMessage; - if (data.status == "enabled" || data.status == "disabled") { - $scope.healthcheckStatus = data.status == "enabled"; - } else { - $scope.healthcheckStatus = false; - $scope.healthcheckMessage = data.status == "not_configured" - ? 'Ping request handler is not configured with a healthcheck file.' - : 'Unexpected ping status: ' + data.status; - } - }, function(error) { - $scope.healthcheckStatus = false; - $scope.healthcheckMessage = error.data && error.data.error ? error.data.error.msg : 'Unable to read ping status.'; - }); - }; - - $scope.toggleHealthcheck = function() { - if ($scope.healthcheckStatus) { - Ping.disable( - {core: $routeParams.core}, - function(data) {$scope.healthcheckStatus = false}, - function(error) {$scope.healthcheckMessage = error} - ); - } else { - Ping.enable( - {core: $routeParams.core}, - function(data) {$scope.healthcheckStatus = true}, - function(error) {$scope.healthcheckMessage = error} - ); - } - }; - $scope.refresh = function() { $scope.refreshIndex(); $scope.refreshReplication(); $scope.refreshInfo(); - $scope.refreshPing(); }; $scope.refresh(); diff --git a/solr/webapp/web/js/angular/services.js b/solr/webapp/web/js/angular/services.js index 3fde3fd1dba9..f31964eaed61 100644 --- a/solr/webapp/web/js/angular/services.js +++ b/solr/webapp/web/js/angular/services.js @@ -487,15 +487,6 @@ solrAdminServices.factory('Metrics', "field": {params: {"analysis.showmatch": true}} }); }]) -.factory('Ping', - ['$resource', function($resource) { - return $resource(':core/admin/ping', {wt:'json', core: '@core', ts:Date.now(), _:Date.now()}, { - "ping": {}, - "enable": {params:{action:"enable"}, headers: {doNotIntercept: "true"}}, - "disable": {params:{action:"disable"}, headers: {doNotIntercept: "true"}}, - "status": {params:{action:"status"}, headers: {doNotIntercept: "true"} - }}); - }]) .factory('Files', ['$resource', function($resource) { return $resource(':core/admin/file', {'wt':'json', core: '@core', '_':Date.now()}, { diff --git a/solr/webapp/web/partials/core_overview.html b/solr/webapp/web/partials/core_overview.html index a17b5aa0caba..11349b375e6e 100644 --- a/solr/webapp/web/partials/core_overview.html +++ b/solr/webapp/web/partials/core_overview.html @@ -174,28 +174,6 @@

    -
    - -

    Healthcheck

    - -
    -
    {{healthcheckMessage}}
    -
    - -
    -
    - -
    Status:
    -
    - -
    -
    - -
    -
    -
    - -