lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Updated: (LUCENE-992) IndexWriter.updateDocument is no longer atomic
Date Tue, 04 Sep 2007 18:34:45 GMT


Michael McCandless updated LUCENE-992:

    Attachment: LUCENE-992.patch

Attached patch.

I added a unit test that runs 2 indexing threads (calling
updateDocument) and 2 reader threads and asserts in the reader threads
that the number of documents never changes.

I also slightly changed the exception semantics in IndexWriter:
previously if a disk full (or other) exception was hit when flushing
the buffered docs, the buffered deletes were retained but the
partially flushed buffered docs (if any) were discarded.  I think this
was actually a bug because the buffered deletes must also be discarded
since they refer to document numbers that are no longer valid.  So I
changed it to also clear buffered deletes on exception, and had to
change one unit test (TestIndexWriterDelete) to match this.

> IndexWriter.updateDocument is no longer atomic
> ----------------------------------------------
>                 Key: LUCENE-992
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 2.2
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.3
>         Attachments: LUCENE-992.patch
> Spinoff from LUCENE-847.
> Ning caught that as of LUCENE-843, we lost the atomicity of the delete
> + add in IndexWriter.updateDocument.
> Ning suggested a simple fix: move the buffered deletes into
> DocumentsWriter and let it do the delete + add atomically.  This has a
> nice side effect of also consolidating the "time to flush" logic in
> DocumentsWriter.

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