Apache Solr open-source search software
SOLR-17044: Remove 'solr.v2RealPath' sysprop (#2723)
Jason Gerlowski36c4a3f4eaf3
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.javaindex 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.javaindex 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.javaindex 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");