From 7da9e9d7352083060d45c1a10430a3a17fdeefbe Mon Sep 17 00:00:00 2001 From: Mark Miller Date: Wed, 31 May 2017 17:44:00 -0400 Subject: [PATCH] SOLR-10137: Ensure that ConfigSets created via API are mutable. --- solr/CHANGES.txt | 2 ++ .../java/org/apache/solr/handler/admin/ConfigSetsHandler.java | 4 ++++ .../test/org/apache/solr/handler/admin/TestConfigsApi.java | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index a2dc8201bcf..98f3ec2769d 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -252,6 +252,8 @@ Bug Fixes * SOLR-10360: Solr HDFS snapshot export fails due to FileNotFoundException error when using MR1 instead of yarn. (Hrishikesh via Mark Miller) + +* SOLR-10137: Ensure that ConfigSets created via API are mutable. (Hrishikesh via Mark Miller) Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java index 3f857e79d67..34313d00d89 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java @@ -238,6 +238,10 @@ public class ConfigSetsHandler extends RequestHandlerBase implements PermissionN props.put(param, params.get(param)); } } + + // The configset created via an API should be mutable. + props.put("immutable", "false"); + return props; } diff --git a/solr/core/src/test/org/apache/solr/handler/admin/TestConfigsApi.java b/solr/core/src/test/org/apache/solr/handler/admin/TestConfigsApi.java index d2c96a66be2..c0c193de872 100644 --- a/solr/core/src/test/org/apache/solr/handler/admin/TestConfigsApi.java +++ b/solr/core/src/test/org/apache/solr/handler/admin/TestConfigsApi.java @@ -54,6 +54,6 @@ public class TestConfigsApi extends SolrTestCaseJ4 { "{name :sample, operation:delete}"); compareOutput(apiBag, "/cluster/configs", POST, "{create:{name : newconf, baseConfigSet: sample }}", null, - "{operation:create, name :newconf, baseConfigSet: sample }"); + "{operation:create, name :newconf, baseConfigSet: sample, immutable: false }"); } }