There are three "concepts" to grasp:

1. You can send Solr update requests to ANY node of the cluster. Period.
2. Any extra network traffic (within the cluster) is likely to be negligible and absolutely not worrying about unless you have definitive evidence to the contrary. 3. Leader nodes in SolrCloud are designed to be dynamic and will change over time. Generally, you won't know which node is the leader for a shard at any given moment - it may have been a particular node one milliscond ago, but now maybe another node has been designated as the leader. Neither the application nor the user designates which node is a leader for a shard - it is a dynamic election process. Sure, you can check to see which node is currently the leader, but one millisecond later some other node may have gotten elected to be the leader.

To repeat, you DO NOT need to be concerned with sending Solr update requests to a shard "leader". The SolrCloud concept of "leader" is really only needed WITHIN the cluster. Clients outside of the SolrCloud cluster need not concern themselves with shard "leaders."

"Micro-optimization" and "premature optimization" are very poor tools to lead a system design. Focus the energy on the data modeling and the overall application design.

-- Jack Krupansky

-----Original Message----- From: vicky desai
Sent: Sunday, July 07, 2013 1:17 AM
To: solr-user@lucene.apache.org
Subject: Re: Is it possible to find a leader from a list of cores in solr via java code

Hi Erik,

I just wanted to clarify if u got my concern right. If i send some documents
to the replica core wont it first have to send the documents to the leader
core which in turn would be sending it back to the replica cores. If yes
then this will lead to additional network traffic which can be avoided by
sending the documents directly to leader.

Please correct me if I have got the concept incorrect.Any help is
appreciated


Thanks,
Vicky



--
View this message in context: http://lucene.472066.n3.nabble.com/Is-it-possible-to-find-a-leader-from-a-list-of-cores-in-solr-via-java-code-tp4074994p4076016.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to