From e9cb1e221367c7c96f9fa3384887088a37a8beed Mon Sep 17 00:00:00 2001 From: Jason Gerlowski Date: Thu, 3 Sep 2026 19:41:57 -0400 Subject: [PATCH 1/2] SOLR-18417: Deprecate v1 PingRequestHandler PingRequestHandler has largely been superseded by HealthcheckHandler (or even SystemInfoHandler) which do healthchecks at the node-level instead and tend to be much more compatible with typical load balancers. This commit deprecates PingRequestHandler and the corresponding SolrPing class in SolrJ. Removal will occur in a subsequent ('main'-only) commit. --- .../SOLR-18417-deprecate-pingrequesthandler.yml | 7 +++++++ .../java/org/apache/solr/handler/PingRequestHandler.java | 4 ++++ .../pages/implicit-requesthandlers.adoc | 2 ++ .../modules/deployment-guide/pages/ping.adoc | 6 ++++++ .../org/apache/solr/client/solrj/request/SolrPing.java | 3 +++ .../java/org/apache/solr/common/params/CommonParams.java | 8 +++++++- 6 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/SOLR-18417-deprecate-pingrequesthandler.yml diff --git a/changelog/unreleased/SOLR-18417-deprecate-pingrequesthandler.yml b/changelog/unreleased/SOLR-18417-deprecate-pingrequesthandler.yml new file mode 100644 index 000000000000..2ca9e87965b3 --- /dev/null +++ b/changelog/unreleased/SOLR-18417-deprecate-pingrequesthandler.yml @@ -0,0 +1,7 @@ +type: deprecated +title: Deprecate PingRequestHandler (the "/admin/ping" endpoint) in favor of `/api/node/health` (v2) or `/solr/admin/info/health` (v1). +authors: + - name: Jason Gerlowski +links: + - name: SOLR-18417 + url: https://issues.apache.org/jira/browse/SOLR-18417 diff --git a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java index f7eaa97db78b..ee49eed153d7 100644 --- a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java @@ -105,8 +105,12 @@ * healthcheck file exists ("enabled") or not ("disabled") * * + * @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()); 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 005742a7cec8..6adff4771b7e 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 @@ -83,6 +83,8 @@ This handler must have a collection name in the path to the endpoint. Ping:: Health check. 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 below instead. ++ *Documentation*: xref:deployment-guide:ping.adoc[] + [cols="3*.",frame=none,grid=cols,options="header"] diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/ping.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/ping.adoc index 169fb97e9ab7..558dddac2928 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/ping.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/ping.adoc @@ -16,6 +16,12 @@ // 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 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 index 2b9f9824802e..a08d9c89ec1f 100644 --- 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 @@ -26,8 +26,11 @@ * 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. */ 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 3bed47aac571..31ad4a1e5d76 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 @@ -75,7 +75,13 @@ public interface CommonParams { String INDENT = "indent"; // SOLR-4228 start - /** handler value for SolrPing */ + /** + * 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 */ From cbaa4bb5f9ab23d0ef196e200cdfe4f662ca222f Mon Sep 17 00:00:00 2001 From: Jason Gerlowski Date: Thu, 3 Sep 2026 20:20:38 -0400 Subject: [PATCH 2/2] Remove PingRequestHandler-related methods and classes --- .../unreleased/SOLR-18417-deprecate-pingrequesthandler.yml | 2 +- .../src/java/org/apache/solr/client/solrj/SolrClient.java | 4 ++++ .../apache/solr/client/solrj/response/SolrPingResponse.java | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog/unreleased/SOLR-18417-deprecate-pingrequesthandler.yml b/changelog/unreleased/SOLR-18417-deprecate-pingrequesthandler.yml index 2ca9e87965b3..fb82ab8f6d1f 100644 --- a/changelog/unreleased/SOLR-18417-deprecate-pingrequesthandler.yml +++ b/changelog/unreleased/SOLR-18417-deprecate-pingrequesthandler.yml @@ -1,5 +1,5 @@ type: deprecated -title: Deprecate PingRequestHandler (the "/admin/ping" endpoint) in favor of `/api/node/health` (v2) or `/solr/admin/info/health` (v1). +title: Deprecate PingRequestHandler (the "/admin/ping" endpoint), SolrPing, SolrPingResponse, and SolrClient.ping()/ping(String). authors: - name: Jason Gerlowski links: 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 5d54d12155a1..fbc5ef6df2b6 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 @@ -895,7 +895,9 @@ public UpdateResponse deleteByQuery(String query, int commitWithinMs) * 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); } @@ -907,7 +909,9 @@ public SolrPingResponse ping(String collection) throws SolrServerException, IOEx * 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); } 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 index da124f135943..6c0d8940712b 100644 --- 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 @@ -17,8 +17,10 @@ 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... }