[
https://issues.apache.org/jira/browse/SOLR-11292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16208347#comment-16208347
]
Varun Thacker commented on SOLR-11292:
--------------------------------------
Hi David,
I applied SOLR-1144 and I still don't think it's working
Here is how I tested:
Built solr from master after applying the patch.
Started solr with {{bin/solr start -e cloud -noprompt}}
Created c1 on node 8983
Created c2 on node 7574
Created an alias called c1 -
{{admin/collections?action=createalias&name=c1&collections=c2}}
>From my IDE which had the patch applied I tried these two snippets and the
>results were the same
{code}
CloudSolrClient cloudSolrClient = new
CloudSolrClient.Builder().withZkHost("localhost:9983").build();
for (int i=0; i<10; i++) {
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("q", "*:*");
cloudSolrClient.query("c1", params);
}
cloudSolrClient.close();
{code}
{code}
CloudSolrClient cloudSolrClient = new
CloudSolrClient.Builder().withZkHost("localhost:9983").build();
cloudSolrClient.setDefaultCollection("c1");
for (int i=0; i<10; i++) {
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("q", "*:*");
cloudSolrClient.query(params);
}
cloudSolrClient.close();
{code}
I only see log entries on node1 8983 which was hosting c1 but the top level
query should have gone only to node2 in my setup
{code}
INFO - 2017-10-17 21:10:28.964; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=28
INFO - 2017-10-17 21:10:28.994; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
INFO - 2017-10-17 21:10:28.996; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
INFO - 2017-10-17 21:10:28.999; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
INFO - 2017-10-17 21:10:29.001; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
INFO - 2017-10-17 21:10:29.005; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
INFO - 2017-10-17 21:10:29.008; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
INFO - 2017-10-17 21:10:29.011; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
INFO - 2017-10-17 21:10:29.013; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
INFO - 2017-10-17 21:10:29.015; [c:c2 s:shard1 r:core_node2
x:c2_shard1_replica_n1] org.apache.solr.core.SolrCore; [c2_shard1_replica_n1]
webapp=/solr path=/select params={q=*:*&_stateVer_=c1:4&wt=javabin&version=2}
hits=0 status=0 QTime=0
{code}
Looking at {{_stateVer_=c1}} in the request params , it looks like we are still
passing the state of c1 only from the client ?
> Querying against an alias can lead to incorrect routing
> -------------------------------------------------------
>
> Key: SOLR-11292
> URL: https://issues.apache.org/jira/browse/SOLR-11292
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: Varun Thacker
> Assignee: Varun Thacker
>
> collection1 has 2 shards and 1 replica
> collection2 has 8 shards and 1 replica
> I have 8 nodes so collection2 is spread across all 8 , while collection1 is
> hosted by two nodes
> If we create an alias called "collection1" and point it to "collection2".
> Querying against the alias "collection1" works as expected but what I noticed
> was the top level queries would only hit 2 out of the 8 JVMs when querying
> using SolrJ
> It turns out that SolrJ is using the state.json of collection1 ( the actual
> collection ) and routing queries to only those nodes.
> There are two negatives to this:
> - If those two nodes are down all queries fail.
> - Top level queries are only routed to those two nodes thus causing a skew
> in the top level requests
> The obvious solution would be to use the state.json file of the underlying
> collection that the alias is pointing to . But if we have the alias pointing
> to multiple collections then this might get tricky?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]