SOLR-6859: Disable REBALANCELEADERS for 5.0

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1646904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erick Erickson 2014-12-20 00:17:48 +00:00
parent 8cd8dbcb8f
commit ec5364fa51
5 changed files with 20 additions and 17 deletions

View File

@ -209,9 +209,6 @@ New Features
* SOLR-4715: Add CloudSolrServer constructors which accept a HttpClient instance.
(Hardik Upadhyay, Shawn Heisey, shalin)
* SOLR-6517: CollectionsAPI call REBALANCELEADERS. Used to balance leaders
across nodes for a particular collection
* SOLR-5992: add "removeregex" as an atomic update operation
(Vitaliy Zhovtyuk via Erick Erickson)

View File

@ -655,9 +655,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);

View File

@ -267,10 +267,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);
}

View File

@ -32,6 +32,7 @@ import org.apache.solr.common.cloud.DocCollection;
import org.apache.solr.common.cloud.Replica;
import org.apache.solr.common.cloud.Slice;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.zookeeper.KeeperException;
// Collect useful operations for testing assigning properties to individual replicas
@ -39,7 +40,7 @@ import org.apache.zookeeper.KeeperException;
// and shards, but for now this will do.
public abstract class ReplicaPropertiesBase extends AbstractFullDistribZkTestBase {
void doPropertyAction(CloudSolrServer client, String... paramsIn) throws IOException, SolrServerException {
NamedList<Object> doPropertyAction(CloudSolrServer client, String... paramsIn) throws IOException, SolrServerException {
assertTrue("paramsIn must be an even multiple of 2, it is: " + paramsIn.length, (paramsIn.length % 2) == 0);
ModifiableSolrParams params = new ModifiableSolrParams();
for (int idx = 0; idx < paramsIn.length; idx += 2) {
@ -47,8 +48,7 @@ public abstract class ReplicaPropertiesBase extends AbstractFullDistribZkTestBas
}
QueryRequest request = new QueryRequest(params);
request.setPath("/admin/collections");
client.request(request);
return client.request(request);
}
void verifyPropertyNotPresent(CloudSolrServer client, String collectionName, String replicaName,

View File

@ -193,11 +193,17 @@ public class TestReplicaProperties extends ReplicaPropertiesBase {
// leaders _also_ have the preferredLeader property set.
doPropertyAction(client,
"action", CollectionParams.CollectionAction.REBALANCELEADERS.toString(),
"collection", COLLECTION_NAME);
try {
NamedList<Object> 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"));
}
verifyLeaderAssignment(client, COLLECTION_NAME);
// verifyLeaderAssignment(client, COLLECTION_NAME);
} finally {
client.shutdown();