[ 
https://issues.apache.org/jira/browse/SOLR-10726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18132072#comment-18132072
 ] 

Nick Shanin commented on SOLR-10726:
------------------------------------

>From code reading against apache/main b73f03976fa, after a replication in 
>SolrCloud the replica closes and reopens its searcher 
>(solr/core/src/java/org/apache/solr/handler/IndexFetcher.java:679, 807). 
>firstSearcher listeners fire whenever no searcher is registered 
>(solr/core/src/java/org/apache/solr/core/SolrCore.java:2640-2645), so they can 
>run more than once per replica. Is that still the behaviour you see?

🤖 AI-generated 🤖

> SolrCloud opens multiple searchers on replica creation/startup
> --------------------------------------------------------------
>
>                 Key: SOLR-10726
>                 URL: https://issues.apache.org/jira/browse/SOLR-10726
>             Project: Solr
>          Issue Type: Bug
>          Components: search, SolrCloud
>    Affects Versions: 6.5.1
>            Reporter: Shalin Shekhar Mangar
>            Priority: Major
>              Labels: difficulty-medium, impact-high
>         Attachments: SOLR-10726.semaphore.newsearcher.test.patch, 
> semaphore.newsearcher.test.log.txt
>
>
> I was investigating some curious behavior reported by a customer around first 
> searcher event listeners and multiple searchers being opened when adding a 
> new replica.
> Turns out that if you add a new replica to solrcloud:
> 1) Searchers are opened at least twice and possibly a third time
> 2) the first time is because of a new core coming online and opening searcher 
> on an empty index -- only firstSearcher event listeners are fired here
> 3) second time is after replication is complete and we have new index files 
> available -- firstSearcher event listeners are fired again because the old 
> searcher opened on core load has already been closed and disposed so this is 
> technically again a first searcher
> 4) third time happens after documents buffered during recovery are replayed 
> -- if there was no indexing happening on leader then this step is skipped -- 
> a newSearcher event is fired here because we had already opened a searcher in 
> the last step
> Now if instead of a new replica, a solr node is restarted then there can be 
> upto four searcher opens -- the additional open is because of log replay on 
> startup.
> So Solr spends a lot of time on unnecessary warming/autowarming on searchers 
> that are discarded. It is not just warming because sometimes plugins such as 
> SpellCheckComponent and SuggestComponent can also tie in to these listener 
> events.
> We can probably cut a few of them or at least defer the decision of whether 
> to fire these listeners to places such as RecoveryStrategy which have a 
> better idea of whether it is worth it.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to