What I am observing is that Solr is fully started up even before it has finished playing the tlog. In the logs I see that a searcher is registered first and the "Log replay finished" appears later. During that time if I search, I do get stale values. Below are the log lines that I captured :
WARN - 2019-03-08 16:33:42.126; [ x:techproducts] org.apache.solr.update.UpdateLog$LogReplayer; Starting log replay tlog{file=C:\Work\Solr\solr-7.2.1\Installation\solr-7.2.1\example\techproducts\solr\techproducts\data\tlog\tlog.0000000000000000009 refcount=2} active=false starting pos=0 inSortedOrder=false INFO - 2019-03-08 16:33:42.141; [ x:techproducts] org.apache.solr.core.SolrCore; [techproducts] webapp=null path=null params={q=static+firstSearcher+warming+in+solrconfig.xml&distrib=false&event=firstSearcher} hits=3 status=0 QTime=37 INFO - 2019-03-08 16:33:42.157; [ x:techproducts] org.apache.solr.core.QuerySenderListener; QuerySenderListener done. INFO - 2019-03-08 16:33:42.157; [ x:techproducts] org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener; Loading spell index for spellchecker: default INFO - 2019-03-08 16:33:42.157; [ x:techproducts] org.apache.solr.handler.component.SpellCheckComponent$SpellCheckerListener; Loading spell index for spellchecker: wordbreak INFO - 2019-03-08 16:33:42.157; [ x:techproducts] org.apache.solr.core.SolrCore; [techproducts] Registered new searcher Searcher@63c5631[techproducts] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_0(7.2.1):C32/1:delGen=1) Uninverting(_5(7.2.1):C1)))} INFO - 2019-03-08 16:34:07.373; [ x:techproducts] org.apache.solr.core.SolrCore; [techproducts] webapp=/solr path=/select params={q=id:SP2514N&wt=json&_=1552062352063} hits=1 status=0 QTime=2 INFO - 2019-03-08 16:34:08.818; [ x:techproducts] org.apache.solr.core.SolrCore; [techproducts] webapp=/solr path=/select params={q=id:SP2514N&wt=json&_=1552062352063} hits=1 status=0 QTime=1 INFO - 2019-03-08 16:34:14.422; [ x:techproducts] org.apache.solr.update.DirectUpdateHandler2; start commit{flags=2,optimize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit=false,prepareCommit=false} INFO - 2019-03-08 16:34:16.353; [ x:techproducts] org.apache.solr.core.SolrCore; [techproducts] webapp=/solr path=/select params={q=id:SP2514N&wt=json&_=1552062352063} hits=1 status=0 QTime=1 INFO - 2019-03-08 16:34:18.948; [ x:techproducts] org.apache.solr.update.SolrIndexWriter; Calling setCommitData with IW:org.apache.solr.update.SolrIndexWriter@266e1192 commitCommandVersion:0 INFO - 2019-03-08 16:34:19.040; [ x:techproducts] org.apache.solr.search.SolrIndexSearcher; Opening [Searcher@5c6044f1[techproducts] main] INFO - 2019-03-08 16:34:19.040; [ x:techproducts] org.apache.solr.update.DirectUpdateHandler2; end_commit_flush INFO - 2019-03-08 16:34:19.040; [ x:techproducts] org.apache.solr.core.QuerySenderListener; QuerySenderListener sending requests to Searcher@5c6044f1[techproducts] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_0(7.2.1):C32/1:delGen=1) Uninverting(_6(7.2.1):C1)))} INFO - 2019-03-08 16:34:19.040; [ x:techproducts] org.apache.solr.core.QuerySenderListener; QuerySenderListener done. INFO - 2019-03-08 16:34:19.040; [ x:techproducts] org.apache.solr.core.SolrCore; [techproducts] Registered new searcher Searcher@5c6044f1[techproducts] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_0(7.2.1):C32/1:delGen=1) Uninverting(_6(7.2.1):C1)))} INFO - 2019-03-08 16:34:19.056; [ x:techproducts] org.apache.solr.update.processor.LogUpdateProcessorFactory$LogUpdateProcessor; [techproducts] {add=[SP2514N (1627455755076501504)]} 0 36923 WARN - 2019-03-08 16:34:19.056; [ x:techproducts] org.apache.solr.update.UpdateLog$LogReplayer; Log replay finished. recoveryInfo=RecoveryInfo{adds=1 deletes=0 deleteByQuery=0 errors=0 positionOfStart=0} INFO - 2019-03-08 16:34:23.523; [ x:techproducts] org.apache.solr.core.SolrCore; [techproducts] webapp=/solr path=/select params={q=id:SP2514N&wt=json&_=1552062352063} hits=1 status=0 QTime=1 On Thu, Mar 7, 2019 at 11:36 PM Zheng Lin Edwin Yeo <edwinye...@gmail.com> wrote: > Hi, > > Do you mean that when you startup Solr, it will automatically do the search > request even before the Solr is fully started up? > > Regards, > Edwin > > > On Fri, 8 Mar 2019 at 10:13, Rahul Goswami <rahul196...@gmail.com> wrote: > > > Hello Solr gurus, > > > > I am using Solr 7.2.1 (non-SolrCloud). I have a situation where Solr got > > killed before it could commit updates to the disk resulting in log replay > > on startup. During this interval, I observe that a searcher is opened > even > > before log replay has finished, resulting in some stale results, which in > > turn has a cascading effect on other parts of the application. Is there a > > setting in Solr which would prevent Solr from serving search requests > > before log replay has finished? > > > > Thanks, > > Rahul > > >