As I was contemplating how it is that I see some weird behavior while
working on SolrCloud stuff could happen, I started to question my basic
assumptions.  One assumption I held is that SolrZkClient.getData (which
calls  ZooKeeper.getData) would always return the most up to date
information from the ZK cluster.  The docs to ZooKeeper.getData say nothing
on this matter.  If it did work this way, I imagine it would need to talk
to at least a majority of the ZK ensemble. Now that I reed the ZK
Programmer's guide RE consistency guarantees --
http://zookeeper.apache.org/doc/r3.4.11/zookeeperProgrammers.html#ch_zkGuarantees
I
see reads may read stale data and that I can use ZooKeeper.sync() first to
get the latest.  Okay wow.  Interestingly we don't call this anywhere in
our codebase.  With this newfound realization, I think at least one place
pertaining to TimeRoutedAliases really wants the most up to date
information, so I'll need to add a call to sync.  Of course sync() should
be added deliberately not haphazardly; I'm sure it has overhead.
-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com

Reply via email to