This is an automated email from the ASF dual-hosted git repository.
gerlowskija pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 36c4a3f4eaf SOLR-17044: Remove 'solr.v2RealPath' sysprop (#2723)
36c4a3f4eaf is described below
commit 36c4a3f4eaf3dea7946396466173dc44576a7b91
Author: Jason Gerlowski <[email protected]>
AuthorDate: Fri Oct 4 11:44:04 2024 -0700
SOLR-17044: Remove 'solr.v2RealPath' sysprop (#2723)
System property was used to control how SolrJ built v2 API paths,
seemingly as a workaround to allow certain tests to work which didn't at
the time use a full Jetty stack. (Jetty is used to rewrite the v2 API
root "/api" to "/solr/____v2")
This workaround has long since been unnecessary, and this commit
removes support for it from various places in our codebase.
---
.../org/apache/solr/client/solrj/util/ClientUtils.java | 7 +------
.../apache/solr/client/solrj/util/ClientUtilsTest.java | 17 -----------------
.../src/java/org/apache/solr/SolrTestCaseJ4.java | 2 --
3 files changed, 1 insertion(+), 25 deletions(-)
diff --git
a/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java
b/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java
index 6f0ff47ee47..f662ce188ac 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java
@@ -33,7 +33,6 @@ import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.SolrResponse;
import org.apache.solr.client.solrj.request.RequestWriter;
-import org.apache.solr.client.solrj.request.V2Request;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.SolrInputField;
import org.apache.solr.common.cloud.Slice;
@@ -85,11 +84,7 @@ public class ClientUtils {
String basePath = solrRequest.getBasePath() == null ? serverRootUrl :
solrRequest.getBasePath();
if (solrRequest.getApiVersion() == SolrRequest.ApiVersion.V2) {
- if (solrRequest instanceof V2Request &&
System.getProperty("solr.v2RealPath") != null) {
- basePath = serverRootUrl + "/____v2";
- } else {
- basePath = addNormalV2ApiRoot(basePath);
- }
+ basePath = addNormalV2ApiRoot(basePath);
}
if (solrRequest.requiresCollection() && collection != null) basePath +=
"/" + collection;
diff --git
a/solr/solrj/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java
index 407fffa2454..3322b10fbdc 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/util/ClientUtilsTest.java
@@ -22,7 +22,6 @@ import
org.apache.solr.client.solrj.request.HealthCheckRequest;
import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.client.solrj.request.RequestWriter;
import org.apache.solr.client.solrj.request.UpdateRequest;
-import org.apache.solr.client.solrj.request.V2Request;
import org.junit.Test;
/**
@@ -80,22 +79,6 @@ public class ClientUtilsTest extends SolrTestCase {
assertEquals("http://alternate-url:7574/solr/admin/info/health", url);
}
- // V2 path is correct when solr.v2RealPath sysprop set
- {
- System.setProperty("solr.v2RealPath", "true");
- final var request = new V2Request.Builder("/collections").build();
- final var url = ClientUtils.buildRequestUrl(request, rw,
"http://localhost:8983/solr", null);
- assertEquals("http://localhost:8983/solr/____v2/collections", url);
- }
-
- // V2 path is correct when solr.v2RealPath sysprop NOT set
- {
- System.clearProperty("solr.v2RealPath");
- final var request = new V2Request.Builder("/collections").build();
- final var url = ClientUtils.buildRequestUrl(request, rw,
"http://localhost:8983/solr", null);
- assertEquals("http://localhost:8983/api/collections", url);
- }
-
// Ignores collection when not needed (i.e. obeys
SolrRequest.requiresCollection)
{
final var request = new HealthCheckRequest();
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index 1bdfc36ace4..035fbcdef7f 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -284,7 +284,6 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
System.setProperty("solr.retries.on.forward", "1");
System.setProperty("solr.retries.to.followers", "1");
- System.setProperty("solr.v2RealPath", "true");
System.setProperty("zookeeper.forceSync", "no");
System.setProperty("jetty.testMode", "true");
System.setProperty("solr.zookeeper.connectionStrategy",
TestConnectionStrategy.class.getName());
@@ -335,7 +334,6 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
} finally {
TestInjection.reset();
initCoreDataDir = null;
- System.clearProperty("solr.v2RealPath");
System.clearProperty("zookeeper.forceSync");
System.clearProperty("jetty.testMode");
System.clearProperty("tests.shardhandler.randomSeed");