Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 25110 invoked from network); 19 Jun 2009 22:28:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 Jun 2009 22:28:19 -0000 Received: (qmail 58440 invoked by uid 500); 19 Jun 2009 22:28:30 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 58376 invoked by uid 500); 19 Jun 2009 22:28:29 -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 58298 invoked by uid 99); 19 Jun 2009 22:28:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jun 2009 22:28:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jun 2009 22:28:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6D3AC29A0014 for ; Fri, 19 Jun 2009 15:28:07 -0700 (PDT) Message-ID: <1633751752.1245450487446.JavaMail.jira@brutus> Date: Fri, 19 Jun 2009 15:28:07 -0700 (PDT) From: "Uwe Schindler (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1703) Add a waitForMerges() method to IndexWriter In-Reply-To: <183997312.1245433567763.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722065#action_12722065 ] Uwe Schindler commented on LUCENE-1703: --------------------------------------- bq. I still don't understand how if autocommit=false, and addDocument/deleteDocument can trigger a merge. Why not? I always use autocommit=false. After I added a number of documents to the index some of the existing not-yet committed segments get merged. It will never merge the current existing and committed segments, but the segments created during indexing can be merged. After commit() or close() the already existing and the new segments are maybe additionally merged and a new segments file written. > Add a waitForMerges() method to IndexWriter > ------------------------------------------- > > Key: LUCENE-1703 > URL: https://issues.apache.org/jira/browse/LUCENE-1703 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Affects Versions: 2.4 > Reporter: Tim Smith > Attachments: IndexWriter.java.diff, IndexWriter.java.diff > > > It would be very useful to have a waitForMerges() method on the IndexWriter. > Right now, the only way i can see to achieve this is to call IndexWriter.close() > ideally, there would be a method on the IndexWriter to wait for merges without actually closing the index. > This would make it so that background merges (or optimize) can be waited for without closing the IndexWriter, and then reopening a new IndexWriter > the close() reopen IndexWriter method can be problematic if the close() fails as the write lock won't be released > this could then result in the following sequence: > * close() - fails > * force unlock the write lock (per close() documentation) > * new IndexWriter() (acquires write lock) > * finalize() on old IndexWriter releases the write lock > * Index is now not locked, and another IndexWriter pointing to the same directory could be opened > If you don't force unlock the write lock, opening a new IndexWriter will fail until garbage collection calls finalize() the old IndexWriter > If the waitForMerges() method is available, i would likely never need to close() the IndexWriter until right before the process being shutdown, so this issue would not occur (worst case scenario, the waitForMerges() fails) -- 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