From f8976bf24f7110ac0631c2c2efdb53aed35b4582 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 04:53:36 +0530 Subject: [PATCH 01/18] cl --- .../unreleased/SOLR-16396-config-get-components.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 changelog/unreleased/SOLR-16396-config-get-components.yml diff --git a/changelog/unreleased/SOLR-16396-config-get-components.yml b/changelog/unreleased/SOLR-16396-config-get-components.yml new file mode 100644 index 000000000000..9ebbccb0c004 --- /dev/null +++ b/changelog/unreleased/SOLR-16396-config-get-components.yml @@ -0,0 +1,9 @@ +title: + Migration of Get Config V2 API supporting components to JAX-RS construct +type: changed +authors: + - name: Jalaz Kumar + nick: jaykay12 +links: + - name: SOLR-16396 + url: https://issues.apache.org/jira/browse/SOLR-16396 From 9921bb6f38c14314fc78404969e0c7ba92e32544 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 12:18:07 +0530 Subject: [PATCH 02/18] changes --- .../SOLR-16396-config-get-components.yml | 3 +- .../solr/client/api/endpoint/ConfigApi.java | 11 +++++ .../solr/handler/SolrConfigHandler.java | 3 ++ .../solr/handler/admin/api/GetConfig.java | 40 ++++++++++++++++--- .../solr/handler/admin/api/GetConfigAPI.java | 3 +- .../solr/handler/admin/api/GetConfigTest.java | 8 ++++ 6 files changed, 60 insertions(+), 8 deletions(-) diff --git a/changelog/unreleased/SOLR-16396-config-get-components.yml b/changelog/unreleased/SOLR-16396-config-get-components.yml index 9ebbccb0c004..9e20ae26c06e 100644 --- a/changelog/unreleased/SOLR-16396-config-get-components.yml +++ b/changelog/unreleased/SOLR-16396-config-get-components.yml @@ -1,5 +1,6 @@ title: - Migration of Get Config V2 API supporting components to JAX-RS construct + Migration of Get Config sections query, updateHandler, directoryFactory, indexConfig, and + codecFactory to JAX-RS. type: changed authors: - name: Jalaz Kumar diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java index 3e0ab463af22..c44ef5426019 100644 --- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java +++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java @@ -23,6 +23,7 @@ import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; import jakarta.ws.rs.QueryParam; import org.apache.solr.client.api.model.ConfigInfoResponse; import org.apache.solr.client.api.util.StoreApiParameters; @@ -42,5 +43,15 @@ ConfigInfoResponse getConfig( @DefaultValue("false") @Parameter(description = "Expand request handler useParams and effective parameters") boolean expandParams); + + @GET + @Path("{component:query|updateHandler|directoryFactory|indexConfig|codecFactory") + @StoreApiParameters + @Operation( + summary = "Fetch a config section", + tags = {"config"}) + ConfigInfoResponse getConfigComponent( + @PathParam("component") @Parameter(description = "Name of the config component") + String component); } } diff --git a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java index d943272657f7..537980c51a89 100644 --- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java @@ -279,6 +279,9 @@ private void handleGET() { } } + } else if (GetConfig.MIGRATED_CONFIG_COMPONENTS.contains(parts.get(1))) { + V2ApiUtils.squashIntoSolrResponseWithoutHeader( + resp, new GetConfig(req).getConfigComponent(parts.get(1))); } else { Map m = getConfigDetails(parts.get(1), req); Map val = new LinkedHashMap<>(); diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java index d46738ea347d..3cf984b3dd73 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java @@ -27,9 +27,11 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import org.apache.solr.api.JerseyResource; import org.apache.solr.client.api.endpoint.ConfigApi; import org.apache.solr.client.api.model.ConfigInfoResponse; +import org.apache.solr.common.SolrException; import org.apache.solr.common.params.MapSolrParams; import org.apache.solr.common.params.SolrParams; import org.apache.solr.common.util.NamedList; @@ -45,6 +47,9 @@ public class GetConfig extends JerseyResource implements ConfigApi.Get { + public static final Set MIGRATED_CONFIG_COMPONENTS = + Set.of("query", "updateHandler", "directoryFactory", "indexConfig", "codecFactory"); + private final SolrQueryRequest solrQueryRequest; @Inject @@ -60,15 +65,40 @@ public ConfigInfoResponse getConfig(boolean expandParams) { return response; } + @Override + @PermissionName(CONFIG_READ_PERM) + public ConfigInfoResponse getConfigComponent(String componentName) { + if (!MIGRATED_CONFIG_COMPONENTS.contains(componentName)) { + throw new SolrException( + SolrException.ErrorCode.BAD_REQUEST, "Invalid component name: " + componentName); + } + final var response = instantiateJerseyResponse(ConfigInfoResponse.class); + Map section = new LinkedHashMap<>(); + section.put(componentName, solrConfigAsMap().get(componentName)); + response.config = jsonSafeCopy(section); + return response; + } + + private Map solrConfigAsMap() { + return Utils.convertToMap(solrQueryRequest.getCore().getSolrConfig(), new LinkedHashMap<>()); + } + + @SuppressWarnings("unchecked") + private NullKeyTolerantMap jsonSafeCopy(Map map) { + final var jsonSafeCopy = new NullKeyTolerantMap("children"); + jsonSafeCopy.putAll((Map) Utils.getDeepCopy(map, 20, true)); + return jsonSafeCopy; + } + @SuppressWarnings({"unchecked"}) private Map buildConfigMap( SolrQueryRequest solrQueryRequest, boolean expandParams) { - Map map = - Utils.convertToMap(solrQueryRequest.getCore().getSolrConfig(), new LinkedHashMap<>()); + + Map configMap = solrConfigAsMap(); Map reqHandlers = (Map) - map.computeIfAbsent(SolrRequestHandler.TYPE, k -> new LinkedHashMap<>()); + configMap.computeIfAbsent(SolrRequestHandler.TYPE, k -> new LinkedHashMap<>()); List plugins = solrQueryRequest.getCore().getImplicitHandlers(); for (PluginInfo plugin : plugins) { if (SolrRequestHandler.TYPE.equals(plugin.type) && !reqHandlers.containsKey(plugin.name)) { @@ -82,9 +112,7 @@ private Map buildConfigMap( } } - final var jsonSafeCopy = new NullKeyTolerantMap("children"); - jsonSafeCopy.putAll((Map) Utils.getDeepCopy(map, 20, true)); - return jsonSafeCopy; + return jsonSafeCopy(configMap); } @SuppressWarnings({"unchecked", "rawtypes"}) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java index 4dab3ed74591..cad54a5b0ee1 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java @@ -29,7 +29,8 @@ * V2 APIs for retrieving some or all configuration relevant to a particular collection (or core). * *

