Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 53585 invoked from network); 4 Sep 2007 18:35:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2007 18:35:10 -0000 Received: (qmail 45279 invoked by uid 500); 4 Sep 2007 18:35:04 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 44619 invoked by uid 500); 4 Sep 2007 18:35:02 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 44608 invoked by uid 99); 4 Sep 2007 18:35:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 11:35:02 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 18:36:21 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0E57A714201 for ; Tue, 4 Sep 2007 11:34:45 -0700 (PDT) Message-ID: <614683.1188930885055.JavaMail.jira@brutus> Date: Tue, 4 Sep 2007 11:34:45 -0700 (PDT) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-992) IndexWriter.updateDocument is no longer atomic In-Reply-To: <23198114.1188930525002.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-992?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] 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: https://issues.apache.org/jira/browse/LUCENE-992 > 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: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org