Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 6561 invoked from network); 20 Dec 2005 11:12:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Dec 2005 11:12:38 -0000 Received: (qmail 80892 invoked by uid 500); 20 Dec 2005 11:11:59 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 80667 invoked by uid 500); 20 Dec 2005 11:11:54 -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 80603 invoked by uid 99); 20 Dec 2005 11:11:51 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2005 03:11:51 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 6EFE9C9 for ; Tue, 20 Dec 2005 12:11:30 +0100 (CET) Message-ID: <76786394.1135077090363.JavaMail.jira@ajax.apache.org> Date: Tue, 20 Dec 2005 12:11:30 +0100 (CET) From: "Luc Vanlerberghe (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Created: (LUCENE-481) IndexReader.getCurrentVersion() and isCurrent should use commit lock. Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N IndexReader.getCurrentVersion() and isCurrent should use commit lock. --------------------------------------------------------------------- Key: LUCENE-481 URL: http://issues.apache.org/jira/browse/LUCENE-481 Project: Lucene - Java Type: Bug Components: Index Versions: CVS Nightly - Specify date in submission Environment: Windows platform, all Lucene versions Reporter: Luc Vanlerberghe There is a race condition if one machine is checking the current version of an index while another wants to update the segments file in IndexWriter.close(). java.io.IOException: Cannot delete segments at org.apache.lucene.store.FSDirectory.renameFile(FSDirectory.java:213) at org.apache.lucene.index.SegmentInfos.write(SegmentInfos.java:90) at org.apache.lucene.index.IndexWriter$3.doBody(IndexWriter.java:503) at org.apache.lucene.store.Lock$With.run(Lock.java:109) at org.apache.lucene.index.IndexWriter.mergeSegments(IndexWriter.java:501) at org.apache.lucene.index.IndexWriter.flushRamSegments(IndexWriter.java:440) at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:242) On the windows platform reading the contents of a file disallows deleting the file. I use Lucene to maintain an index of +-700.000 documents, one server adds documents, while other servers handle the searches. The search servers poll the index version regularly to check if they have to reopen their IndexSearcher. Once in a while (about once every two days on average), IndexWriter.close() fails because it cannot delete the previous segments file, even though it hold the commit lock. The reason is probably that search servers are reading the segments file to check the version without using the commit lock. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org