in a solr master slave replication, if I register postCommit listener on a 
slave, which index reader should I get if I do:

        @Override
        public final void postCommit() {
                final RefCounted<SolrIndexSearcher> refC = core
                                .getNewestSearcher(true);
                try{
                        final Map<String, String> userData = 
refC.get().getIndexReader().getIndexCommit().getUserData();
                        // do something with userData
                } catch (IOException e) {
                        log.error("PostCommit: ", e);
                } finally {
                  refC.decref();
                }
                
        }


What I observed is that I get "stale" userData, is this correct? Didn't 
"commit" replace IndexReader to the actual commit point? (I observe userData 
that were there before replication finished, but I expected to see userData  
version from  the master at this stage)

If I force core.openNewSearcher(false, false);  I get correct, replicated 
userData I just received from master…

What I am doing wrong? Contract of core.getNewestSearcher(true) return in 
postCommit(), or better "when solr updates commit point"? 

Not so import an for the particular problem, but interesting to know these life 
cycles.


Thanks, eks

Reply via email to