SOLR-4664: ZkStateReader should update aliases on construction.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1464020 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-04-03 13:58:10 +00:00
parent 218588c9ac
commit 68a1ca91c5
3 changed files with 13 additions and 0 deletions

View File

@ -150,6 +150,9 @@ Bug Fixes
* SOLR-4652: Fix broken behavior with shared libraries in resource loader for * SOLR-4652: Fix broken behavior with shared libraries in resource loader for
solr.xml plugins. (Ryan Ernst, Robert Muir, Uwe Schindler) solr.xml plugins. (Ryan Ernst, Robert Muir, Uwe Schindler)
* SOLR-4664: ZkStateReader should update aliases on construction.
(Mark Miller, Elodie Sannier)
Optimizations Optimizations
---------------------- ----------------------

View File

@ -25,6 +25,7 @@ import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettySolrRunner; import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.impl.CloudSolrServer;
import org.apache.solr.client.solrj.impl.HttpSolrServer; import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.request.QueryRequest; import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.client.solrj.request.UpdateRequest; import org.apache.solr.client.solrj.request.UpdateRequest;
@ -150,6 +151,14 @@ public class AliasIntegrationTest extends AbstractFullDistribZkTestBase {
// create alias, collection2 first because it's not on every node // create alias, collection2 first because it's not on every node
createAlias("testalias", "collection2,collection1"); createAlias("testalias", "collection2,collection1");
// search with new cloud client
CloudSolrServer cloudSolrServer = new CloudSolrServer(zkServer.getZkAddress());
query = new SolrQuery("*:*");
query.set("collection", "testalias");
res = cloudSolrServer.query(query);
cloudSolrServer.shutdown();
assertEquals(5, res.getResults().getNumFound());
// search for alias with random non cloud client // search for alias with random non cloud client
query = new SolrQuery("*:*"); query = new SolrQuery("*:*");
query.set("collection", "testalias"); query.set("collection", "testalias");

View File

@ -340,6 +340,7 @@ public class ZkStateReader {
}, true); }, true);
} }
updateAliases();
} }