diff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java index b79f4d883ed..4102d97d08b 100644 --- a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java +++ b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java @@ -658,9 +658,9 @@ public class OverseerCollectionProcessor implements Runnable, Closeable { case BALANCESHARDUNIQUE: balanceProperty(message); break; -// case REBALANCELEADERS: -// processAssignLeaders(message); -// break; + case REBALANCELEADERS: + processAssignLeaders(message); + break; default: throw new SolrException(ErrorCode.BAD_REQUEST, "Unknown operation:" + operation); diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java index e6d4f798751..8a6211284b3 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java @@ -268,10 +268,10 @@ public class CollectionsHandler extends RequestHandlerBase { this.handleBalanceShardUnique(req, rsp); break; } -// case REBALANCELEADERS: { -// this.handleBalanceLeaders(req, rsp); -// break; -// } + case REBALANCELEADERS: { + this.handleBalanceLeaders(req, rsp); + break; + } default: { throw new RuntimeException("Unknown action: " + action); } diff --git a/solr/core/src/test/org/apache/solr/cloud/TestReplicaProperties.java b/solr/core/src/test/org/apache/solr/cloud/TestReplicaProperties.java index c7a005e9ddb..42a15ca7eb3 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestReplicaProperties.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestReplicaProperties.java @@ -193,17 +193,11 @@ public class TestReplicaProperties extends ReplicaPropertiesBase { // leaders _also_ have the preferredLeader property set. - try { - NamedList res = doPropertyAction(client, - "action", CollectionParams.CollectionAction.REBALANCELEADERS.toString(), - "collection", COLLECTION_NAME); - fail("Should have thrown 'Unknown action' error"); - } catch (SolrServerException e) { - assertTrue("Should have gotten an error message that REBALANCELEADERS is not supported", - e.getCause().getMessage().contains("Unknown action: REBALANCELEADERS")); - } + NamedList res = doPropertyAction(client, + "action", CollectionParams.CollectionAction.REBALANCELEADERS.toString(), + "collection", COLLECTION_NAME); -// verifyLeaderAssignment(client, COLLECTION_NAME); + verifyLeaderAssignment(client, COLLECTION_NAME); } finally { client.shutdown();