From 33801c42976f8508bbf69512b33e159ee00eb115 Mon Sep 17 00:00:00 2001 From: abumarjikar Date: Thu, 9 Jul 2026 14:00:21 +0530 Subject: [PATCH 1/4] Initial Commit --- .../cloud/api/collections/OverseerRoleCmd.java | 13 +++++++++++++ .../solrj/request/CollectionAdminRequest.java | 14 ++++++++++++-- .../solr/common/params/CollectionParams.java | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java index af4ff42be667..4b5c3b7272e4 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java @@ -32,6 +32,7 @@ import org.apache.solr.common.util.CollectionUtil; import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.Utils; +import org.apache.solr.logging.DeprecationLog; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.data.Stat; import org.slf4j.Logger; @@ -87,9 +88,21 @@ public void call(AdminCmdContext adminCmdContext, ZkNodeProps message, NamedList List nodeList = roles.computeIfAbsent(roleName, k -> new ArrayList<>()); if (ADDROLE == operation) { + DeprecationLog.log( + "CollectionAPI-" + operation.toLower(), + "The " + + operation + + " API is deprecated and will be removed in Solr 11. " + + "Please transition to using Node Roles (-Dsolr.node.roles) at startup instead."); log.info("Overseer role added to {}", node); if (!nodeList.contains(node)) nodeList.add(node); } else if (REMOVEROLE == operation) { + DeprecationLog.log( + "CollectionAPI-" + operation.toLower(), + "The " + + operation + + " API is deprecated and will be removed in Solr 11. " + + "Please transition to using Node Roles (-Dsolr.node.roles) at startup instead."); log.info("Overseer role removed from {}", node); nodeList.remove(node); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java index b67b665a5513..0ac88ee39228 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java @@ -2861,7 +2861,12 @@ public SolrParams getParams() { } } - /** Returns a SolrRequest to add a role to a node */ + /** + * Returns a SolrRequest to add a role to a node + * + * @deprecated Use Node Roles ({@code -Dsolr.node.roles}) at startup instead. + */ + @Deprecated(since = "10.1") public static AddRole addRole(String node, String role) { return new AddRole(node, role); } @@ -2873,7 +2878,12 @@ private AddRole(String node, String role) { } } - /** Returns a SolrRequest to remove a role from a node */ + /** + * Returns a SolrRequest to remove a role from a node + * + * @deprecated Use Node Roles ({@code -Dsolr.node.roles}) at startup instead. + */ + @Deprecated(since = "10.1") public static RemoveRole removeRole(String node, String role) { return new RemoveRole(node, role); } diff --git a/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java b/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java index a066ff1e89b3..3e1d9745c93e 100644 --- a/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java +++ b/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java @@ -102,7 +102,9 @@ enum CollectionAction { DELETEREPLICA(true, LockLevel.SHARD), FORCELEADER(true, LockLevel.SHARD), MIGRATE(true, LockLevel.COLLECTION), + @Deprecated(since = "10.1") ADDROLE(true, LockLevel.NONE), + @Deprecated(since = "10.1") REMOVEROLE(true, LockLevel.NONE), CLUSTERPROP(true, LockLevel.NONE), COLLECTIONPROP(true, LockLevel.NONE), // atomic; no lock From 328fbed4e38b2ee78d3eaedcafb4bfaf3a43b057 Mon Sep 17 00:00:00 2001 From: abumarjikar Date: Thu, 9 Jul 2026 14:12:01 +0530 Subject: [PATCH 2/4] Added Changelog --- .../SOLR_18160_deprecate_addrole_removerole.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 changelog/unreleased/SOLR_18160_deprecate_addrole_removerole.yml diff --git a/changelog/unreleased/SOLR_18160_deprecate_addrole_removerole.yml b/changelog/unreleased/SOLR_18160_deprecate_addrole_removerole.yml new file mode 100644 index 000000000000..89624c353056 --- /dev/null +++ b/changelog/unreleased/SOLR_18160_deprecate_addrole_removerole.yml @@ -0,0 +1,8 @@ +type: deprecated +title: Deprecate Overseer ADDROLE and REMOVEROLE Collection API operations +authors: + - name: Abhishek Umarjikar + nick: abumarjikar +links: + - name: SOLR-18160 + url: https://issues.apache.org/jira/browse/SOLR-18160 From e57786ba0ed4679028c1b9c959bb265615bb4748 Mon Sep 17 00:00:00 2001 From: abumarjikar Date: Fri, 10 Jul 2026 09:29:23 +0530 Subject: [PATCH 3/4] Marked the method, role field deprecated and doc changes added. --- solr/core/src/java/org/apache/solr/handler/ClusterAPI.java | 2 ++ .../src/java/org/apache/solr/handler/admin/ClusterStatus.java | 3 +++ .../modules/upgrade-notes/pages/major-changes-in-solr-10.adoc | 2 ++ 3 files changed, 7 insertions(+) diff --git a/solr/core/src/java/org/apache/solr/handler/ClusterAPI.java b/solr/core/src/java/org/apache/solr/handler/ClusterAPI.java index e8c36f4e8cce..13b2cb8a6828 100644 --- a/solr/core/src/java/org/apache/solr/handler/ClusterAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/ClusterAPI.java @@ -258,6 +258,7 @@ private CoreContainer getCoreContainer() { @EndPoint(method = POST, path = "/cluster", permission = COLL_EDIT_PERM) public class Commands { @Command(name = "add-role") + @Deprecated(since = "10.1") public void addRole(PayloadObj obj) throws Exception { RoleInfo info = obj.get(); Map m = new SimpleOrderedMap<>(info); @@ -266,6 +267,7 @@ public void addRole(PayloadObj obj) throws Exception { } @Command(name = "remove-role") + @Deprecated(since = "10.1") public void removeRole(PayloadObj obj) throws Exception { RoleInfo info = obj.get(); Map m = new SimpleOrderedMap<>(info); diff --git a/solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java b/solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java index cbc45803d800..cfd2377ebe6d 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/ClusterStatus.java @@ -50,7 +50,10 @@ public class ClusterStatus { public static final String INCLUDE_ALL = "includeAll"; public static final String LIVENODES_PROP = "liveNodes"; public static final String CLUSTER_PROP = "clusterProperties"; + + @Deprecated(since = "10.1") public static final String ROLES_PROP = "roles"; + public static final String ALIASES_PROP = "aliases"; /** Shard / collection health state. */ diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc index a9be79797a9f..c7b1962ce03f 100644 --- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc +++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc @@ -307,6 +307,8 @@ Nowadays, the HTTP request is available via internal APIs: `SolrQueryRequest.get * The deprecated `VMParamsAllAndReadonlyDigestZkACLProvider` class has been removed. Use a combination of `DigestZkACLProvider` and `VMParamsZkCredentialsInjector` instead. (SOLR-18122) +* The legacy V1 `ADDROLE` and `REMOVEROLE` commands (and their SolrJ client and experimental V2 counterparts) are deprecated as of 10.1 and scheduled for removal in Solr 11. Users must switch to **"node roles" (system properties)** (e.g., `-Dsolr.node.roles=data:on,overseer:preferred`) at startup. The `roles` field in `CLUSTERSTATUS` is also deprecated. + === Security * There is no longer a distinction between trusted and untrusted configSets; all configSets are now considered trusted. To ensure security, Solr should be properly protected using authentication and authorization mechanisms, allowing only authorized users with administrative privileges to publish them. From 0fca89fcfc2ce47e51879e8c94c96ca5b91aca2f Mon Sep 17 00:00:00 2001 From: abumarjikar Date: Mon, 13 Jul 2026 11:40:07 +0530 Subject: [PATCH 4/4] removed the case change for opertaion --- .../apache/solr/cloud/api/collections/OverseerRoleCmd.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java index 4b5c3b7272e4..f33e317f9984 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java @@ -89,7 +89,7 @@ public void call(AdminCmdContext adminCmdContext, ZkNodeProps message, NamedList List nodeList = roles.computeIfAbsent(roleName, k -> new ArrayList<>()); if (ADDROLE == operation) { DeprecationLog.log( - "CollectionAPI-" + operation.toLower(), + "CollectionAPI-" + operation, "The " + operation + " API is deprecated and will be removed in Solr 11. " @@ -98,7 +98,7 @@ public void call(AdminCmdContext adminCmdContext, ZkNodeProps message, NamedList if (!nodeList.contains(node)) nodeList.add(node); } else if (REMOVEROLE == operation) { DeprecationLog.log( - "CollectionAPI-" + operation.toLower(), + "CollectionAPI-" + operation, "The " + operation + " API is deprecated and will be removed in Solr 11. "