Re: ltr (reranking) in combination with cursorMarks

2020-08-30 Thread Dmitry Kan
Hi Martin,

I've ran into the same issue and the only solution that worked was to fall
back to (less efficient) start & rows parameters. Can you consider filing a
jira?

Thanks,

Dmitry

On Mon, Aug 12, 2019 at 10:45 PM Martin Ruderer 
wrote:

> Hello,
>
> I am trying to use ltr together with cursorMarks on solr 7.7 and I am
> getting the exception java.lang.ClassCastException:
> org.apache.lucene.search.TopDocs cannot be cast to
> org.apache.lucene.search.TopFieldDocs (full stacktrace below).
>
> Browsing Jira I have found an issue that suggests I should always
> include sort by score when combining reranking with cursorMarks.
> However, that hasn't changed anything.
>
> Is there anything I am missing?
>
> o.a.s.s.HttpSolrCall null:java.lang.ClassCastException:
> org.apache.lucene.search.TopDocs cannot be cast to
> org.apache.lucene.search.TopFieldDocs
> at
> org.apache.solr.search.SolrIndexSearcher.populateNextCursorMarkFromTopDocs(SolrIndexSearcher.java:1458)
> at
> org.apache.solr.search.SolrIndexSearcher.getDocListAndSetNC(SolrIndexSearcher.java:1686)
> at
> org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1395)
> at
> org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:566)
> at
> org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:545)
> at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:296)
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
> at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:724)
> at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:530)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> at
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> at org.eclipse.jetty.server.Server.handle(Server.java:534)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
> at org.eclipse.jetty.io
> .AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
> at org.eclipse.jetty.io
> .SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
> at java.lang.Thread.run(Thread.java:748)
>
> Best regards,
> Martin Ruderer
> --
> Martin Ruderer
> Dr. rer. nat. Dipl.-Math.
>
> freiheit.com technologies gmbh
> Budapester Straße 45
> 20359 Hamburg / Germany
> fon: +49 40 / 890584-0
> Hamburg HRB 70814
>
> +++ Hamburg/ Germany + Lisbon/ Portugal +++
>
> https://www.freiheit.com
> https://www.facebook.com/freiheitcom
>
> B444 034F 9C95 A569 C5DA  087C E6B9 CCF9 5572 A904
> Geschäftsführer: Claudia Dietze, Stefan Richter
>


-- 
Dmitry Kan
Luke Toolbox: http://github.com/DmitryKey/luke
Blog: http://dmitrykan.blogspot.com
Twitter: http://twitter.com/dmitrykan
S

Re: How to Prevent Recovery?

2020-08-30 Thread Anshuman Singh
Hi,

I changed all the replicas, 50x2, from NRT to TLOG by adding TLOG replicas
using the ADDREPLICA API and then deleting the NRT replicas.
But now, these replicas are going into recovery even more frequently during
indexing. Same errors are observed.
Also, commit is taking a lot of time compared to NRT replicas.
Can this be due to the fact that most of the indexes are on disk and not in
RAM, and therefore copying index from leader is causing high disk
utilisation and causing poor performance?
Do I need to tweak the auto commit settings? Right now it is 30 seconds max
time and 100k max docs.

Regards,
Anshuman

On Tue, Aug 25, 2020 at 10:23 PM Erick Erickson 
wrote:

> Commits should absolutely not be taking that much time, that’s where I’d
> focus first.
>
> Some sneaky places things go wonky:
> 1> you have  suggester configured that builds whenever there’s a commit.
> 2> you send commits from the client
> 3> you’re optimizing on commit
> 4> you have too much data for your hardware
>
> My guess though is that the root cause of your recovery is that the
> followers
> get backed up. If there are enough merge threads running, the
> next update can block until at least one is done. Then the scenario
> goes something like this:
>
> leader sends doc to follower
> follower does not index the document in time
> leader puts follower into “leader initiated recovery”.
>
> So one thing to look for if that scenario is correct is whether there are
> messages
> in your logs with "leader-initiated recovery” I’d personally grep my logs
> for
>
> grep logfile initated | grep recovery | grep leader
>
> ‘cause I never remember whether that’s the exact form. If it is this, you
> can
> lengthen the timeouts, look particularly for:
> • distribUpdateConnTimeout
> • distribUpdateSoTimeout
>
> All that said, your symptoms are consistent with a lot of merging going
> on. With NRT
> nodes, all replicas do all indexing and thus merging. Have you considered
> using TLOG/PULL replicas? In your case they could even all be TLOG
> replicas. In that
> case, only the leader does the indexing, the other TLOG replicas of a
> shard just stuff
> the documents into their local tlogs without indexing at all.
>
> Speaking of which, you could reduce some of the disk pressure if you can
> put your
> tlogs on another drive, don’t know if that’s possible. Ditto the Solr logs.
>
> Beyond that, it may be a matter of increasing the hardware. You’re really
> indexing
> 120K records second ((1 leader + 2 followers) * 40K)/sec.
>
> Best,
> Erick
>
> > On Aug 25, 2020, at 12:02 PM, Anshuman Singh 
> wrote:
> >
> > Hi,
> >
> > We have a 10 node (150G RAM, 1TB SAS HDD, 32 cores) Solr 8.5.1 cluster
> with
> > 50 shards, rf 2 (NRT replicas), 7B docs, We have 5 Zk with 2 running on
> the
> > same nodes where Solr is running. Our use case requires continuous
> > ingestions (updates mostly). If we ingest at 40k records per sec, after
> > 10-15mins some replicas go into recovery with the errors observed given
> in
> > the end. We also observed high CPU during these ingestions (60-70%) and
> > disks frequently reach 100% utilization.
> >
> > We know our hardware is limited but this system will be used by only a
> few
> > users and search times taking a few minutes and slow ingestions are fine
> so
> > we are trying to run with these specifications for now but recovery is
> > becoming a bottleneck.
> >
> > So to prevent recovery which I'm thinking could be due to high CPU/Disk
> > during ingestions, we reduced the data rate to 10k records per sec. Now
> CPU
> > usage is not high and recovery is not that frequent but it can happen in
> a
> > long run of 2-3 hrs. We further reduced the rate to 4k records per sec
> but
> > again it happened after 3-4 hrs. Logs were filled with the below error on
> > the instance on which recovery happened. Seems like reducing data rate is
> > not helping with recovery.
> >
> > *2020-08-25 12:16:11.008 ERROR (qtp1546693040-235) [c:collection
> s:shard41
> > r:core_node565 x:collection_shard41_replica_n562] o.a.s.s.HttpSolrCall
> > null:java.io.IOException: java.util.concurrent.TimeoutException: Idle
> > timeout expired: 30/30 ms*
> >
> > Solr thread dump showed commit threads taking upto 10-15 minutes.
> Currently
> > auto commit happens at 10M docs or 30seconds.
> >
> > Can someone point me in the right direction? Also can we perform
> > core-binding for Solr processes?
> >
> > *2020-08-24 12:32:55.835 WARN  (zkConnectionManagerCallback-11-thread-1)
> [
> >  ] o.a.s.c.c.ConnectionManager Watcher
> > org.apache.solr.common.cloud.ConnectionManager@372ea2bc name:
> > ZooKeeperConnection Watcher:x.x.x.7:2181,x.x.x.8:2181/solr got event
> > WatchedEvent state:Disconnected type:None path:null path: null type:
> None*
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > *2020-08-24 12:41:02.005 WARN  (main-SendThread(x.x.x.8:2181)) [   ]
> > o.a.z.ClientCnxn Unable to reconnect to ZooKeeper service, session
> > 0