[ https://issues.apache.org/jira/browse/SOLR-14630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17173188#comment-17173188 ]
Christine Poerschke commented on SOLR-14630: -------------------------------------------- {quote}I'm sorry for late response. {quote} No problem, we all contribute here as and when time permits. Thank you for returning and continuing the investigation here! {quote}Update and search are working because request is forwarded to correct shard from wrong shard. {quote} That's good to know and have clarified, thanks. {quote}Main problems are overhead forwarding requests and loosing parameters from update parameters during forwarding requests. When we perform batch update ... {quote} Yes, if a request has to be forwarded there would be some overhead. Loss of parameters during the forwarding, that is new information, interesting. When you say "batch update", do you mean more than one document in the same request or perhaps something else? If the batch size was one then does the issue happen also, I wonder? {quote}... after that in update request processor chain ... {quote} I'm not very familiar with update request processor chains but the [https://lucene.apache.org/solr/guide/8_6/update-request-processors.html#update-processors-in-solrcloud] documentation was useful and the SOLR-8030 ticket mentioned in it sounds interesting. Anyway, going back to the proposed change: {code:java} String joinedInputCollections = StrUtils.join(inputCollections, ','); Set<String> seenNodes = new HashSet<>(); sortedReplicas.forEach( replica -> { if (seenNodes.add(replica.getNodeName())) { - theUrlList.add(ZkCoreNodeProps.getCoreUrl(replica.getBaseUrl(), joinedInputCollections)); + theUrlList.add(replica.getCoreUrl()); } }); {code} Thinking out aloud ... * What if {{inputCollections}} contained more than one element? * What if {{inputCollections}} contained an alias that was resolved at [line 1080|https://github.com/apache/lucene-solr/blob/releases/lucene-solr/8.5.2/solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java#L1080], does it matter that before the alias (e.g. {{collection_one}}) was appended but now a core name (e.g. {{collection1_shard2_replica1}}) is appended? * A {{route}} can designate multiple shards (right?) and in the {{seenNodes.add(replica.getNodeName())}} check, what is node name again, it's localhost_8983_solr right? If so then that check guards against multiple {{localhost:8983/solr/*}} i.e. if the {{route}} designated shard2 and shard4 we would get {{localhost:8983/solr/collection1_shard2_replica1}} or {{localhost:8983/solr/collection1_shard4_replica1}} but not both. Would {{collection1_shard2_replica1}} do its stuff and forward to {{collection1_shard4_replica1}} or would there be no forwarding? * Might _"If a route key was supplied and ... then do new-stuff else do existing-stuff"_ specialisation work? It could complicate the already quite complicated code though, hmm. * Might there be other solutions to the problem? > CloudSolrClient doesn't pick correct core when server contains more shards > -------------------------------------------------------------------------- > > Key: SOLR-14630 > URL: https://issues.apache.org/jira/browse/SOLR-14630 > Project: Solr > Issue Type: Bug > Components: SolrCloud, SolrJ > Affects Versions: 8.5.1, 8.5.2 > Reporter: Ivan Djurasevic > Priority: Major > > Precondition: create collection with 4 shards on one server. > During search and update, solr cloud client picks wrong core even _route_ > exists in query param. In BaseSolrClient class, method sendRequest, > > {code:java} > sortedReplicas.forEach( replica -> { > if (seenNodes.add(replica.getNodeName())) { > theUrlList.add(ZkCoreNodeProps.getCoreUrl(replica.getBaseUrl(), > joinedInputCollections)); > } > }); > {code} > > Previous part of code adds base url(localhost:8983/solr/collection_name) to > theUrlList, it doesn't create core address(localhost:8983/solr/core_name). If > we change previous code to: > {quote} > {code:java} > sortedReplicas.forEach(replica -> { > if (seenNodes.add(replica.getNodeName())) { > theUrlList.add(replica.getCoreUrl()); > } > });{code} > {quote} > Solr cloud client picks core which is defined with _route_ parameter. > > -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org