This class covers legacy AnnotatedApi paths under GET /config: /params, /params{paramset}, - * /overlay, /znodeVersion, etc. + * /overlay, /znodeVersion, and remaining {@code /config/{component}} sections not yet migrated to + * {@link org.apache.solr.client.api.endpoint.ConfigApi.Get} */ public class GetConfigAPI { private final SolrConfigHandler configHandler; 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 c122e8d497ac..bc22155e7807 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 @@ -56,4 +56,12 @@ public void testGetConfigFromCore() throws Exception { assertTrue(response.config.containsKey("searchComponent")); assertTrue(response.config.containsKey("updateProcessor")); } + + @Test + public void testGetConfigComponentFromCore() throws Exception { + for (String component: GetConfig.MIGRATED_CONFIG_COMPONENTS) { + + } + } + } From 3dcfaa5d4033414663aa65a6e5da25531dfa1076 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 12:22:53 +0530 Subject: [PATCH 03/18] changes --- .../src/java/org/apache/solr/client/api/endpoint/ConfigApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java index c44ef5426019..8fb86253582c 100644 --- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java +++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java @@ -45,7 +45,7 @@ ConfigInfoResponse getConfig( boolean expandParams); @GET - @Path("{component:query|updateHandler|directoryFactory|indexConfig|codecFactory") + @Path("/{component:query|updateHandler|directoryFactory|indexConfig|codecFactory}") @StoreApiParameters @Operation( summary = "Fetch a config section", From b2a1f783199ab48f7fd160fc6c8c88abc5e148db Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 12:29:07 +0530 Subject: [PATCH 04/18] tidy --- .../apache/solr/handler/admin/api/GetConfigTest.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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 bc22155e7807..864c21f17b95 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 @@ -57,11 +57,8 @@ public void testGetConfigFromCore() throws Exception { assertTrue(response.config.containsKey("updateProcessor")); } - @Test - public void testGetConfigComponentFromCore() throws Exception { - for (String component: GetConfig.MIGRATED_CONFIG_COMPONENTS) { - - } - } - + @Test + public void testGetConfigComponentFromCore() throws Exception { + for (String component : GetConfig.MIGRATED_CONFIG_COMPONENTS) {} + } } From 74052e300b118df0c5057fde0d99b5348755bd8a Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 12:35:43 +0530 Subject: [PATCH 05/18] tests --- .../handler/admin/api/GetConfigSolrCloudTest.java | 14 ++++++++++++++ .../solr/handler/admin/api/GetConfigTest.java | 11 ++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) 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 297da96353d6..4209157d4cd7 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 @@ -52,4 +52,18 @@ public void testGetConfigFromCore() throws Exception { assertTrue(response.config.containsKey("query")); assertTrue(response.config.containsKey("requestHandler")); } + + @Test + public void testGetConfigComponentFromCollection() throws Exception { + for (String component : GetConfig.MIGRATED_CONFIG_COMPONENTS) { + var request = new ConfigApi.GetConfigComponent(IndexType.COLLECTION, COLLECTION_NAME, component); + var response = request.process(cluster.getSolrClient()); + + assertNotNull(response); + assertNull(response.error); + assertNotNull(response.config); + assertTrue(response.config.containsKey(component)); + assertEquals(1, response.config.size()); + } + } } 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 864c21f17b95..f1fae899a110 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 @@ -59,6 +59,15 @@ public void testGetConfigFromCore() throws Exception { @Test public void testGetConfigComponentFromCore() throws Exception { - for (String component : GetConfig.MIGRATED_CONFIG_COMPONENTS) {} + for (String component : GetConfig.MIGRATED_CONFIG_COMPONENTS) { + var request = new ConfigApi.GetConfigComponent(IndexType.CORE, CORE_NAME, component); + var response = request.process(solrTestRule.getSolrClient(CORE_NAME)); + + assertNotNull(response); + assertNull(response.error); + assertNotNull(response.config); + assertTrue(response.config.containsKey(component)); + assertEquals(1, response.config.size()); + } } } From e798127f9476de40c80ce04ff7cb702d67d8d64b Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 12:41:54 +0530 Subject: [PATCH 06/18] more logging --- .../handler/admin/api/GetConfigSolrCloudTest.java | 13 +++++++------ .../solr/handler/admin/api/GetConfigTest.java | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) 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 4209157d4cd7..192433b181ab 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 @@ -56,14 +56,15 @@ public void testGetConfigFromCore() throws Exception { @Test public void testGetConfigComponentFromCollection() throws Exception { for (String component : GetConfig.MIGRATED_CONFIG_COMPONENTS) { - var request = new ConfigApi.GetConfigComponent(IndexType.COLLECTION, COLLECTION_NAME, component); + var request = + new ConfigApi.GetConfigComponent(IndexType.COLLECTION, COLLECTION_NAME, component); var response = request.process(cluster.getSolrClient()); - assertNotNull(response); - assertNull(response.error); - assertNotNull(response.config); - assertTrue(response.config.containsKey(component)); - assertEquals(1, response.config.size()); + assertNotNull(component, response); + assertNull(component, response.error); + assertNotNull(component, response.config); + assertTrue(component, response.config.containsKey(component)); + assertEquals(component, 1, response.config.size()); } } } 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 f1fae899a110..c59961bb11c1 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 @@ -63,11 +63,11 @@ public void testGetConfigComponentFromCore() throws Exception { var request = new ConfigApi.GetConfigComponent(IndexType.CORE, CORE_NAME, component); var response = request.process(solrTestRule.getSolrClient(CORE_NAME)); - assertNotNull(response); - assertNull(response.error); - assertNotNull(response.config); - assertTrue(response.config.containsKey(component)); - assertEquals(1, response.config.size()); + assertNotNull(component, response); + assertNull(component, response.error); + assertNotNull(component, response.config); + assertTrue(component, response.config.containsKey(component)); + assertEquals(component, 1, response.config.size()); } } } From 235536e5d0568714490eda7b5caa24b585096de8 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 12:52:32 +0530 Subject: [PATCH 07/18] added todos --- .../src/java/org/apache/solr/client/api/endpoint/ConfigApi.java | 2 ++ .../src/java/org/apache/solr/handler/admin/api/GetConfig.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java index 8fb86253582c..f4dceb6fb69e 100644 --- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java +++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java @@ -44,6 +44,8 @@ ConfigInfoResponse getConfig( @Parameter(description = "Expand request handler useParams and effective parameters") boolean expandParams); + // TODO: Keep this regex in sync with GetConfig.MIGRATED_CONFIG_COMPONENTS till migration is + // completed @GET @Path("/{component:query|updateHandler|directoryFactory|indexConfig|codecFactory}") @StoreApiParameters diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java index 3cf984b3dd73..f1d6657ab3ec 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java @@ -47,6 +47,8 @@ public class GetConfig extends JerseyResource implements ConfigApi.Get { + // TODO: Keep this in sync with @Path regex on ConfigApi.Get#getConfigComponent. + // TODO: Remove this set when remaining GET /config/{component} sections also migrate. public static final Set MIGRATED_CONFIG_COMPONENTS = Set.of("query", "updateHandler", "directoryFactory", "indexConfig", "codecFactory"); From 00afc341b2ba3b9e609ae90b9691d381c5ec2e56 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 12:55:01 +0530 Subject: [PATCH 08/18] minor --- .../java/org/apache/solr/client/api/endpoint/ConfigApi.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java index f4dceb6fb69e..e531754a8f1c 100644 --- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java +++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java @@ -44,8 +44,7 @@ ConfigInfoResponse getConfig( @Parameter(description = "Expand request handler useParams and effective parameters") boolean expandParams); - // TODO: Keep this regex in sync with GetConfig.MIGRATED_CONFIG_COMPONENTS till migration is - // completed + // TODO: Keep this regex in sync with GetConfig.MIGRATED_CONFIG_COMPONENTS @GET @Path("/{component:query|updateHandler|directoryFactory|indexConfig|codecFactory}") @StoreApiParameters From 33899f641e26133f912a2dc089176bbfb3ce403e Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 5 Oct 2026 12:56:48 +0530 Subject: [PATCH 09/18] cl --- changelog/unreleased/SOLR-16396-config-get-components.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/SOLR-16396-config-get-components.yml b/changelog/unreleased/SOLR-16396-config-get-components.yml index 9e20ae26c06e..32ba70d21a5c 100644 --- a/changelog/unreleased/SOLR-16396-config-get-components.yml +++ b/changelog/unreleased/SOLR-16396-config-get-components.yml @@ -1,5 +1,5 @@ title: - Migration of Get Config sections query, updateHandler, directoryFactory, indexConfig, and + Migrate GET config sections query, updateHandler, directoryFactory, indexConfig, and codecFactory to JAX-RS. type: changed authors: From cf1d8085fbeb53a6e5c32900fad3daebc02933d5 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 12 Oct 2026 21:38:17 +0530 Subject: [PATCH 10/18] merge conflicts --- .../solr/handler/SolrConfigHandler.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java index 0474df31d6a6..8ea4dd3ca404 100644 --- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java @@ -919,6 +919,58 @@ public static List getActiveReplicas(ZkController zkController, String return activeReplicas; } + public static void maybeRefreshStaleConfig( + SolrCore core, int expectedOverlayVersion, int expectedParamsVersion) { + boolean isStale = + isExpectedVersionStale( + "overlay", expectedOverlayVersion, core.getSolrConfig().getOverlay().getVersion()) + | isExpectedVersionStale( + "params", + expectedParamsVersion, + core.getSolrConfig().getRequestParams().getZnodeVersion()); + if (isStale && core.getResourceLoader() instanceof ZkSolrResourceLoader) { + final Lock reloadLock = + ((SolrConfigHandler) core.getRequestHandler("/config")).getReloadLock(); + new Thread( + () -> { + if (!reloadLock.tryLock()) { + log.info("Another reload is in progress . Not doing anything"); + return; + } + try { + log.info("Trying to update my configs"); + SolrCore.getConfListener(core, (ZkSolrResourceLoader) core.getResourceLoader()) + .run(); + } catch (Exception e) { + log.error("Unable to refresh conf ", e); + } finally { + reloadLock.unlock(); + } + }, + SolrConfigHandler.class.getSimpleName() + "-refreshconf") + .start(); + } else { + if (log.isInfoEnabled()) { + log.info( + "isStale {} , resourceloader {}", + isStale, + core.getResourceLoader().getClass().getName()); + } + } + } + + private static boolean isExpectedVersionStale(String label, int expected, int actual) { + if (expected == -1) { + return false; + } + if (expected > actual) { + log.info("expecting {} version {} but my version is {}", label, expected, actual); + return true; + } + log.info("I already have the expected version {} of {}", expected, label); + return false; + } + @Override public Name getPermissionName(AuthorizationContext ctx) { switch (ctx.getHttpMethod()) { From e63dffc063c24902755fe1c96de3eb973858484f Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 12 Oct 2026 21:43:48 +0530 Subject: [PATCH 11/18] tidy --- .../src/java/org/apache/solr/handler/admin/api/GetConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java index 024fc53e5fd4..053b17cfdcb3 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java @@ -31,9 +31,9 @@ import org.apache.solr.api.JerseyResource; import org.apache.solr.client.api.endpoint.ConfigApi; import org.apache.solr.client.api.model.ConfigInfoResponse; -import org.apache.solr.common.SolrException; import org.apache.solr.client.api.model.ConfigOverlayResponse; import org.apache.solr.client.api.model.ConfigZnodeVersionResponse; +import org.apache.solr.common.SolrException; import org.apache.solr.common.params.MapSolrParams; import org.apache.solr.common.params.SolrParams; import org.apache.solr.common.util.NamedList; From 712598f43cde4e9e799aa2872763eca323d52c86 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 12 Oct 2026 22:13:06 +0530 Subject: [PATCH 12/18] ongoing --- .../src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java | 1 - 1 file changed, 1 deletion(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java index 4b334bb5511f..5228acf56d23 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java @@ -61,7 +61,6 @@ public void getSingleParamSet(SolrQueryRequest req, SolrQueryResponse rsp) { @EndPoint( path = { "/config/luceneMatchVersion", - "/config/query", "/config/requestHandler", "/config/searchComponent", "/config/updateHandler", From 0b69f540d03857a2c268d03bf3b9a432df93d547 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 12 Oct 2026 23:08:03 +0530 Subject: [PATCH 13/18] minor fiix --- .../java/org/apache/solr/handler/admin/api/GetConfigAPI.java | 3 --- .../org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java | 1 - 2 files changed, 4 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java index 5228acf56d23..4a17a092aba8 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java @@ -63,13 +63,10 @@ public void getSingleParamSet(SolrQueryRequest req, SolrQueryResponse rsp) { "/config/luceneMatchVersion", "/config/requestHandler", "/config/searchComponent", - "/config/updateHandler", "/config/queryResponseWriter", "/config/initParams", "/config/listener", - "/config/directoryFactory", "/config/indexConfig", - "/config/codecFactory", "/config/requestDispatcher", "/config/jmx", "/config/queryParser", diff --git a/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java index 252946a5971f..e7912afa8faa 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java @@ -49,7 +49,6 @@ public void populateApiBag() { // the API lookup works for a handful of the valid config "components". @Test public void testGetSingleComponentConfig() { - assertAnnotatedApiExistsFor("GET", "/config/query"); assertAnnotatedApiExistsFor("GET", "/config/jmx"); assertAnnotatedApiExistsFor("GET", "/config/requestDispatcher"); assertAnnotatedApiExistsFor("GET", "/config/luceneMatchVersion"); From 8c081570e8b875fd667e8886f44ada7629fa9b8b Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 12 Oct 2026 23:31:42 +0530 Subject: [PATCH 14/18] changes --- .../src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java | 1 - .../org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java | 1 - 2 files changed, 2 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java index 4a17a092aba8..70c1e0a32b2e 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java @@ -66,7 +66,6 @@ public void getSingleParamSet(SolrQueryRequest req, SolrQueryResponse rsp) { "/config/queryResponseWriter", "/config/initParams", "/config/listener", - "/config/indexConfig", "/config/requestDispatcher", "/config/jmx", "/config/queryParser", diff --git a/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java index e7912afa8faa..9d7aeafd1891 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java @@ -52,7 +52,6 @@ public void testGetSingleComponentConfig() { assertAnnotatedApiExistsFor("GET", "/config/jmx"); assertAnnotatedApiExistsFor("GET", "/config/requestDispatcher"); assertAnnotatedApiExistsFor("GET", "/config/luceneMatchVersion"); - assertAnnotatedApiExistsFor("GET", "/config/indexConfigdeletionPolicy"); assertAnnotatedApiExistsFor("GET", "/config/updateHandlerupdateLog"); } From 67511ee6040c99c50b48a8d56746d0d5b0f7d042 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Mon, 12 Oct 2026 23:34:38 +0530 Subject: [PATCH 15/18] accidentak --- .../org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java index 9d7aeafd1891..e7912afa8faa 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java @@ -52,6 +52,7 @@ public void testGetSingleComponentConfig() { assertAnnotatedApiExistsFor("GET", "/config/jmx"); assertAnnotatedApiExistsFor("GET", "/config/requestDispatcher"); assertAnnotatedApiExistsFor("GET", "/config/luceneMatchVersion"); + assertAnnotatedApiExistsFor("GET", "/config/indexConfigdeletionPolicy"); assertAnnotatedApiExistsFor("GET", "/config/updateHandlerupdateLog"); } From d8b3860bdd500c85a2c70fc1f0b286a64d899c79 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Tue, 13 Oct 2026 00:12:33 +0530 Subject: [PATCH 16/18] dead code --- .../java/org/apache/solr/handler/admin/api/GetConfig.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java index 053b17cfdcb3..aacd1e5db684 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java @@ -33,7 +33,6 @@ import org.apache.solr.client.api.model.ConfigInfoResponse; import org.apache.solr.client.api.model.ConfigOverlayResponse; import org.apache.solr.client.api.model.ConfigZnodeVersionResponse; -import org.apache.solr.common.SolrException; import org.apache.solr.common.params.MapSolrParams; import org.apache.solr.common.params.SolrParams; import org.apache.solr.common.util.NamedList; @@ -99,10 +98,6 @@ public ConfigZnodeVersionResponse getZnodeVersion( @Override @PermissionName(CONFIG_READ_PERM) public ConfigInfoResponse getConfigComponent(String componentName) { - if (!MIGRATED_CONFIG_COMPONENTS.contains(componentName)) { - throw new SolrException( - SolrException.ErrorCode.BAD_REQUEST, "Invalid component name: " + componentName); - } final var response = instantiateJerseyResponse(ConfigInfoResponse.class); Map section = new LinkedHashMap<>(); section.put(componentName, solrConfigAsMap().get(componentName)); From 4b21b611ac554b67bec6cb2ba21f65ca604082c6 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Tue, 13 Oct 2026 00:21:29 +0530 Subject: [PATCH 17/18] minor javadoc --- .../org/apache/solr/handler/admin/api/GetConfigAPI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java index 70c1e0a32b2e..bece82f529e7 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java @@ -28,9 +28,9 @@ /** * V2 APIs for retrieving some or all configuration relevant to a particular collection (or core). * - *

