Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -87,9 +88,21 @@ public void call(AdminCmdContext adminCmdContext, ZkNodeProps message, NamedList

List<String> nodeList = roles.computeIfAbsent(roleName, k -> new ArrayList<>());
if (ADDROLE == operation) {
DeprecationLog.log(
"CollectionAPI-" + operation.toLower(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no-need to change the case of the operation

"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);
}
Expand Down
2 changes: 2 additions & 0 deletions solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<RoleInfo> obj) throws Exception {
RoleInfo info = obj.get();
Map<String, Object> m = new SimpleOrderedMap<>(info);
Expand All @@ -266,6 +267,7 @@ public void addRole(PayloadObj<RoleInfo> obj) throws Exception {
}

@Command(name = "remove-role")
@Deprecated(since = "10.1")
public void removeRole(PayloadObj<RoleInfo> obj) throws Exception {
RoleInfo info = obj.get();
Map<String, Object> m = new SimpleOrderedMap<>(info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading