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

Shai Erera commented on LUCENE-3441:
------------------------------------

The side effect of sharing the cache is for TR-1 to receive an ordinal which 
doesn't actually exist. We can document that if you use openIfChanged, but 
continue to use the old reader, then this sort of thing can happen. Really, 
this is not how people should use openIfChanged ...

Another idea I had is to wrap the cache with an object that keeps track of 
'upto'. I.e. TR-1's instance's upto will be e.g. 123. On openIfChanged we 
allocate a new instance for TR-2, with upto=1035, sharing the same LRU 
instance. On each access to the cache, we check if the returned ordinal is <= 
upto, otherwise return INVALID.

But that adds another 'if' to every cache-check. How expensive is it, not sure 
yet, since the taxonomy is not accessed for so many facets.

It feels like we need to make some compromise here - either at runtime 
performance or possible correctness. Since the usage of openIfChanged is well 
defined, and assuming that people who interact with the taxonomy are aware 
Lucen's NRT, should we rely on the old taxo reader instances to not be used 
after openIfChanged?
                
> Add NRT support to LuceneTaxonomyReader
> ---------------------------------------
>
>                 Key: LUCENE-3441
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3441
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: modules/facet
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>         Attachments: LUCENE-3441.patch
>
>
> Currently LuceneTaxonomyReader does not support NRT - i.e., on changes to 
> LuceneTaxonomyWriter, you cannot have the reader updated, like 
> IndexReader/Writer. In order to do that we need to do the following:
> # Add ctor to LuceneTaxonomyReader to allow you to instantiate it with 
> LuceneTaxonomyWriter.
> # Add API to LuceneTaxonomyWriter to expose its internal IndexReader
> # Change LTR.refresh() to return an LTR, rather than void. This is actually 
> not strictly related to that issue, but since we'll need to modify refresh() 
> impl, I think it'll be good to change its API as well. Since all of facet API 
> is @lucene.experimental, no backwards issues here (and the sooner we do it, 
> the better).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to