diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 349648893692..73442cb817b3 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -318,6 +318,14 @@ Bug Fixes * SOLR-15334: Return error response when failing auth in PKIAuthPlugin (Mike Drob) +================== 8.10.0 ================== + +Bug Fixes +--------------------- + +* SOLR-15311: Support ASYNC parameter in MODIFYCOLLECTION (Nazerke Seidan, Christine Poerschke, David Smiley) +* ``` + ================== 8.9.0 ================== Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release. diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java index be1fc304abc7..fa02123a19d3 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CollApiCmds.java @@ -38,6 +38,7 @@ import org.apache.solr.common.cloud.ZkStateReader; import org.apache.solr.common.params.CollectionAdminParams; import org.apache.solr.common.params.CollectionParams; +import org.apache.solr.common.params.CommonAdminParams; import org.apache.solr.common.params.CoreAdminParams; import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.util.NamedList; @@ -322,6 +323,7 @@ public void call(ClusterState clusterState, ZkNodeProps message, @SuppressWarnin if (!updateKey.equals(ZkStateReader.COLLECTION_PROP) && !updateKey.equals(Overseer.QUEUE_OPERATION) + && !updateKey.equals(CommonAdminParams.ASYNC) && updateEntry.getValue() != null // handled below in a separate conditional && !updateEntry.getValue().equals(c.get(updateKey))) { return false; diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerModifyCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerModifyCollectionTest.java index ed113cd4cdd8..e3c42055f7af 100644 --- a/solr/core/src/test/org/apache/solr/cloud/OverseerModifyCollectionTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/OverseerModifyCollectionTest.java @@ -17,19 +17,17 @@ package org.apache.solr.cloud; +import java.util.Collections; import java.util.Map; import org.apache.solr.client.solrj.request.CollectionAdminRequest; -import org.apache.solr.client.solrj.request.GenericSolrRequest; +import org.apache.solr.client.solrj.response.RequestStatusState; import org.apache.solr.common.cloud.ZkStateReader; -import org.apache.solr.common.params.ModifiableSolrParams; import org.apache.solr.common.util.Utils; import org.apache.zookeeper.KeeperException; import org.junit.BeforeClass; import org.junit.Test; -import static org.apache.solr.client.solrj.SolrRequest.METHOD.POST; -import static org.apache.solr.common.params.CommonParams.COLLECTIONS_HANDLER_PATH; public class OverseerModifyCollectionTest extends SolrCloudTestCase { @@ -49,22 +47,19 @@ public void testModifyColl() throws Exception { CollectionAdminRequest.createCollection(collName, "conf1", 1, 2) .process(cluster.getSolrClient()); - // TODO create a modifyCollection() method on CollectionAdminRequest - ModifiableSolrParams p1 = new ModifiableSolrParams(); - p1.add("collection", collName); - p1.add("action", "MODIFYCOLLECTION"); - p1.add("collection.configName", "conf2"); - cluster.getSolrClient().request(new GenericSolrRequest(POST, COLLECTIONS_HANDLER_PATH, p1)); + // Modify configSet + RequestStatusState requestStatusState = CollectionAdminRequest.modifyCollection(collName, + Collections.singletonMap("collection.configName", "conf2")) + .processAndWait(cluster.getSolrClient(), DEFAULT_TIMEOUT); + assertEquals(requestStatusState, RequestStatusState.COMPLETED); assertEquals("conf2", getConfigNameFromZk(collName)); //Try an invalid config name - ModifiableSolrParams p2 = new ModifiableSolrParams(); - p2.add("collection", collName); - p2.add("action", "MODIFYCOLLECTION"); - p2.add("collection.configName", "notARealConfigName"); Exception e = expectThrows(Exception.class, () -> { - cluster.getSolrClient().request(new GenericSolrRequest(POST, COLLECTIONS_HANDLER_PATH, p2)); + CollectionAdminRequest.modifyCollection(collName, + Collections.singletonMap("collection.configName", "notARealConfigName") + ).process(cluster.getSolrClient()); }); assertTrue(e.getMessage(), e.getMessage().contains("Can not find the specified config set")); diff --git a/solr/solr-ref-guide/src/collection-management.adoc b/solr/solr-ref-guide/src/collection-management.adoc index 3d73c7234ac5..c071d66a4755 100644 --- a/solr/solr-ref-guide/src/collection-management.adoc +++ b/solr/solr-ref-guide/src/collection-management.adoc @@ -275,6 +275,7 @@ The attributes that can be modified are: * replicationFactor * collection.configName * readOnly +* async * other custom properties that use a `property.` prefix See the <> section above for details on these attributes.