lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-1314) IndexReader.reopen(boolean force)
Date Thu, 03 Jul 2008 15:38:45 GMT


Michael McCandless commented on LUCENE-1314:

bq. I thought we wanted to check a commit on a clone that the index is current? Does it need
to be in a clone only portion of the code? Which class is best?

I think checking when a change is first made (and grabbing the write.lock to prevent others)
is safer?  Else you could lose changes you had made.  Ie if there are clones out there, the
first one that starts making changes prevents any others from doing so.  But I feel like I'm
missing something about Ocean: was there some driver for checking on commit instead?

bq. We need to clone norms. I want to make cloning deletedDocs and norms optional mainly because
it is a waste in Ocean to clone norms. Is the best way to give the option parameters to the
clone method (breaking Cloneable)? An additional option could be readOnly. Perhaps norms or
deletedDocs becomes readOnly if they are ref copied and not cloned. and reopen
would need a readOnly parameter. Or should a subclass of SegmentReader handle cloning or refing
norms and deletedDocs.

It'd be nice if we could do a copy-on-write approach.  This way no copy is made when you first
clone, but if you go to make a change, it makes a private copy only at that point.  And you
don't have to separately specify a readOnly up front only to find later you didn't pass in
the right value.

bq. I think it may be easiest to have readOnly be a part of this patch. I wanted to separate
out the FieldsReader synchronization code into a separate patch but then this patch would
have been messed up without it (the new FieldsReader per SegmentReader issue). Readonly may
end up being similar.

Maybe instead we wait on the readOnly patch until we resolve this one (ie stage them)?

> IndexReader.reopen(boolean force)
> ---------------------------------
>                 Key: LUCENE-1314
>                 URL:
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>    Affects Versions: 2.3.1
>            Reporter: Jason Rutherglen
>            Assignee: Michael McCandless
>            Priority: Minor
>         Attachments: lucene-1314.patch, lucene-1314.patch, lucene-1314.patch, lucene-1314.patch,
lucene-1314.patch, lucene-1314.patch
> Based on discussion 
The problem is reopen returns the same reader if there are no changes, so if docs are deleted
from the new reader, they are also reflected in the previous reader which is not always desired

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message