OK, I'll go waaaaay out on a limb here since I know so
little about the guts of the ZK/Solr interactions on the
theory that if I'm wrong someone will jump in and I'll
remember the data due to being embarrassed.

ZK doesn't really know much about Solr. It knows there
are a bunch of nodes out there running this thing called
"Solr". It knows the state/roles of those nodes mostly
because the nodes _tell_ ZK about themselves. It knows
nodes are up/down because it hasn't heard from them in
a while.

What it doesn't know is what those nodes _do_. To "forwards
it to appropriate replica/leader" code ZK would have to be
able to pull apart a (potentially) many document packet of
SolrInputDocuments, grok that there's this <uniqueKey> field
(which would mean it would have to understand the schema)
understand the routing mechanism to be used to
identify the right leader and forward each doc appropriately.
IOW it would have to implement much of CloudSolrServer.

And even if it did all that (which IMO would be architecturally
_very_ bad), it would be bad for throughput. Now my 3
ZK nodes have to handle _all_ the routing traffic for my 100
node cluster, introducing a potential bottleneck.

I know you're using C++ so the Java version may not apply,
but the CloudSolrServer class hides all of this and _does_ send
the docs to the right leader all without burdening the ZK nodes.
I know there has been a C++ port of SolrJ, but don't
know whether it has been kept up to date with the more recent
SolrJ improvements.

Whew! Occasionally I write these in order to make myself think
about things, what did I mess up? (Mark, Shalin and Noble may
jump all over this, won't be the first time)...

Erick


On Fri, Feb 14, 2014 at 2:57 AM, neerajp <neeraj_star2...@yahoo.com> wrote:

> Hello All,
> I am using Solr for indexing my data. My client is in C++. So I make Curl
> request to Solr server for indexing.
> Now, I want to use indexing in SolrCloud mode using ZooKeeper for HA.  I
> read the wiki link of SolrCloud (http://wiki.apache.org/solr/SolrCloud).
>
> What I understand from wiki that we should always check solr instance
> status(up & running) in solrCloud before making an update request. Can I
> not
> send update request to zookeeper and let the zookeeper forwards it to
> appropriate replica/leader ? In the later case I need not to worry which
> servers are up and running before making indexing request.
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/update-in-SolrCloud-through-C-client-tp4117340.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to