Apache Solr open-source search software
SOLR-17742: remove handleSelect requestDispatcher option (#3409)
wildtuskerb9d140f4b313
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 73dd813599c..6e88eedd506 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -145,6 +145,8 @@ Deprecation Removals* SOLR-17851: Removed BlobHandler and .system collection support (Eric Pugh)+* SOLR-17742: Removed the handleSelect option of <requestDispatcher>. (Gaurav Tuli, David Smiley)+Dependency Upgrades---------------------diff --git a/solr/core/src/java/org/apache/solr/core/SolrConfig.java b/solr/core/src/java/org/apache/solr/core/SolrConfig.javaindex 757503c4788..c9482838d4a 100644--- a/solr/core/src/java/org/apache/solr/core/SolrConfig.java+++ b/solr/core/src/java/org/apache/solr/core/SolrConfig.java@@ -127,8 +127,6 @@ public class SolrConfig implements MapSerializable {private int formUploadLimitKB;- private boolean handleSelect;-private final SolrRequestParsers solrRequestParsers;/**@@ -362,8 +360,6 @@ public class SolrConfig implements MapSerializable {log.warn("Ignored deprecated enableStreamBody in config; use sys-prop");}- handleSelect = get("requestDispatcher").boolAttr("handleSelect", false);-List<PluginInfo> argsInfos = getPluginInfos(InitParams.class.getName());if (argsInfos != null) {Map<String, InitParams> argsMap = new HashMap<>();@@ -958,10 +954,6 @@ public class SolrConfig implements MapSerializable {return formUploadLimitKB;}- public boolean isHandleSelect() {- return handleSelect;- }-@Overridepublic Map<String, Object> toMap(Map<String, Object> result) {if (znodeVersion > -1) result.put(ZNODEVER, znodeVersion);@@ -1009,7 +1001,6 @@ public class SolrConfig implements MapSerializable {m, filterCacheConfig, queryResultCacheConfig, documentCacheConfig, fieldValueCacheConfig);m = new LinkedHashMap<>();result.put("requestDispatcher", m);- m.put("handleSelect", handleSelect);if (httpCachingConfig != null) m.put("httpCaching", httpCachingConfig);m.put("requestParsers",diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.javaindex 7be425273a6..8107e36a4cd 100644--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java@@ -99,7 +99,6 @@ import org.apache.solr.common.util.ValidatingJsonMap;import org.apache.solr.core.CoreContainer;import org.apache.solr.core.SolrConfig;import org.apache.solr.core.SolrCore;-import org.apache.solr.handler.ContentStreamHandlerBase;import org.apache.solr.request.SolrQueryRequest;import org.apache.solr.request.SolrQueryRequestBase;import org.apache.solr.request.SolrRequestHandler;@@ -401,26 +400,6 @@ public class HttpSolrCall {protected void extractHandlerFromURLPath(SolrRequestParsers parser) throws Exception {if (handler == null && path.length() > 1) { // don't match "" or "/" as valid pathhandler = core.getRequestHandler(path);- // no handler yet but <requestDispatcher> allows us to handle /select with a 'qt' param- if (handler == null && parser.isHandleSelect()) {- if ("/select".equals(path) || "/select/".equals(path)) {- solrReq = parser.parse(core, path, req);- String qt = solrReq.getParams().get(CommonParams.QT);- handler = core.getRequestHandler(qt);- if (handler == null) {- throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "unknown handler: " + qt);- }- if (qt != null && qt.startsWith("/") && (handler instanceof ContentStreamHandlerBase)) {- // For security reasons it's a bad idea to allow a leading '/', ex: /select?qt=/update- // see SOLR-3161- // There was no restriction from Solr 1.4 thru 3.5 and it's not supported for update- // handlers.- throw new SolrException(- SolrException.ErrorCode.BAD_REQUEST,- "Invalid Request Handler ('qt'). Do not use /select to access: " + qt);- }- }- }}}diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.javaindex 65c5f370cd5..aeccc342059 100644--- a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java+++ b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java@@ -87,7 +87,6 @@ public class SolrRequestParsers {private final boolean enableRemoteStreams;private final boolean enableStreamBody;private StandardRequestParser standard;- private boolean handleSelect = true;/*** Default instance for e.g. admin requests. Limits to 2 MB uploads and does not allow remote@@ -104,7 +103,7 @@ public class SolrRequestParsers {multipartUploadLimitKB = formUploadLimitKB = Integer.MAX_VALUE;enableRemoteStreams = false;enableStreamBody = false;- handleSelect = false;+} else {multipartUploadLimitKB = globalConfig.getMultipartUploadLimitKB();@@ -115,7 +114,7 @@ public class SolrRequestParsers {enableStreamBody = Boolean.getBoolean("solr.enableStreamBody");// Let this filter take care of /select?xxx format- handleSelect = globalConfig.isHandleSelect();+}init(multipartUploadLimitKB, formUploadLimitKB);}@@ -123,7 +122,7 @@ public class SolrRequestParsers {private SolrRequestParsers() {enableRemoteStreams = false;enableStreamBody = false;- handleSelect = false;+init(Integer.MAX_VALUE, Integer.MAX_VALUE);}@@ -516,14 +515,6 @@ public class SolrRequestParsers {"URLDecoder: Invalid digit (" + ((char) b) + ") in escape (%) pattern");}- public boolean isHandleSelect() {- return handleSelect;- }-- public void setHandleSelect(boolean handleSelect) {- this.handleSelect = handleSelect;- }-public boolean isEnableRemoteStreams() {return enableRemoteStreams;}diff --git a/solr/core/src/resources/EditableSolrConfigAttributes.json b/solr/core/src/resources/EditableSolrConfigAttributes.jsonindex 0d65f2e3853..f72269e6283 100644--- a/solr/core/src/resources/EditableSolrConfigAttributes.json+++ b/solr/core/src/resources/EditableSolrConfigAttributes.json@@ -56,8 +56,8 @@"boolTofilterOptimizer":1,"maxBooleanClauses":1},"requestDispatcher":{- "handleSelect":0,- "requestParsers":{+ "requestParsers":{"multipartUploadLimitInKB":0,- "formdataUploadLimitInKB":0}}+ "formdataUploadLimitInKB":0}+ }}diff --git a/solr/core/src/test/org/apache/solr/core/TestConfigOverlay.java b/solr/core/src/test/org/apache/solr/core/TestConfigOverlay.javaindex c9da5383fd9..c12b6916e44 100644--- a/solr/core/src/test/org/apache/solr/core/TestConfigOverlay.java+++ b/solr/core/src/test/org/apache/solr/core/TestConfigOverlay.java@@ -49,8 +49,6 @@ public class TestConfigOverlay extends SolrTestCase {assertTrue(isEditableProp("requestDispatcher.requestParsers.formdataUploadLimitInKB", false, null));- assertTrue(isEditableProp("requestDispatcher.handleSelect", false, null));-assertTrue(isEditableProp("query.filterCache.initialSize", false, null));assertFalse(isEditableProp("query.filterCache", false, null));assertTrue(isEditableProp("query/filterCache/@initialSize", true, null));diff --git a/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java b/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.javaindex c1350ae970b..df7feaa7b2c 100644--- a/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java+++ b/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java@@ -46,7 +46,6 @@ public class TestRemoteStreaming extends SolrJettyTestBase {public static void beforeTest() throws Exception {System.setProperty("solr.enableRemoteStreaming", "true");System.setProperty("solr.enableStreamBody", "true");- // this one has handleSelect=true which a test here needsPath solrHomeDirectory = createTempDir(LuceneTestCase.getTestClass().getSimpleName());setupJettyTestHome(solrHomeDirectory, "collection1");createAndStartJetty(solrHomeDirectory.toAbsolutePath());diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adocindex 6bf03f30d47..57799adab95 100644--- a/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/config-api.adoc@@ -219,7 +219,6 @@ See xref:deployment-guide:circuit-breakers.adoc[] for more detailsSee xref:requestdispatcher.adoc[] for defaults and acceptable values for these settings.-* `requestDispatcher.handleSelect`* `requestDispatcher.requestParsers.multipartUploadLimitInKB`* `requestDispatcher.requestParsers.formdataUploadLimitInKB`diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/requestdispatcher.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/requestdispatcher.adocindex 70cdc8fad97..110a58d61e6 100644--- a/solr/solr-ref-guide/modules/configuration-guide/pages/requestdispatcher.adoc+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/requestdispatcher.adoc@@ -20,28 +20,6 @@ The `requestDispatcher` element of `solrconfig.xml` controls the way the Solr HTIncluded are parameters for defining if it should handle `/select` urls (for Solr 1.1 compatibility), if it will support remote streaming, the maximum size of file uploads and how it will respond to HTTP cache headers in requests.-== handleSelect Element--[IMPORTANT]-====-`handleSelect` is for legacy back-compatibility; those new to Solr do not need to change anything about the way this is configured by default.-====--The first configurable item is the `handleSelect` attribute on the `<requestDispatcher>` element itself.-This attribute can be set to one of two values, either "true" or "false".-It governs how Solr responds to requests such as `/select?qt=XXX`.-The default value "false" will ignore requests to `/select` if a request handler is not explicitly registered with the name `/select`.-A value of "true" will route query requests to the parser defined with the `qt` value if a request handler is not explicitly registered with the name `/select`.--In recent versions of Solr, a `/select` request handler is defined by default, so a value of "false" will work fine.-See the section xref:requesthandlers-searchcomponents.adoc[] for more information.--[source,xml]------<requestDispatcher handleSelect="true" >- ...-</requestDispatcher>-----== requestParsers Element