You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Esad Mumdzic <ek...@googlemail.com> on 2012/02/20 15:44:13 UTC

postCommit confusion?

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