This class covers legacy AnnotatedApi paths under GET /config: /params, /params{paramset}, - * /overlay, /znodeVersion, and remaining {@code /config/{component}} sections not yet migrated to - * {@link org.apache.solr.client.api.endpoint.ConfigApi.Get} + *

This class covers legacy AnnotatedApi paths under GET /config: /params, /params{paramset}, and + * remaining {@code /config/{component}} sections not yet migrated to {@link + * org.apache.solr.client.api.endpoint.ConfigApi.Get} */ public class GetConfigAPI { private final SolrConfigHandler configHandler; From 964077dde87aab3a9b50f9a00b5b0fb2832a1ea1 Mon Sep 17 00:00:00 2001 From: jaykay12 Date: Tue, 13 Oct 2026 11:17:11 +0530 Subject: [PATCH 18/18] query be ported in another PR --- changelog/unreleased/SOLR-16396-config-get-components.yml | 3 +-- .../java/org/apache/solr/client/api/endpoint/ConfigApi.java | 2 +- .../src/java/org/apache/solr/handler/admin/api/GetConfig.java | 2 +- .../java/org/apache/solr/handler/admin/api/GetConfigAPI.java | 1 + .../org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/changelog/unreleased/SOLR-16396-config-get-components.yml b/changelog/unreleased/SOLR-16396-config-get-components.yml index 32ba70d21a5c..99a86733e031 100644 --- a/changelog/unreleased/SOLR-16396-config-get-components.yml +++ b/changelog/unreleased/SOLR-16396-config-get-components.yml @@ -1,6 +1,5 @@ title: - Migrate GET config sections query, updateHandler, directoryFactory, indexConfig, and - codecFactory to JAX-RS. + Migrate GET config sections updateHandler, directoryFactory, indexConfig, and codecFactory to JAX-RS. type: changed authors: - name: Jalaz Kumar diff --git a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java index 4818f8e84f30..baaf4a9f785f 100644 --- a/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java +++ b/solr/api/src/java/org/apache/solr/client/api/endpoint/ConfigApi.java @@ -72,7 +72,7 @@ ConfigZnodeVersionResponse getZnodeVersion( // TODO: Keep this regex in sync with GetConfig.MIGRATED_CONFIG_COMPONENTS @GET - @Path("/{component:query|updateHandler|directoryFactory|indexConfig|codecFactory}") + @Path("/{component:updateHandler|directoryFactory|indexConfig|codecFactory}") @StoreApiParameters @Operation( summary = "Fetch a config section", diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java index aacd1e5db684..806cd1b39718 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfig.java @@ -52,7 +52,7 @@ public class GetConfig extends JerseyResource implements ConfigApi.Get { // TODO: Keep this in sync with @Path regex on ConfigApi.Get#getConfigComponent. // TODO: Remove this set when remaining GET /config/{component} sections also migrate. public static final Set MIGRATED_CONFIG_COMPONENTS = - Set.of("query", "updateHandler", "directoryFactory", "indexConfig", "codecFactory"); + Set.of("updateHandler", "directoryFactory", "indexConfig", "codecFactory"); private final SolrQueryRequest solrQueryRequest; diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java index bece82f529e7..1e67cb09c503 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/api/GetConfigAPI.java @@ -61,6 +61,7 @@ public void getSingleParamSet(SolrQueryRequest req, SolrQueryResponse rsp) { @EndPoint( path = { "/config/luceneMatchVersion", + "/config/query", "/config/requestHandler", "/config/searchComponent", "/config/queryResponseWriter", diff --git a/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java b/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java index e7912afa8faa..252946a5971f 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/V2ConfigAPIMappingTest.java @@ -49,6 +49,7 @@ public void populateApiBag() { // the API lookup works for a handful of the valid config "components". @Test public void testGetSingleComponentConfig() { + assertAnnotatedApiExistsFor("GET", "/config/query"); assertAnnotatedApiExistsFor("GET", "/config/jmx"); assertAnnotatedApiExistsFor("GET", "/config/requestDispatcher"); assertAnnotatedApiExistsFor("GET", "/config/luceneMatchVersion");