[
https://issues.apache.org/jira/browse/SOLR-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17062852#comment-17062852
]
David Smiley commented on SOLR-14325:
-------------------------------------
It's strange to me that using IndexReaderFactory suddenly made things better;
I'm suspicious. The only implementation trivially calls
{{DirectoryReader.open(indexDir);}} which is what you were doing before in the
first patch, and led to the exception sometimes about a missing file.
I see that you added SolrCore.getDirectory() but the callers all need to be
careful to call directoryFactory.release(Directory) on it, so it's kind of a
leaky API and I don't like it as-is. I also don't like getters that actually
create brand new things. As an alternative, maybe consider a "withDirectory"
and a lambda, similar to the withSearcher method. In CoreAdminOperation, the
line where you compute the size, you are calling getDirectory and thus actually
getting a brand new Directory (plus failed to release it!). This is wasteful;
instead call dirReader.directory() since there is _already_ a directory
available here.
Still; code feedback aside, I'm suspicious that there won't be more mysterious
IOExceptions about a file vanishing. You needn't share the JSONs; I believe
you.
Were you able to see if \{{getNewestSearcher(false)}} returns quickly or not
during replication?
> Core status could be improved to not require an IndexSearcher
> -------------------------------------------------------------
>
> Key: SOLR-14325
> URL: https://issues.apache.org/jira/browse/SOLR-14325
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: David Smiley
> Priority: Major
> Attachments: SOLR-14325.patch, SOLR-14325.patch
>
>
> When the core status is told to request "indexInfo", it currently grabs the
> SolrIndexSearcher but only to grab the Directory. SolrCore.getIndexSize also
> only requires the Directory. By insisting on a SolrIndexSearcher, we
> potentially block for awhile if the core is in recovery since there is no
> SolrIndexSearcher.
> [https://lists.apache.org/thread.html/r076218c964e9bd6ed0a53133be9170c3cf36cc874c1b4652120db417%40%3Cdev.lucene.apache.org%3E]
> It'd be nice to have a solution that conditionally used the Directory of the
> SolrIndexSearcher only if it's present so that we don't waste time creating
> one either.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]